Skip to main content
The @image tool generates images from a prompt via the llm/imagegen package, local/keyless-first and multi-provider.

Backend selection (local first)

imagegen.NewFromEnv picks, degrading to null when nothing is configured:
  1. CHATCLI_IMAGE_PROVIDER=sdwebui → local Stable Diffusion WebUI (/sdapi/v1/txt2img, default http://localhost:7860). Keyless — the preferred path.
  2. CHATCLI_IMAGE_URL → an OpenAI-compatible endpoint (/images/generations). Covers OpenAI, LocalAI and similar.
  3. OPENAI_API_KEYOpenAI Images API (default gpt-image-1).
  4. CHATCLI_IMAGE_PROVIDER=responses (or openai + CHATCLI_IMAGE_API=responses) → OpenAI Responses API, where a chat model like gpt-5.5 generates the image via the image_generation tool.
  5. GOOGLEAI_API_KEY/GEMINI_API_KEYnative Google Imagen (own :predict shape).
  6. XAI_API_KEYnative xAI grok-image (OpenAI shape, omits size).
  7. CHATCLI_IMAGE_PROVIDER=bedrockAWS Bedrock (Nova Canvas / Titan Image / Stability via InvokeModel, reusing the chat provider’s credential chain).
CHATCLI_IMAGE_PROVIDER pins the backend (sdwebui|url|openai|responses|google|xai|bedrock); CHATCLI_IMAGE_API chooses images|responses for OpenAI; CHATCLI_IMAGE_MODEL tunes the model.
Two OpenAI APIs: the Images API (gpt-image-2/1.5/1/1-mini family) and the Responses API (gpt-5.5 and gpt-5+ via the image_generation tool). On Bedrock, image generation is via the dedicated models (Nova/Titan/Stability), not the chat models. Chat providers with no image API (Anthropic, text-only Ollama…) can’t be added — the endpoint doesn’t exist.

Models & config by command

@image models                         # catalog + your OpenAI account models
/config image                         # panorama (backend, api, model, url)
/config image provider responses      # switch the backend
/config image api responses           # OpenAI: Images vs Responses
/config image model gpt-5.5           # set the model
/config image models                  # list the catalog
/config image reset                   # clear overrides
Current catalog (summary): OpenAI Images gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini; OpenAI Responses gpt-5.5, gpt-5; Google imagen-3.0-generate-002; xAI grok-2-image, grok-imagine-image-quality; Bedrock amazon.nova-canvas-v1:0, amazon.titan-image-generator-v2:0, stability.sd3-5-large-v1:0, stability.stable-image-ultra-v1:1.

@image tool

<tool_call name="@image" args='{"cmd":"gen","args":{"prompt":"a watercolor fox","size":"1024x1024"}}' />
<tool_call name="@image" args='{"cmd":"status"}' />
SubcommandPurpose
gen {prompt, size?, n?, out?}generate image(s) and save to file; out = file (1 image) or directory (multiple)
statusshow the effective backend
The result reports the generated file path(s). Check the backend in /config (Image generation (@image)).

Privacy & cost

  • Local Stable Diffusion WebUI is keyless and keeps everything on your machine — ideal for privacy and zero cost.
  • Cloud backends use the user’s own key.
  • Confirm before generating large batches; mention cost where applicable.