Generate Image
generate_imageGenerate images from text prompts using Google Gemini, with control over aspect ratio, resolution, model, and output format for tailored visuals.
Instructions
Generate an image from a text prompt using Google Gemini.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model override. Options: - "gemini-nano-banana-2.1" (default): Best all-round, panoramic, grounding - "gemini-3.1-flash-lite-image": Fastest, cheapest, 1K only - "gemini-3.1-flash-image": Panoramic, grounding, 0.5K tier - "gemini-3-pro-image": Best text rendering, complex edits | |
| prompt | Yes | Text description of the image to generate | |
| quality | No | Quality preset: "fast" (gemini-3.1-flash-lite-image), "balanced" (gemini-nano-banana-2.1), or "quality" (gemini-3-pro-image, 2K). Mutually exclusive with 'model'. | |
| image_size | No | Resolution: "0.5K" (gemini-3.1-flash-image only), "1K" (default), "2K", or "4K". 2K/4K are not supported by gemini-3.1-flash-lite-image. | |
| temperature | No | Creativity level 0.0-2.0 | |
| aspect_ratio | No | Image dimensions (1:1, 16:9, 9:16, etc.) | 1:1 |
| output_format | No | File format: "png", "jpeg", or "webp" | png |
| safety_setting | No | Safety filter (preset:strict, preset:relaxed) | preset:strict |
| output_filename | No | Custom filename (optional, auto-generated if not provided) | |
| thinking_budget | No | Thinking budget for extended reasoning (0-24576 tokens). Higher = deeper reasoning. | |
| number_of_images | No | Generate 1-4 variations (default: 1) | |
| reference_images | No | Paths to reference images for style/character consistency (up to 14 images on gemini-nano-banana-2.1 and gemini-3.1-flash-image; 6 on gemini-3-pro-image) | |
| person_generation | No | Accepted for compatibility ("allow", "adults_only", "block"). Not enforced by the Gemini API; Gemini applies its own built-in restrictions on identifiable people. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||