Edit image
edit_imageModify a local image or create a new image from local references, save the result to local files, and return downscaled previews with original paths.
Instructions
Edit local images, or create a new image from local reference images, and save the result to local files. Returns downscaled previews and the paths of the originals. The first image is the one edited; the others serve as references. If the result has status "running", call get_image_result with its job_id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of images, at most 4. | |
| mask | No | Local path of a mask for the first image, with an alpha channel. Transparent areas mark what to replace. Describe the complete final image in the prompt, not only the change. Cannot be combined with markup. | |
| size | No | "auto" or WIDTHxHEIGHT, such as 1024x1024, 1536x1024 or 1024x1536. Custom sizes use multiples of 16 and an aspect ratio from 1:3 to 3:1. | |
| model | No | gpt-image-2.6-flare is the default and suits fast iteration. gpt-image-2.6-sunburst suits work with demanding requirements for detail, layout or edit accuracy. | |
| images | Yes | Local paths of PNG, JPEG or WebP input images. | |
| markup | No | Local path of a transparent PNG with annotations showing where to edit, the same dimensions as the first image. Cannot be combined with mask. | |
| prompt | Yes | Description of the desired image or edit. Must be written in English. Keep text that should appear in the image in its original language, in quotes. | |
| quality | No | Rendering quality. Use low for drafts. Compare medium and high for small text or dense information. | |
| workspace | No | Your current working directory. Only its last segment is used, to name the folder that groups saved images. Omit it if you do not know the directory; never guess. | |
| background | No | Transparent cannot be used with output_format jpeg. | |
| complexity | No | How much the model plans before rendering. Defaults to high, which suits dense text and layouts but takes longer. Start with low for targeted edits. | |
| moderation | No | ||
| output_format | No | Defaults to png. | |
| output_compression | No | Compression level for jpeg or webp output. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| next | No | ||
| error | No | ||
| usage | No | ||
| images | No | ||
| job_id | No | ||
| status | Yes | ||
| elapsed_seconds | No | ||
| revised_prompts | No |