edit_image
Modify an existing image with Google Gemini AI by providing its file path and a text instruction describing the changes to apply, such as adding, removing, or altering elements.
Instructions
Modify an existing image using Google Gemini AI based on a text instruction. Provide the path to the image you want to edit and describe the changes that should be applied.
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": {
"description": "<description>",
"image": "<image>"
},
"name": "edit_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | Path to the image file that should be edited. Can be absolute or relative to the server. | |
| model | No | Gemini model ID. Options include gemini-3-pro-image-preview (complex/high-fidelity) and gemini-3.1-flash-image-preview (fast/cost-efficient). Default: gemini-3-pro-image-preview. | |
| imageSize | No | Output image size (longest dimension). 512 is Flash models only. Must be uppercase K (1K, 2K, 4K). | |
| outputPath | No | Optional path where the edited image should be saved. If omitted, saves in the current working directory using an auto-generated filename. | |
| aspectRatio | No | Output aspect ratio. Use to change the aspect ratio of the edited image. Valid values: 1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9. | |
| description | Yes | Describe the changes that should be applied to the provided image. Be specific about elements to add, remove, or modify. |