# Qwen Image 2.1 Edit Qwen Image 2.1 Edit transforms reference images with text prompts. Create image edits and combine visual references with adjustable sizes in PNG, JPEG, or WebP. ## API Information - **Model Slug:** alibaba-qwen-image-2-1-image-edit - **Branded URL:** https://www.eachlabs.ai/alibaba/qwen/alibaba-qwen-image-2-1-image-edit - **Provider:** Alibaba - **Category:** Image to Image - **Output Type:** array - **Status:** active - **Base Cost:** $0.03666667 per megapixel per image - **Interactive Demo:** https://www.eachlabs.ai/ai-models/alibaba-qwen-image-2-1-image-edit ## Pricing - **Charge Type:** dynamic - **Estimate:** $0.03666667 per megapixel per image - **Pricing Details:** per billable megapixel (reference + output, 0.5 MP steps): $0.0367 ## Input Schema | Parameter | Type | Required | Default | Constraints | Description | |-----------|------|----------|---------|-------------|-------------| | prompt | string | Yes | - | - | The prompt describing the image to generate. | | image_urls | array | Yes | - | - | Ordered reference images to edit or combine according to the prompt. | | image_size | string | No | square_hd | square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, custom | Output size, rounded to multiples of 32 pixels. | | num_images | integer | No | 1 | 1–4 | Number of images to generate sequentially.1-4 | | guidance_scale | number | No | 1 | 1–10 | Classifier-free guidance strength. The model defaults to no guidance. | | output_format | string | No | png | png, jpeg, webp | Output format. PNG and WebP preserve transparency; JPEG uses white. | | negative_prompt | string | No | - | - | Content to avoid; used only when guidance_scale is greater than 1. | | enable_safety_checker | boolean | No | true | - | Whether to check generated images for unsafe content. | | seed | integer | No | - | - | Seed for reproducibility. | ## Example Request ```bash curl -X POST https://api.eachlabs.ai/v1/prediction/ \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "alibaba-qwen-image-2-1-image-edit", "input": { "image_urls": [ "https://cdn-us.eachlabs.ai/defaults/841529a4abc64173b5fda4204a615515.png" ], "prompt": "Create a hyper-realistic vintage editorial lookbook-poster portrait of the uploaded person, shot from an extreme bird's-eye view with the camera positioned directly above her, pointing straight down. She looks straight up into the lens, so her head and face appear large in the frame and her body tapers dramatically toward small feet at the bottom, with strong wide-angle foreshortening. She stands on a seamless burnt-orange studio floor with faint, faded abstract black ink swirls that contain no letters.\n\nKeep the subject's face, hair, eye color, skin tone, body shape, and all physical features fully preserved and unchanged. She keeps her leopard-print silk headscarf, her gold hoop earrings, and her original layered gold necklaces exactly as they appear in the uploaded photo. She wears black rectangular glasses slipped low on her nose, a fitted black short-sleeve tee, low-rise black wide-leg trousers, and white sneakers. The outfit is fully black. She has a cool, confident, slightly moody expression with lips relaxed, not smiling, hands resting on her hips.\n\nSurround her silhouette with a rough, torn white paper cut-out edge, like a hand-ripped magazine collage, with a thin darker orange layer visible just inside the tear.\n\nThe only text in the image is huge distressed off-white bold letters at the top reading \"each\" and \"labs\", separated by a 2x2 grid of four small solid squares in deep red-orange (#D8341A), arranged in two rows of two. The top of her head slightly overlaps the bottom of the letters. No other text, numbers, captions, or logos anywhere.\n\nHazy, slightly soft and dreamy look, faded and washed-out colors, heavy grainy film texture, subtle blur and light haze, soft direct flash, worn vintage print feel like a scanned 90s magazine page." } }' ``` ## Output Schema Response returned by `GET /v1/prediction/{id}` when the job completes: ```json { "status": "success", "predictionID": "string", "output": "array", "metrics": { "predict_time": "number (seconds)" } } ``` ## Polling ```bash curl https://api.eachlabs.ai/v1/prediction/{PREDICTION_ID} \ -H "Authorization: Bearer YOUR_API_KEY" ``` | Status | Meaning | |--------|---------| | `processing` | Still running — poll again | | `success` | Done — read `output` | | `error` | Failed — read `message` / `details` | ## Webhook (alternative to polling) Pass `"webhook_url": "https://your.host/path"` in the create request. Eachlabs POSTs this payload when the job ends: ```json { "exec_id": "prediction-uuid", "status": "succeeded", "output": "https://...", "error": "" } ``` `status` is `"succeeded"` or `"failed"`. `exec_id` equals the `predictionID` from create. Return 2xx within 30 seconds. ## Errors Error body: `{ "status": "error", "message": "...", "details": "..." }` | Code | Meaning | |------|---------| | `400` | Invalid input | | `401` | Missing / invalid `Authorization` bearer token | | `404` | Unknown model or prediction id | | `429` | Rate limit — 100 creates / min, 10 concurrent per key | | `5xx` | Retry with backoff | ## Usage Notes - API Base URL: `https://api.eachlabs.ai/v1` - Authentication: send `Authorization: Bearer YOUR_API_KEY`. Generate a key from the Eachlabs dashboard at https://www.eachlabs.ai/dashboard/api-keys. - File-typed parameters (`*_url`, `image_url`, `video_url`, `audio_url`, etc.) accept publicly-reachable HTTPS URLs only. Upload your asset first (GCS / S3 / your CDN) and pass the resulting URL. Data-URIs and localhost URLs are rejected. - For structured parameters (arrays / objects) send real JSON values, not stringified payloads. - Monetary values are reported in USD; per-token / per-megapixel rates may be billed in micro-cents internally. - Prefer `webhook_url` over polling for long-running predictions — see the Webhook Callback section.