← 返回 Skills 市场
twinsgeeks

Mflux Image Router

作者 Twin Geeks · GitHub ↗ · v1.0.2 · MIT-0
darwin ✓ 安全检测通过
197
总下载
0
收藏
2
当前安装
5
版本数
在 OpenClaw 中安装
/install mflux-image-router
功能描述
Local mflux image generation on Apple Silicon — mflux routes Z-Image-Turbo, Flux Dev, Flux Schnell across your Mac fleet. mflux is MLX-native for Mac Studio,...
使用说明 (SKILL.md)

mflux Image Generation Router

You're helping someone generate images using mflux — an MLX-native image generation framework built for Apple Silicon. Instead of calling mflux as a subprocess on one machine, this routes mflux image generation requests across the fleet. The router picks the device with the mflux model loaded, the most free memory, and the lowest CPU load.

Why route mflux image generation

One machine running mflux image generation blocks other workloads. An mflux 1024x1024 image takes ~18 seconds on an M3 Ultra. If an agent needs another mflux image during that time, it waits. With fleet routing, the second mflux request goes to a different device.

mflux image generation also competes with LLM inference for GPU memory. The router knows which nodes are busy with LLM requests and routes mflux image generation to the least-loaded device.

Zero cloud costs. A Mac Mini M4 running mflux generates images at $0/request after the hardware investment. DALL-E charges $0.04/image. At 80 mflux images per day, that's $96/month saved.

Get started with mflux

pip install ollama-herd
herd                        # start the mflux image generation router (port 11435)
herd-node                   # start on each device running mflux
uv tool install mflux       # install mflux on devices for image generation

Enable mflux image generation:

curl -X POST http://localhost:11435/dashboard/api/settings \
  -H "Content-Type: application/json" \
  -d '{"image_generation": true}'

Package: ollama-herd | Repo: github.com/geeks-accelerator/ollama-herd

Generate an image with mflux

curl — mflux image generation

# mflux image generation via fleet router
curl -o mflux_output.png http://localhost:11435/api/generate-image \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-image-turbo",
    "prompt": "a neon-lit Tokyo alley at midnight, cyberpunk aesthetic",
    "width": 1024,
    "height": 1024,
    "steps": 4,
    "quantize": 8
  }'

Python — mflux image generation

import httpx

def mflux_generate_image(prompt, mflux_output_path="mflux_output.png", width=1024, height=1024):
    """Generate an image using mflux image generation via the fleet router."""
    mflux_resp = httpx.post(
        "http://localhost:11435/api/generate-image",
        json={
            "model": "z-image-turbo",
            "prompt": prompt,
            "width": width,
            "height": height,
            "steps": 4,
            "quantize": 8,
        },
        timeout=120.0,
    )
    mflux_resp.raise_for_status()
    with open(mflux_output_path, "wb") as f:
        f.write(mflux_resp.content)

    mflux_node = mflux_resp.headers.get("X-Fleet-Node", "unknown")
    mflux_time_ms = mflux_resp.headers.get("X-Generation-Time", "?")
    print(f"mflux image generation completed on {mflux_node} in {mflux_time_ms}ms")
    return mflux_output_path

JavaScript — mflux image generation

async function mfluxGenerateImage(prompt, width = 1024, height = 1024) {
  // mflux image generation via fleet router
  const mflux_resp = await fetch("http://localhost:11435/api/generate-image", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      model: "z-image-turbo", prompt, width, height, steps: 4, quantize: 8,
    }),
  });
  if (!mflux_resp.ok) throw new Error((await mflux_resp.json()).error);
  return Buffer.from(await mflux_resp.arrayBuffer());
}

mflux image generation parameters

Parameter Default Description
model (required) z-image-turbo, flux-dev, or flux-schnell — mflux models
prompt (required) Text description for mflux image generation
width 1024 mflux image width in pixels
height 1024 mflux image height in pixels
steps 4 mflux inference steps (4 is optimal for z-image-turbo)
quantize 8 mflux quantization level (3-8 bit). 8 is the sweet spot
seed random Integer seed for reproducible mflux output
negative_prompt "" What to avoid in the mflux image

mflux image generation response

  • 200 OK: Raw PNG bytes from mflux. Content-Type: image/png
  • X-Fleet-Node: Which device ran mflux image generation
  • X-Fleet-Model: mflux model used
  • X-Generation-Time: mflux generation time in milliseconds

Available mflux models

mflux Model Speed (M3 Ultra) Quality Use case
z-image-turbo ~7s (512px), ~18s (1024px) Good Fast mflux iteration
flux-dev ~30s (1024px) Highest Detailed mflux photorealistic
flux-schnell ~10s (1024px) Medium Fastest mflux variant

mflux image generation with request tags

Track per-project mflux image generation in the dashboard:

curl -o mflux_output.png http://localhost:11435/api/generate-image \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-image-turbo",
    "prompt": "your prompt for mflux image generation",
    "metadata": {"tags": ["mflux-project", "mflux-content-gen"]}
  }'

Also available on this fleet

LLM inference

curl http://localhost:11435/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-oss:120b","messages":[{"role":"user","content":"Hello"}]}'

Speech-to-text

curl -s http://localhost:11435/api/transcribe \
  -F "[email protected]" | python3 -m json.tool

