Skip to Content
Image ModelsQwen Image 2.1

Qwen Image 2.1

Overview

Qwen Image 2.1 is Alibaba’s compact and efficient AI image model for unified image generation and editing. It supports text-to-image creation, multi-reference editing with up to 8 images, local edits, and improved fidelity for people, products, and text.

Test API KEY: key_00000000000000000000000000000000

Endpoints

1. Create Task

Request

POST https://api.pixwithapi.online/api/task/create

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Api-Key{API_KEY}Yes

Request Parameters

ParameterTypeRequiredDescription
promptstringYesDescription or editing instruction, from 1 to 3000 characters.
image_urlsarrayConditionalProvide 1–8 directly accessible JPEG, PNG, or WebP URLs for image-to-image mode. Omit for text-to-image mode. Each image must not exceed 30MB.
model_idstringYes0-91
optionsobjectYesConfiguration options for the task.
options.prompt_optimizationbooleanYesIf true, the prompt is automatically optimized before generation.
options.aspect_ratiostringNoText-to-image defaults to '1:1'. Image-to-image defaults to 'auto'. Other valid values: '1:1', '4:3', '3:4', '3:2', '2:3', '16:9', '9:16', '21:9', '9:21'.
options.resolutionstringNoOutput resolution. Valid values: '1K', '2K'. Defaults to '1K'.

Example Request - Text-to-Image

{ "prompt": "a clean botanical poster with precise typography", "model_id": "0-91", "options": { "prompt_optimization": true, "aspect_ratio": "3:2", "resolution": "1K" } }

Example Request - Image-to-Image

{ "prompt": "combine the products into a cohesive studio campaign image", "image_urls": [ "https://cdn.pixwithapi.online/example-1.jpg", "https://cdn.pixwithapi.online/example-2.png" ], "model_id": "0-91", "options": { "prompt_optimization": true, "aspect_ratio": "auto", "resolution": "2K" } }

Response Parameters

ParameterTypeDescription
codeint1=success, 0=error
messagestringSuccess or failure message.
dataobjectTask information.
data.task_idstringTask ID used to query generation status.
data.estimated_timeintEstimated processing time in seconds.

Response

{ "code": 1, "message": "success", "data": { "task_id": "d425ab4dc256f0ebaa84862b9cea8a3d", "estimated_time": 60 } }
Last updated on