generate_image
Create or edit images via OpenAI, Gemini, fal.ai, or Cloudflare. Saves full-resolution files to disk and returns file paths plus a JPEG preview.
Instructions
Generate or edit an image. Saves full-resolution files to disk and returns paths plus a JPEG preview.
provider (default: first configured of openai, gemini, fal, cloudflare):
openai: default model gpt-image-2. aspect_ratio maps to size (1:1 -> 1024x1024; 16:9/3:2/4:3 -> 1536x1024; 9:16/2:3/3:4 -> 1024x1536). options merged into the request body (e.g. quality, background, n, output_format); options["size"] wins. input_images switches to /images/edits.
gemini: default gemini-3-pro-image (Nano Banana Pro). aspect_ratio -> imageConfig.aspectRatio (e.g. 16:9). options shallow-update generationConfig (e.g. imageConfig with imageSize).
fal: default fal-ai/nano-banana-pro. Input {prompt, aspect_ratio, image_urls} updated with options (model-specific params such as num_images, resolution, image_size). Any model id works.
cloudflare: default @cf/black-forest-labs/flux-1-schnell. Body {prompt} updated with options (e.g. steps, seed). No input_images.
input_images: local file paths, http(s) URLs or data URIs, used as edit targets or references.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | ||
| prompt | Yes | ||
| options | No | ||
| provider | No | ||
| aspect_ratio | No | ||
| input_images | No |