generate_image
Generate images from text descriptions, optionally using reference images to match style or edit existing pictures, and return local file paths.
Instructions
Generate one or more images from a description and write them to disk, returning their paths. Optionally takes REFERENCE IMAGES (paths on this machine) and extra text context, both of which steer the result: use them to match an existing style, keep a character or product consistent, or edit an image you already have. Defaults to OpenAI GPT Image 2; pass style as gemini/nanobanana, gemini-pro, photoreal (Recraft), seedream, or grok. For a REAL editable SVG set svg: true, which routes to Arrow; the raster models can only imitate one. A billed call per image.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | How many images. Defaults to 1, capped at 4 by this server. Each one is billed. | |
| svg | No | Generate a REAL SVG: vector source you can open, edit and scale, from Arrow 1.1. Set this whenever the user asked for an SVG, a logo, an icon, or a diagram. Overrides `style`. Note that the raster models cannot produce an SVG; they can only produce a picture that looks like one. | |
| seed | No | Seed, where the provider supports one, for a repeatable result. | |
| size | No | Exact pixel size, e.g. 1024x1024. Provider support varies; unsupported values come back as a warning. | |
| style | No | Which model. Omit for the default (openai). Accepted: openai, gpt-image, gpt-image-2, dalle, google, gemini, nanobanana, nano-banana, nano banana, gemini-pro, geminipro, gemini-3-pro, bytedance, seedream, quiver, quiverai, grok, xai, imagine, recraft, photo, photoreal, photorealistic, arrow, svg. "seedream" and "svg"/"arrow" need the gateway key. | |
| prompt | Yes | What to generate. Detail helps: subject, composition, lighting, style, and what to leave out. | |
| context | No | Extra text context appended to the prompt: brand rules, a palette, what the surrounding page says, things to avoid. Kept separate from `prompt` so the subject stays legible. | |
| basename | No | Filename stem, e.g. "hero". A short random suffix is always added so a second call cannot overwrite the first. | |
| outputDir | No | Where to write the images. Defaults to IMAGE_GEN_OUTPUT_DIR, or the current working directory. | |
| aspectRatio | No | Aspect ratio, e.g. 16:9. Use instead of `size` when the exact pixels do not matter. | |
| referenceImages | No | Paths to images on THIS machine to use as visual context: a style to match, a product to keep consistent, or an image to edit. Read by the server, so absolute paths are safest. Not URLs, and not base64. |