generate_image
Create or edit images from text prompts and reference images, including combining subjects or styles, then save the result as a JPEG.
Instructions
Generate an image with Nano Banana, or edit/combine reference images. Saves a JPEG.
prompt: detailed description (English works best); put any in-image text in quotes. aspect_ratio: 4:5 (default), 1:1, 9:16, 16:9, 3:4, 4:3, 2:3, 3:2, 5:4, 21:9, 1:4, 4:1, 1:8, 8:1. image_size: 512, 1K, 2K (default) or 4K. model: gemini-nano-banana-2.1 (default), gemini-3-pro-image (best text), gemini-3.1-flash-lite-image. reference_images: up to 14 local images to edit or take style/subjects from. previous_interaction_id: edit the image from an earlier call ("same scene, warmer light") - the most reliable way to keep a character/product consistent. google_search: ground the image in current facts. force_new: regenerate even if the identical request ran recently (billed again).
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>"
},
"name": "generate_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | ||
| prompt | Yes | ||
| filename | No | ||
| force_new | No | ||
| image_size | No | 2K | |
| aspect_ratio | No | 4:5 | |
| google_search | No | ||
| reference_images | No | ||
| previous_interaction_id | No |