edit_image
Modify specific parts of an image using a text prompt, preserving the rest, with Google Gemini.
Instructions
Edit an existing image based on a text prompt using Google Gemini. Useful for modifying specific parts of an image while preserving others.
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": {
"imagePath": "<imagePath>",
"prompt": "<prompt>"
},
"name": "edit_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Instructions for how to edit the image (e.g., 'Change the sky to sunset colors' or 'Add a cat in the foreground') | |
| imagePath | Yes | Path to the image file to edit | |
| outputPath | No | Optional custom file path for saving the edited image | |
| aspectRatio | No | Optional aspect ratio for the output image. If not provided, Gemini will auto-select. Options: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 |