Edit an image
edit_imageModify an existing image using a plain-language instruction while preserving layout, aspect ratio, people, and untouched text. Add logos, swap backgrounds, or remove objects and text in place.
Instructions
EDIT an existing image in place with a plain-language instruction and keep everything else: 'make the headline bigger', 'add our logo bottom right', 'swap the background for a kitchen', 'remove the person on the left', 'erase all the text'. Pass image (URL, Library item, upload_file URL or local path) and instruction. The same edit the web Studio's Edit runs: composition, aspect ratio, people and every untouched line of text stay as they are; the saved brand's real name and website are pinned so an added line never invents one, and the brand's real logo FILE is put on when the instruction asks for the logo (never redrawn by the model): an ask only about the logo ('the logo is wrong', 'make the logo bigger'; or logo:true, any language) runs no image model. Set removal:true when the edit STRIPS text, branding or an object, so nothing branded is put back. When the saved brand has a product photo and the ad shows that product, the photo rides with the edit and the product's label is read and checked against it: re-printed from the photo only when it came out wrong (the check alone is charged when it is right; one small extra charge finds the product first). fixLabel:false turns that off. For a precise region, pass mask (see generate_image). One image edit's credits; returns the new image URL. For a new image from a prompt use generate_image; to rebuild a competitor's ad for your brand use clone_static.
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": {
"image": "<image>",
"instruction": "<instruction>"
},
"name": "edit_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| logo | No | ||
| mask | No | optional mask image (URL or local path) marking the region to change: transparent = change, or white = change on an opaque mask | |
| image | Yes | the image to edit: URL, Library item URL, upload_file URL or local path | |
| model | No | the editor, only when the user names one: gpt-image-2.6, gpt-image-2.6-flare (its own faster editor) or gpt-image-2.5. Omit for the default | |
| dryRun | No | true = return what this edit usually costs in credits and render nothing | |
| markup | No | MARKUP-GUIDED EDIT: drawn annotations (circles, arrows, scribbles) showing what to change, as a URL or local path: a transparent PNG of just the marks, or a copy of the same image with the marks drawn on it. Say the change in `instruction` ("make the circled vase blue"); the marks are not in the result. Runs on gpt-image-2.6 (or the editor named in `model`). Never with a mask | |
| removal | No | true when the edit REMOVES text, branding, a logo, a watermark, a person or an object, so the brand name and logo are not re-added | |
| fixLabel | No | false = leave the product label exactly as rendered: no product lookup, no label check, no re-print (default on when the ad shows the brand’s saved product) | |
| get_cost | No | true: return the price only; nothing runs or bills | |
| complexity | No | gpt-image-2.6 editors, when the user asks; never inferred from how small the change is: planning depth (default high). Ignored on the default editor | |
| instruction | Yes | the change to make, in plain words (pass the user’s own words for a removal or plain photo edit) | |
| idempotency_key | No | chosen once, resent unchanged on retries: the same key never buys twice | |
| expected_credits | No | the get_cost price; refused unbilled if the live price differs |