Edit Image
edit_imageEdit images with a text instruction: change background, add or remove elements, or combine multiple images into one scene. Returns saved file path and preview.
Instructions
Edit or transform existing image(s) with a text instruction — restyle, add or remove elements, change background, or combine several images into one scene. The result is saved to disk and its absolute path is returned, along with a small inline preview.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model slug, e.g. 'google/gemini-2.5-flash-image' or 'openai/gpt-5-image'. Omit to use the configured default. Call list_models to see options. | |
| images | Yes | Source image(s): absolute file paths, file:// URLs, https:// URLs, or data: URLs. Pass several images for composition or style-transfer edits. | |
| prompt | Yes | Instruction describing the edit, e.g. 'remove the background', 'make it night time', 'combine these two photos into one scene'. | |
| output_dir | No | Directory to save into (absolute, or ~ for home). Defaults to the configured output directory. | |
| filename_prefix | No | Short label used in the saved filename, e.g. 'hero-banner'. Sanitized to letters, digits, dashes. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| failed | Yes | Error messages for variations that failed | |
| images | Yes |