openai_image_edit
Edit images or compose scenes from up to 16 reference images using text prompts, with optional masks or markup overlays, then save the results to a chosen output directory.
Instructions
Edit images or compose from up to 16 reference images (OpenAI images.edit), optionally guided by a mask or markup overlay. Saves files to output_dir and returns their paths.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of images, 1-10 | |
| size | No | auto, 1024x1024, 1536x1024, 1024x1536, or WIDTHxHEIGHT (both multiples of 16, aspect 1:3 to 3:1, max 3840x2160). For GIF this is the size of each frame; keep it small (e.g. 512x512) to fit the pixel budget | |
| extra | No | Extra API params shallow-merged into the request last, e.g. {"complexity":"high"} | |
| model | No | Image model (default gpt-image-2.6-flare). e.g. gpt-image-2.6-flare (fast), gpt-image-2.6-sunburst (detail/precise edits), gpt-image-2.5-flare, gpt-image-2.5-sunburst | |
| prompt | Yes | Edit instructions | |
| quality | No | auto (default), low, medium, high, xhigh, max | |
| mask_path | No | Optional PNG mask, same size as the first image (transparent = area to edit). Cannot combine with markup_path | |
| background | No | auto (default), opaque, transparent (transparent needs png, webp or svg) | |
| complexity | No | Planning effort, separate from quality: low, medium, high (2.6 default high) | |
| moderation | No | auto (default), low | |
| output_dir | Yes | Absolute directory to save images in. Follow your workspace conventions: the current project folder if any, else your own tmp dir. | |
| frame_count | No | GIF only: number of frames (default 9; SDK says 2-16, guide says 2-64). Describe the motion and a return to the starting pose in the prompt for a smooth loop | |
| image_paths | Yes | Local paths of one or more input/reference images | |
| markup_path | No | Optional transparent PNG overlay with marks/arrows/notes drawn on it, same size as the first image, to guide the edit. Cannot combine with mask_path | |
| output_format | No | png (default), jpeg, webp; generate also supports gif (animated) and svg | |
| input_fidelity | No | high or low; gpt-image-1.5 / 1-mini only, omit for gpt-image-2 and later | |
| frame_duration_ms | No | GIF only: ms per frame, 20-2000, rounded to 10 (default 200) | |
| safety_identifier | No | Optional stable hashed end-user id for OpenAI abuse monitoring | |
| output_compression | No | 0-100, jpeg/webp only |