Basic Image Editing
Provide an image and a prompt describing how to modify it.- Python
- Node.js
- cURL
Inpainting with Masks
Use a mask to specify which region of the image should be edited. The mask is a same-size image where transparent areas indicate where edits should be applied.- Python
- Node.js
- cURL
The mask must be a PNG with an alpha channel. Transparent pixels mark the area to edit; opaque pixels are preserved.
Supported Formats
Size Constraints
Thesize parameter controls the output dimensions of the edited image.
Editing with Multiple Outputs
Generate several variations of an edit by settingn.
- Python
- Node.js
- cURL
Saving Edited Images
- Python
- Node.js
- cURL
Best Practices
Use masks for precise edits
Use masks for precise edits
Without a mask, the model decides what to change. For predictable results, provide a mask that clearly marks the target region.
Keep prompts focused on the edit
Keep prompts focused on the edit
Describe only what should change, not the entire image. “A blue vase with flowers” works better than re-describing the whole scene.
Match input and output sizes
Match input and output sizes
Provide images at the same resolution you request in
size to avoid quality degradation from rescaling.