/image/edit or /image/multi-edit and the edited result comes back in the same response as a PNG file. For cutouts, /image/background-remove returns a transparent PNG.
Endpoints
When to use which endpoint
- Use
/image/editwhen you have one source image and want to change, remove, or restyle part of it with a prompt. - Use
/image/multi-editwhen you need extra control from masks, overlays, or reference layers. - Use
/image/background-removewhen you only want a clean foreground subject with transparency.
For inpainting, use
/image/edit or /image/multi-edit. The old inpaint parameter on /image/generate is deprecated.Step 1: Edit a single image
Single-image edit is the simplest inpainting flow. Send one image plus a short prompt such as “remove the sign”, “change the sky to sunrise”, or “replace the background with a studio backdrop”. Request:image/png binary data. Save it directly to a file.
Step 2: Use multi-edit for masks or layered inpainting
/image/multi-edit accepts up to three images. The first image is the base image. The remaining images are treated as edit layers or masks, which gives you more control than prompt-only editing.
This is the better choice when you want to:
- target a specific region with a mask
- combine an existing composition with an overlay
- constrain the edit more tightly than a single-image prompt can
/image/edit, the response body is raw image/png data.
/image/multi-edit currently uses the modelId field rather than model in the request schema.Inpainting tips
Prompt-based inpainting works best when the instruction is short and local:remove the treechange the sky to sunsetreplace the logo with a blank signrestore the torn corner of the photo
/image/edit to /image/multi-edit and provide a mask or overlay layer.
Step 3: Remove the background
Use/image/background-remove when you want the foreground subject isolated on a transparent background. This endpoint returns a PNG with alpha transparency.
Using an image URL:
- ecommerce product photos
- profile photos and portraits
- assets you plan to place over a new background
Request Parameters
/image/edit
/image/multi-edit
/image/background-remove
Supported input formats
For edit endpoints, image dimensions must be at least
65536 pixels and no more than 33177600 pixels. Uploaded files must be under 25MB.
Models and pricing
The default edit model isqwen-edit, priced at $0.04 per edit. Other edit-capable models may have different pricing and constraints.
See:
- Image pricing
- Models API with
type=inpaint
Errors
Some edit models have stricter content policies than image generation models. For example,
qwen-edit blocks requests involving explicit sexual imagery, sexualized minors, or real-world violence.Related Workflows
- Use Image Generation when you’re starting from text instead of an existing image.
- Use Image Models to compare generation, edit, and enhancement model families.
- Use Image Edit API, Multi-Edit API, and Background Remove API for full schema details.