edit_image
Modify an existing image using a text prompt, with optional mask-based inpainting to change specific areas while keeping the rest unchanged.
Instructions
图生图/局部编辑:Edit an existing image based on a prompt. Can modify specific areas while keeping others unchanged. Supports inpainting with mask (修改指定区域,其他保持不变).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of variations to generate. Default: 1 | |
| mask | No | Optional: Base64-encoded mask image (transparent areas will be edited). If not provided, entire image context is used for editing. | |
| size | No | Output image size. Default: 1024x1024 | |
| image | Yes | Base64-encoded PNG image or URL to the image to edit | |
| model | No | Model to use. Defaults to gpt-image-2.5-sunburst | |
| prompt | Yes | Description of the edits to make (支持中文) |