edit_image
Edit images using inpainting with OpenAI GPT models. Apply edits to transparent areas of a mask while preserving faces and logos with adjustable fidelity.
Instructions
Edit an existing image using inpainting with OpenAI GPT image models. Requires a reference image and optional mask image (transparent areas are edited). gpt-image-1.5 supports input_fidelity for better face/logo preservation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Description of the desired edits | |
| reference_image_base64 | No | Base64 encoded reference image | |
| reference_image_path | No | Path to reference image file | |
| mask_image_base64 | No | Base64 encoded mask image (transparent areas will be edited) | |
| mask_image_path | No | Path to mask image file (transparent areas will be edited) | |
| output_path | No | Output file path (default: edited_image.png) | |
| model | No | Model to use. gpt-image-2: latest, flexible sizes, input_fidelity is auto-high (field ignored). gpt-image-1.5: supports input_fidelity. gpt-image-1: original. (default: gpt-image-1) | |
| size | No | Image size. gpt-image-1/1.5 only support 1024x1024, 1024x1536, 1536x1024, auto. gpt-image-2 also supports 2K/4K presets plus custom WxH (16px multiples, each edge ≤3840, ratio ≤3:1). (default: auto) | |
| quality | No | Image quality level (default: auto) | |
| output_format | No | Output image format (default: png) | |
| moderation | No | Content moderation level (default: auto) | |
| sample_count | No | Number of images to generate (1-10, default: 1) | |
| return_base64 | No | Return base64 image data in response (default: false) | |
| include_thumbnail | No | Include thumbnail preview in MCP response for LLM recognition (default: false, overrides OPENAI_IMAGE_THUMBNAIL env var) | |
| input_fidelity | No | Input fidelity for preserving faces/logos. gpt-image-1.5 only (gpt-image-2 is always high, gpt-image-1 unsupported). High uses more tokens. (default: low) |