Edit Image
edit_imageEdit an existing image by providing a text prompt describing desired changes; optionally add reference images to guide style. Returns the saved file path.
Instructions
Edit an existing image using a text prompt. Optionally provide reference images for style guidance. Returns the file path of the saved result.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model ID to use. Options: gemini-3.1-flash-image-preview (default), gemini-2.5-flash-image, gemini-3-pro-image-preview | |
| prompt | Yes | Instructions for how to edit the image, e.g. "change the sky to purple" or "remove the background" | |
| imagePath | Yes | Absolute path to the source image to edit. Supported formats: PNG, JPG, JPEG, GIF, WebP, BMP | |
| referenceImages | No | Optional array of absolute paths to reference images for style or context |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model ID that was used for editing | |
| filePath | Yes | Absolute path where the edited image was saved | |
| sizeBytes | Yes | Size of the edited image in bytes |