Embeddings

curl http://localhost:11435/api/embeddings \
  -d '{"model":"nomic-embed-text","prompt":"search query"}'

Monitoring mflux image generation

# mflux image generation stats (last 24h)
curl -s http://localhost:11435/dashboard/api/image-stats | python3 -m json.tool

# Fleet health (includes mflux image generation activity)
curl -s http://localhost:11435/dashboard/api/health | python3 -m json.tool

Dashboard at http://localhost:11435/dashboard — mflux image generation queues show with [IMAGE] badge.

Full documentation

Agent Setup Guide — complete reference for all 4 model types including mflux.

Image Generation Guide — detailed mflux image generation API reference.

Guardrails

  • Never delete or modify mflux-generated images without explicit user confirmation.
  • Never pull or delete mflux models without user confirmation — downloads can be 3+ GB.
  • Never delete or modify files in ~/.fleet-manager/.
  • If no mflux image generation models available, suggest installing: uv tool install mflux.
安全使用建议
This skill appears to do what it says: route local mflux image generation across macOS machines. Before installing or running anything, review the referenced PyPI package (ollama-herd) and the GitHub repo to ensure they are trustworthy. Verify what 'uv tool' installs and whether these installers download large models or run background services. Running the router starts a local web server on port 11435—ensure that port is only accessible locally or protected by your firewall. If you do not want the agent to call local services autonomously, keep autonomous invocation disabled or only use the skill when you explicitly invoke it. If you need higher assurance, request the package source code or a reproducible build before installing.
能力评估
Purpose & Capability
Name/description (fleet router for local mflux image generation on macOS) match the instructions: examples call a local herd router on localhost:11435, and metadata lists macOS and fleet-related config paths. Required bins (curl/wget, optional python/pip) align with the provided examples.
Instruction Scope
Runtime instructions are limited to installing/starting the herd router and calling its localhost HTTP API to generate images. They do not instruct the agent to read arbitrary system files or unrelated credentials. However the skill advises installing/publishing packages and starting local services which the user should inspect.
Install Mechanism
The skill is instruction-only (no install spec), but it recommends pip install ollama-herd and 'uv tool install mflux'. Installing third‑party packages and tools from PyPI or unknown toolchains introduces risk; users should vet the package and repo before installation.
Credentials
The skill declares no required environment variables or credentials. The metadata lists two per-user config paths (~/.fleet-manager/*) which are relevant to a fleet router and therefore proportional to the stated purpose.
Persistence & Privilege
always:false and user-invocable: true. The skill does not request persistent system-wide privileges or modify other skills. It will interact with a local service (herd) if that service is installed and running.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install mflux-image-router
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /mflux-image-router 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
Cross-platform support: macOS, Linux, and Windows. Updated OS metadata, descriptions, and hardware recommendations.
v1.0.1
- Increased clarity that all image generation is via mflux, and emphasized fleet-based routing with mflux throughout. - Updated documentation to consistently reference "mflux image generation" and related workflows in code, descriptions, and usage examples. - Added multilingual keywords to the description for discoverability. - Improved parameter and response documentation sections for mflux image generation. - Reworded and simplified steps for getting started and using the router with mflux.
v1.2.0
- Updated skill description and doc introduction to include support for Stable Diffusion models and clarify Mac hardware compatibility. - Adjusted language to emphasize local, cloud-free image generation with no need for DALL-E or Midjourney. - Expanded device examples in the description (Mac Studio, Mac Mini, MacBook Pro). - No changes to API, parameters, or usage instructions. - Documentation improvements for clarity.
v1.1.0
- Updated description to clarify use case and model details. - Mentioned mflux as an MLX-native Stable Diffusion alternative. - Highlighted key speed and cost points for image generation. - Clarified focus on local, cloud-free image generation (no DALL-E/Midjourney). - No functional or API changes—documentation update only.
v1.0.0
Initial release of mflux-image-router — fleet-routed local image generation for Apple Silicon. - Route image generation across your Apple Silicon devices with automatic node selection based on memory, model availability, and CPU load. - Supports Z-Image-Turbo, Flux Dev, and Flux Schnell models with detailed usage guides for curl, Python, and JavaScript. - Features queue management, dashboard monitoring, and per-request tagging. - Integrates with Ollama Herd for LLM inference, speech-to-text, and embeddings on the same fleet. - Includes clear setup and API instructions, with guardrails against accidental file or model deletions.
元数据
Slug mflux-image-router
版本 1.0.2
许可证 MIT-0
累计安装 2
当前安装数 2
历史版本数 5
常见问题

Mflux Image Router 是什么?

Local mflux image generation on Apple Silicon — mflux routes Z-Image-Turbo, Flux Dev, Flux Schnell across your Mac fleet. mflux is MLX-native for Mac Studio,... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 197 次。

如何安装 Mflux Image Router?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install mflux-image-router」即可一键安装,无需额外配置。

Mflux Image Router 是免费的吗?

是的,Mflux Image Router 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Mflux Image Router 支持哪些平台?

Mflux Image Router 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(darwin)。

谁开发了 Mflux Image Router?

由 Twin Geeks(@twinsgeeks)开发并维护,当前版本 v1.0.2。

💬 留言讨论