Edit Image
nanobanana_edit_imageEdit existing images with natural-language prompts to change colors, add or remove objects, transform styles, or apply effects using Gemini image editing.
Instructions
Edit an existing image using a text prompt with Gemini's image editing capabilities.
This tool modifies images based on natural language instructions. You can:
Change colors, objects, or elements
Add or remove items from the scene
Transform the style or mood
Apply effects or filters
Args:
prompt (string): Description of the edit to apply
image_path (string): File path to the image to edit (PNG, JPEG, WebP, or GIF)
model (string): Gemini model to use
output_path (string): File path to save the edited image
Returns: JSON with success, saved_to, mime_type, model, text
Examples:
"Change the car color from blue to red"
"Add a rainbow in the sky"
"Remove the person in the background"
"Make this photo look like an oil painting"
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>",
"image_path": "<image_path>",
"output_path": "<output_path>"
},
"name": "nanobanana_edit_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Gemini model to use. 'gemini-2.0-flash-exp-image-generation' is optimized for image generation. | gemini-2.0-flash-exp-image-generation |
| prompt | Yes | Text description of the edit to apply. Be specific about what to change, e.g., 'change the blue car to red' or 'add a sunset in the background'. | |
| image_path | Yes | File path to the image to edit. Supports PNG, JPEG, WebP, and GIF formats. | |
| output_path | Yes | File path to save the edited image. |