Generate Image
generate_imageGenerate a custom image from your text prompt using Gemini. Save it to any file path and select your preferred aspect ratio from ten options.
Instructions
Generate an image from a text prompt using Gemini. The image is saved to the specified file path and also returned inline. Supports various aspect ratios.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>",
"output_path": "<output_path>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Gemini model name for image generation. Default: gemini-3-pro-image-preview. Example: gemini-2.5-flash-image | |
| prompt | Yes | Text prompt for image generation. English recommended. More specific and detailed prompts yield better results. | |
| output_path | Yes | File path to save the generated image (.png). Example: C:/Users/palan/Pictures/output.png | |
| aspect_ratio | No | Aspect ratio of the output image. Default: 1:1. | 1:1 |