alibaba/qwen-image-edit/inpaint
Qwen Image Edit Inpaint is Alibaba's intelligent image editing model. Transform, retouch, and reimagine existing images using text prompts - from background replacement to artistic style conversion.
PNG, JPEG, WebP, or GIF · 20 MiB maximum
PNG, JPEG, WebP, or GIF · 20 MiB maximum
Example output — click Run to generate your own
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
https://api.sandbase.ai/v1/runalibaba/qwen-image-edit/inpaintInput Schema
7 parameters · 2 required · 5 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
image | string | Required | The URL of the image to edit. |
prompt | string | Required | The prompt to generate the image with |
mask | string | Optional | The URL of the mask for inpainting |
seed | integer | Optional | The same seed and the same prompt given to the same version of the model will output the same image every time. |
strength | number | Optional | Strength of noising process for inpainting · Min: 0.01 · Max: 1 · Default: 0.93 |
aspect_ratio | string | Optional | The aspect ratio of the generated image. · Options: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16 21:916:93:24:35:41:14:53:42:39:16 |
output_format | string | Optional | The format of the generated image. · Options: jpeg, png · Default: "png" jpegpng |
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
Async Workflow
This model uses asynchronous execution. Submit a request and poll for the result.
- Submit — POST to /v1/run, receive an
id - Poll — GET /v1/run/{id} until status is
completed,failed, ortimeout - Retrieve — Read
outputsfrom the completed response
Code Examples
Ready-to-run snippets
# Step 1: Submit
curl -X POST https://api.sandbase.ai/v1/run \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "alibaba/qwen-image-edit/inpaint",
"mask": "https://static.sandbase.ai/examples/alibaba/qwen-image-edit/inpaint/input_mask_1.png",
"image": "https://static.sandbase.ai/examples/alibaba/qwen-image-edit/inpaint/input_image_0.jpeg",
"prompt": "Change the ball to a black and white football",
"strength": 0.93,
"output_format": "png"
}'
# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
-H "Authorization: Bearer YOUR_API_KEY"API README
Qwen Image Edit Inpaint
Qwen Image Edit Inpaint is a Qwen Image masked reconstruction route that combines visual-semantic understanding with image synthesis. It interprets subjects, spatial relationships, typography, and appearance as connected parts of one design, allowing the generated or revised image to follow a detailed creative brief instead of merely matching isolated keywords or request settings.
Use this exact route when the production task calls for masked reconstruction. Describe the subject and intended result first, then specify composition, viewpoint, text content, material, lighting, and visual finish. For edits, identify what must change and what must remain untouched; for adapted or layered work, explain the role of each source and the consistency expected across the final asset.
Highlights
- Masked region reconstruction. Regenerates only the selected area while using the surrounding image to infer plausible content.
- Context-aware boundary blending. Matches perspective, texture, color, and illumination across the edge of the edited region.
- Semantic object replacement. Can remove, add, or transform content according to a natural-language instruction.
- Preservation beyond the mask. Retains unselected regions so localized edits do not become uncontrolled full-image regeneration.
Pricing
| Configuration | Billing unit | Price |
|---|---|---|
| Base generation | Per request | $0.03 |
When to Use
| ✅ Good fit | ❌ Consider alternatives |
|---|---|
| The project needs this exact named workflow | The intended task belongs to another media route |
| All required reference or control media is available | Necessary assets or rights are unavailable |
| The brief can state transformation and preservation goals | Output must be deterministic at pixel or frame level |
| Supported duration, resolution, and format fit delivery | Final placement requires unsupported specifications |
| An asynchronous generated result fits production | A live frame-synchronous response is mandatory |
Prompt Guide
Identify the primary subject and every source or condition, state the intended transformation or action, then describe composition, camera or viewpoint, lighting, materials, pacing, atmosphere, and exact preservation requirements. Refer to multiple inputs in their schema order.
{
"prompt": "A precisely directed composition with explicit subject, transformation, camera or viewpoint, lighting, material, and preservation requirements",
"image": "https://example.com/reference.png",
"mask": "https://example.com/reference.png",
"seed": 1,
"strength": 0.93
}
Technical Specs
| Spec | Value |
|---|---|
| Model ID | alibaba/qwen-image-edit/inpaint |
| Input fields | mask (string)<br>seed (integer)<br>image (string)<br>prompt (string)<br>strength (number)<br>aspect_ratio (string; 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16)<br>output_format (string; jpeg, png) |
| Required input | prompt, image |
| Output fields | url, content_type |
| Execution | Asynchronous job |
Related Models
alibaba/qwen-imagealibaba/qwen-image/editalibaba/qwen-image/max

