Skip to main content

Image Generation

The image_generate tool lets the agent create and edit images using your configured providers. Generated images are delivered automatically as media attachments in the agent’s reply.
The tool only appears when at least one image generation provider is available. If you don’t see image_generate in your agent’s tools, configure agents.defaults.imageGenerationModel or set up a provider API key.

Quick start

  1. Set an API key for at least one provider (for example OPENAI_API_KEY or GEMINI_API_KEY).
  2. Optionally set your preferred model:
  1. Ask the agent: “Generate an image of a friendly lobster mascot.”
The agent calls image_generate automatically. No tool allow-listing needed — it’s enabled by default when a provider is available.

Supported providers

Use action: "list" to inspect available providers and models at runtime:

Tool parameters

Not all providers support all parameters. When a fallback provider supports a nearby geometry option instead of the exact requested one, Velaclaw remaps to the closest supported size, aspect ratio, or resolution before submission. Truly unsupported overrides are still reported in the tool result. Tool results report the applied settings. When Velaclaw remaps geometry during provider fallback, the returned size, aspectRatio, and resolution values reflect what was actually sent, and details.normalization captures the requested-to-applied translation.

Configuration

Model selection

Provider selection order

When generating an image, Velaclaw tries providers in this order:
  1. model parameter from the tool call (if the agent specifies one)
  2. imageGenerationModel.primary from config
  3. imageGenerationModel.fallbacks in order
  4. Auto-detection — uses auth-backed provider defaults only:
    • current default provider first
    • remaining registered image-generation providers in provider-id order
If a provider fails (auth error, rate limit, etc.), the next candidate is tried automatically. If all fail, the error includes details from each attempt. Notes:
  • Auto-detection is auth-aware. A provider default only enters the candidate list when Velaclaw can actually authenticate that provider.
  • Auto-detection is enabled by default. Set agents.defaults.mediaGenerationAutoProviderFallback: false if you want image generation to use only the explicit model, primary, and fallbacks entries.
  • Use action: "list" to inspect the currently registered providers, their default models, and auth env-var hints.

Image editing

OpenAI, Google, fal, MiniMax, and ComfyUI support editing reference images. Pass a reference image path or URL:
OpenAI and Google support up to 5 reference images via the images parameter. fal, MiniMax, and ComfyUI support 1. MiniMax image generation is available through both bundled MiniMax auth paths:
  • minimax/image-01 for API-key setups
  • minimax-portal/image-01 for OAuth setups

Provider capabilities