Skip to main content
The @image tool generates and edits images through the llm/imagegen package. It is multi-provider and local/keyless-first.
  • The AI can list the models every configured provider offers your account right now.
  • It can switch backend or model when you ask (“use Gemini for images”).
  • It edits on the active backend, in that provider’s own request format.

Backend selection

imagegen.NewFromEnv picks the backend, and falls back to null when nothing is configured. CHATCLI_IMAGE_PROVIDER pins a backend. Values: sdwebui|url|openai|responses|google|xai|zai|minimax|bedrock. In auto (or empty), the backend is chosen in this order:
  1. CHATCLI_IMAGE_MODEL: the provider that serves the model. gemini-nano-banana-2.1 routes to Google, stability.* to Bedrock, grok-* to xAI.
  2. CHATCLI_IMAGE_URL: a self-hosted endpoint.
  3. The first provider with a credential: OpenAI, Google, xAI, Z.AI, MiniMax.
One model serves both generation and editing. @image gen and @image edit read the same CHATCLI_IMAGE_PROVIDER and CHATCLI_IMAGE_MODEL.

The @image tool

edit arguments
  • image: path to the input image.
  • images: several input images, for models that take references.
  • mask: PNG mask for inpainting. White marks the area to change. An unreadable mask fails the edit instead of repainting the whole image.
  • strength: 0..1, how much to change the input.
What models shows for each backend
  • Whether the backend is configured.
  • The models it offers your account now. It uses the provider’s own listing where one exists, and the catalog otherwise.
  • For each model: gen/edit support, shutdown date and, on Bedrock, regions.
  • live:false skips the network.
How use switches
  • Model only: the provider that serves it is selected too.
  • Provider only: that provider’s default model is used.
  • for:"edit": pins the backend used for edits when the active one can’t edit.
  • Refused switches: a provider without its credential, and a model that has been shut down.
In the coder, just ask:
  • “list the image models I have”
  • “use Gemini for images”
  • “switch to Stability SD3.5 on Bedrock”
  • “remove the background of logo.png”
The AI calls models, then use, then gen or edit.

Availability marks in @image models

The listing has three more effects:
  • New ids show up: a model the provider lists but the catalog doesn’t know yet is shown and is usable.
  • Retired ids stay hidden: an id the catalog knows is shut down stays out, even if the provider still lists it.
  • Shutdown dates are enforced: a catalog model leaves the list on its shutdown day.

Editing per provider

Every API edits in its own request shape. @image edit runs on the active backend, in that backend’s contract. A backend that can’t edit fails before sending anything. The edit never moves silently to another account.

Bedrock: regions, profiles and models

Bedrock image generation today means Stability models only. Nova Canvas reached its end of life on 2026-09-30, and Titan Image is gone. What changes per model is where it runs and whether it needs a profile. Generation and image-to-image: stability.stable-image-core-v1:1, stability.stable-image-ultra-v1:1, stability.sd3-5-large-v1:0.
  • They are offered only in us-west-2, In-Region.
  • chatcli invokes them there even when AWS_REGION or BEDROCK_REGION points elsewhere.
  • That mismatch is what used to fail with The provided model identifier is invalid.
  • Core only generates. Ultra and SD3.5 Large also edit (strength).
Image Services: inpaint, erase object, remove background, control sketch, control structure, style guide, and creative, conservative and fast upscale.
  • They take an input image (no text-to-image) and run only through the US cross-region profile.
  • chatcli adds the us. prefix itself and invokes them from us-east-1, us-east-2 or us-west-2.
  • Inpaint and erase object use the mask.
  • Remove background, erase object and fast upscale ignore the prompt.
  • strength maps to control strength (control models), fidelity (style guide) or creativity (creative upscale, at most 0.35).
@image models also lists the Bedrock models @image does not drive yet, marked unsupported: search-and-replace, search-and-recolor, outpaint and style transfer. Bedrock errors now say what to do:
  • Wrong region: the error names where the model exists.
  • Missing profile: the error names the us. id to use.
  • Missing model access: the error points to the Bedrock console.

Editing on another backend: only when you pin it

When the active backend can’t edit, @image edit sends no request. It returns a clear error naming the backend and model, for example Z.AI glm-image or Bedrock stable-image-core. Keys for other providers do not move the edit to them. To edit on a different backend from the one that generates, pin it. The AI can do it with @image use {"provider":"xai","for":"edit"}, or you can set it yourself:
The reply then says so:
ℹ️ Image backend "zai" does not edit images; this edit ran on "sdwebui", as CHATCLI_IMAGE_EDIT_PROVIDER pins.
  • CHATCLI_IMAGE_EDIT_PROVIDER accepts sdwebui, url, openai, responses, google, xai, zai, minimax, bedrock.
  • It is only used when the active backend can’t edit.
  • If the pinned backend can’t edit either (missing key or a generate-only model), the error says that too.

Commands

  • /model-image, /config image model and @image use select the backend that serves the model. Picking a Gemini model while the provider is pinned to xAI therefore switches to Google instead of sending a Gemini id to xAI.
  • These switches last for the session. To keep one, set CHATCLI_IMAGE_PROVIDER/CHATCLI_IMAGE_MODEL (or CHATCLI_IMAGE_EDIT_PROVIDER/CHATCLI_IMAGE_EDIT_MODEL) in .env.

Catalog (Oct 2026)

@image models is the up-to-date view: it adds whatever your account lists that this table does not. MiniMax H3 Image (MiniMax-H3-Image and MiniMax-H3-Image-Highspeed, Nov 10, 2026) sits beside image-01, which stays the default; pick one with CHATCLI_IMAGE_MODEL (any casing — ChatCLI sends the exact id). It uses its own endpoint (POST /v1/images/generations) and takes explicit WIDTHxHEIGHT sizes from 655,360 to 20,000,000 pixels with an aspect ratio between 1:3 and 3:1, sent as given; a size outside those bounds falls back to the nearest supported aspect ratio at the 1K area. 1 to 10 images per call, PNG output (JPEG when n × width × height exceeds 20M pixels), generate only. The request is sent once, with no retry: MiniMax bills a generation even if the client disconnects, and the server may take up to 600 s. Token-priced per 1M: H3 Image $2.30 input text / $3.80 output image; Highspeed $2.30 / $7.60. A model leaves the list on its shutdown day, with no release needed. If one is still set in CHATCLI_IMAGE_MODEL or CHATCLI_IMAGE_EDIT_MODEL after that day, @image gen and @image edit fail before any request with the shutdown date and the replacement (for example, gpt-image-1 was shut down on 2026-10-23 (Replaced by gpt-image-2.5)), instead of the provider’s error.

Formats & details

  • OpenAI edits accept image/jpeg, image/png and image/webp (not gif). The multipart part’s Content-Type comes from the image bytes.
  • SD WebUI img2img maps strength to denoising_strength. The default is 0.6: a visible change that preserves the structure.
  • Bedrock Stability:
    • text-to-image sends an aspect_ratio;
    • SD3.5 Large edits with mode: image-to-image + strength;
    • Ultra edits with image + strength;
    • the Image Services send the fields each one takes.

Privacy & cost

  • Local Stable Diffusion WebUI is keyless and generates and edits on your machine. It is the private, zero-cost option.
  • Cloud backends use your own keys.
  • Confirm before generating or editing large batches, and mention the cost when it matters.