edit_image
Modify an existing image using a text prompt: restyle it, combine multiple images, inpaint masked areas, or extend the canvas. Provide image paths and a description to get edited results saved to disk.
Instructions
Edit, restyle, or combine existing image(s) using a text instruction.
Use this for image-to-image work: modify an image, restyle it, composite several inputs into one, inpaint a masked region, or extend / outpaint.
Args: prompt: Instruction describing the desired edit or final result. images: One or more paths to input image files (PNG/JPEG/WEBP, <=50MB each). Multiple images are used together as references / inputs. mask: Optional path to a PNG mask. Transparent areas of the mask mark the region to edit/replace; opaque areas are preserved. model: GPT Image model. Default "gpt-image-2". size: "1024x1024", "1536x1024", "1024x1536", or "auto". quality: "low", "medium", "high", or "auto". n: Number of variations to generate (1-10). output_format: "png", "jpeg", or "webp". output_dir: Where to save. Defaults to $IMAGE_OUTPUT_DIR or ./generated-images. filename: Base filename without extension.
Returns: A text summary with the saved file path(s), followed by the image(s) inline.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | ||
| mask | No | ||
| size | No | auto | |
| model | No | gpt-image-2 | |
| images | Yes | ||
| prompt | Yes | ||
| quality | No | high | |
| filename | No | ||
| output_dir | No | ||
| output_format | No | png |