generate_image
Generate images from text descriptions using Gemini models. Configure size, aspect ratio, and include reference images for custom results.
Instructions
Generate images using Gemini's native image generation (Nano Banana). Supports gemini-3-pro-image, gemini-3.1-flash-image, gemini-3.1-flash-lite-image, and gemini-2.5-flash-image models. gemini-3.1-flash-lite-image (Nano Banana 2 Lite) is the fast, low-cost GA tier: 1K output only, standard aspect ratios (no 1:4/1:8/4:1/8:1), no thinkingLevel, up to 14 reference images. gemini-3.1-flash-image is required for 0.5K and 1:4/1:8/4:1/8:1 ratios. gemini-2.5-flash-image (legacy, retires 2026-10-02) supports at most 3 reference images and does not support imageSize. Reference images use imagePaths and must be PNG (.png), JPEG (.jpg/.jpeg), WEBP (.webp), HEIC (.heic), HEIF (.heif). Audio and video reference files are not accepted by generate_image. Images are saved to /root/Pictures/gemini-generated and returned as base64.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Image model (default: gemini-3-pro-image). gemini-3.1-flash-lite-image = fast/low-cost GA tier (1K only, no thinkingLevel, no 1:4/1:8/4:1/8:1 ratios). gemini-2.5-flash-image = legacy (at most 3 reference images, no imageSize, retires 2026-10-02) — prefer gemini-3.1-flash-lite-image. | |
| prompt | Yes | Image generation prompt | |
| imageSize | No | Resolution (0.5K requires gemini-3.1-flash-image; gemini-3.1-flash-lite-image supports 1K only; default: 1K) | |
| imagePaths | No | Local file paths of reference images to include as input (max 14; gemini-2.5-flash-image supports at most 3). Supported file types: PNG (.png), JPEG (.jpg/.jpeg), WEBP (.webp), HEIC (.heic), HEIF (.heif). Audio/video files are not accepted. | |
| aspectRatio | No | Aspect ratio (default: 1:1; 1:4, 1:8, 4:1, and 8:1 require gemini-3.1-flash-image) | |
| thinkingLevel | No | Optional thinking level; only supported by gemini-3.1-flash-image | |
| mediaResolution | No | Optional media resolution for reference image inputs | |
| systemInstruction | No | Optional system instruction for Gemini 3 image models |