generate_images
Create images from text descriptions or modify existing images using Gemini AI models, with configurable aspect ratios and batch generation options.
Instructions
GENERATE OR EDIT IMAGES - Create images from text prompts or edit existing images using Gemini image models. CAPABILITIES: Text-to-image generation, image editing with instructions, multiple image generation (1-4 images), configurable aspect ratios. MODELS: gemini-3-pro-image-preview (default, with thinking support) or gemini-2.5-flash-image (faster). WORKFLOW: 1) Provide text prompt, 2) Optionally specify model, aspect ratio, and number of images, 3) For editing: provide inputImageUri from uploaded file, 4) Images auto-saved to outputDir. RETURNS: Array of generated images with file paths. COST: ~1,290 tokens per image. All images include SynthID watermark.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Text description of image to generate or editing instructions for existing image | |
| model | No | Image generation model (default: gemini-3-pro-image-preview) | gemini-3-pro-image-preview |
| aspectRatio | No | Image aspect ratio (default: 1:1 for new, matches input for editing) | 1:1 |
| numImages | No | Number of images to generate (default: 1) | |
| inputImageUri | No | Optional file URI from uploaded file for image editing (omit for text-to-image) | |
| outputDir | No | Directory to save generated images (default: ./generated-images) | |
| temperature | No | Controls randomness (0.0-2.0, default: 1.0) |