edit_image
Edit or iterate on images using follow-up prompts or reference images for virtual try-on, product placement, style transfer, and compositing.
Instructions
Edit or iterate on an image with a follow-up prompt. Pass previous_interaction_id from a prior generate_image/edit_image call for conversational multi-turn editing (recommended way to iterate). Or pass reference_images from disk (up to 14) for: virtual try-on, product placement in scenes, combining/compositing images, style transfer, photo restoration, attribute replacement (colors/materials), 2D-to-3D mockups. Returns a new interaction_id for further iteration. Prompt tip: describe subject + setting + lighting + camera/lens + mood in full sentences; narrative beats keyword soup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | 1K | |
| model | No | nano=1K fast, flash=default/4K, pro=professional/4K/thinking | flash |
| ratio | No | Aspect ratio for the output | 1:1 |
| output | Yes | Output file path; extension picks the format (.png or .jpg; jpg needs flash/pro) | |
| prompt | Yes | Edit instruction, e.g. 'Change the background to sunset, keep everything else identical' | |
| preview | No | Return a small preview image | |
| use_search | No | Ground the edit with Google Search | |
| show_thinking | No | Include thought summaries (pro) | |
| reference_images | No | Paths to reference images on disk (max 14; flash: 10 object + 4 character, pro: 6 + 5) | |
| previous_interaction_id | No | ID from a previous generate_image/edit_image call to continue from |