Local Image Generation on Apple Silicon

Flux and Stable Diffusion run natively on Apple Silicon through MLX. Ollama Herd routes image generation across your whole fleet, so a request lands on whichever Mac has the model and the spare capacity, from one endpoint.

Image generation on Apple Silicon is genuinely good now. Flux and Stable Diffusion run natively through Apple's MLX framework, no NVIDIA GPU required, at roughly 18 to 20 seconds per 1024px image on an M3 Ultra. The catch, if you run more than one Mac, is that image models are CLI subprocesses: there is no HTTP API, no service discovery, and not every machine in a fleet has the model installed. Ollama Herd wraps that away, so image generation routes across your fleet the same way LLM inference does.

Three backends, one endpoint

BackendModelsInstallHow it runs
mfluxz-image-turbo, flux-dev, flux-schnelluv tool install mfluxCLI subprocess on port 11436
DiffusionKitsd3-medium, sd3.5-largeuv tool install diffusionkitCLI subprocess on port 11436
Ollama nativex/z-image-turbo, x/flux2-kleinollama pull x/z-image-turboStandard Ollama proxy

All three route through /api/generate-image (Ollama format) or /v1/images/generations (OpenAI format). The router detects which backend serves each model and picks the node. Use GET /api/image-models to discover what is available across the fleet and which nodes have it.

Why route images through a fleet at all

On one Mac, you would just call the CLI. The problems start at fleet scale:

  • Image models have no HTTP API and no discovery, so an agent on another machine cannot find or reach them.
  • In a fleet of Mac Minis, not every node has the image model installed (they are multi-GB downloads).
  • There is no visibility into which node generated which image or how long it took.

Herd solves this the same way it does for LLMs: node agents detect the mflux and DiffusionKit binaries and advertise them in heartbeats, a lightweight image server on each node wraps the CLI as an HTTP endpoint (port 11436), and the router scores candidates and proxies each request to the best node. One endpoint replaces direct subprocess calls.

Generating an image

Enable image-generation routing first (dashboard toggle at /dashboard/settings, the settings API, or FLEET_IMAGE_GENERATION=true), then:

curl -o image.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
  }'

The response is raw PNG bytes, with headers that tell you what happened: X-Fleet-Node (which Mac generated it), X-Fleet-Model, and X-Generation-Time in milliseconds.

ParameterDefaultDescription
modelrequiredz-image-turbo, flux-dev, flux-schnell, sd3-medium, sd3.5-large, x/z-image-turbo, x/flux2-klein
promptrequiredText description of the image
negative_promptemptyWhat to avoid
width / height1024Output size in pixels
steps4Inference steps (more is higher quality, slower)
guidancemodel defaultHow strongly to follow the prompt
seedrandomSeed for reproducible output
quantize8Quantization level (3, 4, 5, 6, or 8 bit)

Which backend to install

mflux is preferred automatically when both can serve a model. The reason is memory: Ollama-native image models load into the same memory pool as your LLMs, so a 12 GB image model can evict your resident coding model and break text inference. mflux runs as a separate subprocess and leaves Ollama's memory alone, so Herd routes to it first and falls back to Ollama-native only when mflux is not installed. Use DiffusionKit when you specifically want Stable Diffusion 3 or 3.5. (DiffusionKit needs a one-time sw_vers patch on macOS 26; see the OSS image-generation guide for the fix.)

Part of the multimodal stack

Image generation is one of several non-text workloads Herd routes. An agent can chain them: transcribe a voice note, reason over it with an LLM, and generate an illustration, each step landing on whichever node has capacity, all through localhost:11435. See multimodal routing for the full picture.

Related Reading