Qwen-Image is a general-purpose image generation model that supports multiple artistic styles and excels at complex text rendering . It handles multi-line layouts, paragraph-level text generation, and fine-grained detail rendering.
Quick access: User guide | Try it online (Singapore | Beijing) | Technical blog (more examples) |
Examples
Prompt | Generated image |
|---|---|
A healing-style hand-drawn poster featuring three puppies playing with a ball on lush green grass, adorned with decorative elements such as birds and stars. The main title “Come Play Ball!” appears prominently at the top in bold, blue cartoon font. Below it, the subtitle “Come [Show Off Your Skills]!” appears in green font. A speech bubble adds playful charm with the text: “Hehe, watch me amaze my little friends next!” At the bottom, supplementary text reads: “We get to play ball with our friends again!” The color palette centers on fresh greens and blues, accented with bright pink and yellow tones to highlight a cheerful, childlike atmosphere. | ![]() |
Model overview
Model | Description | Output image specifications |
|---|---|---|
qwen-image-3.0-pro | The Qwen image generation and editing 3.0 series supports both text-to-image (T2I) and image-to-image/image editing (I2I). For 3.0 series API calls, see Qwen Image Generation and Editing 3.0. | Resolution: Total pixels must be between 512×512 and 2048×2048. Format: PNG |
qwen-image-3.0 Balances quality and speed. | ||
qwen-image-2.0-pro Same capabilities as qwen-image-2.0-pro-2026-04-22 | Qwen Pro series for image generation and editing. Offers stronger text rendering, realistic texture, and semantic adherence. For image editing, see Qwen-Image Editing. | Resolution: Set width and height freely. Total pixels must be between 512×512 and 2048×2048. Default resolution is 2048×2048. Format: PNG Number of images: 1–6 |
qwen-image-2.0-pro-2026-06-22 | ||
qwen-image-2.0-pro-2026-04-22 | ||
qwen-image-2.0-pro-2026-03-03 | ||
qwen-image-2.0 Same capabilities as qwen-image-2.0-2026-03-03 | Qwen accelerated series for image generation and editing. Balances quality and response speed. For image editing, see Qwen-Image Editing. | |
qwen-image-2.0-2026-03-03 |
Prerequisites
Before making a call, get an API key and export the API key as an environment variable. To make calls using the SDK, install the DashScope SDK.
Synchronous API (recommended)
HTTP
Synchronous calls return results in a single request.
Singapore:POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
Beijing:POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
Replace {WorkspaceId} with your actual workspace ID.
Request parameters |
|
Request headers | |
Content-Type string (Required)The content type of the request. Must be application/json. | |
Authorization string (Required)Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx. | |
Request body | |
model string (required)Model name. Example: qwen-image-2.0-pro. | |
input object (required)Input information.
Properties messages array (required)Array of message objects. Only single-turn conversations are supported, so the array must contain exactly one element.
Properties role string (required)Message role. Set to user.contentarray (required)Array of message content objects.
Properties text string(required)A positive prompt describing the image content, style, and composition you want.Supports Chinese and English. The qwen-image-2.0 series accept up to 1,300 tokens. Other models accept up to 800 tokens. The system truncates excess tokens.Note: Only one text field is allowed. Omitting it or providing more than one returns an error. | |
parameters object (optional)Image processing parameters.
Properties negative_prompt string (optional)A negative prompt describing what you do not want in the image.Supports Chinese and English. Maximum length is 500 characters. Excess characters are truncated automatically.Example: Low resolution, low quality, distorted limbs, malformed fingers, oversaturated colors, wax-like appearance, no facial details, overly smooth surfaces, AI-generated look. Chaotic composition. Blurry or distorted text.size string (optional)Output image resolution, formatted as width*height.qwen-image-2.0 series models: Total pixels must be between 512×512 and 2048×2048. Default resolution is 2048×2048. Recommended resolutions:
integer (optional)Number of output images. Default is 1.For qwen-image-2.0 series models, you can choose 1–6 images.prompt_extend bool (optional)Enable smart prompt rewriting. The model optimizes the positive prompt. Does not affect the negative prompt.
View rewriting examples Only asynchronous calls return the actual rewritten prompt.Original prompt (orig_prompt): A sitting ginger cat with a joyful expression, looking lively, adorable, and incredibly lifelike.Actual prompt (actual_prompt): Photorealistic wildlife portrait: A sitting ginger cat with lush, sun-kissed fur and a vibrant, joyful expression, eyes sparkling with curiosity and warmth. The cat's head is slightly tilted, ears perked forward, mouth gently open in a contented, lively pose—exuding adorable charm and incredible lifelike detail. Soft natural lighting enhances the texture of each individual whisker and fur strand, with subtle highlights on the muzzle and inner ears. Background: a softly blurred autumn garden at golden hour—warm tones of amber leaves, dappled sunlight filtering through trees, and faint hints of mossy stone steps. Composition emphasizes the cat as the central focal point, captured in sharp focus with shallow depth of field. Style: ultra-realistic photography, National Geographic-level detail, 8K resolution, Canon EOS R5, f/1.2 aperture, cinematic lighting, true-to-life color grading, minimal post-processing. No text or overlays. bool (optional)Adds a “Qwen-Image” watermark to the bottom-right corner of the image. Default: false. Watermark style: integer (optional)Random number seed. Valid range: [0,2147483647].Using the same seed yields similar outputs. If omitted, the algorithm uses a random seed.Note: Image generation is probabilistic. Even with the same seed, results may vary. |
Response parameters |
Image URLs are valid for only 24 hours and then automatically purged. Save generated images promptly. |
output objectTask output information.
Properties choices arrayModel output. This array contains exactly one element.
Properties finish_reason stringReason the task stopped. Value is stop for natural stops.message objectModel response message.
Properties role stringMessage role. Fixed value: assistant.contentarray
Properties image stringURL of the generated image (PNG format). Expires after 24 hours. Download and save it promptly.objectTask result statistics. Not returned for qwen-image-2.0 series models.
Properties TOTAL integerTotal number of tasks.SUCCEEDED integerNumber of successful tasks.FAILED integerNumber of failed tasks. | |
usage objectThis field is only returned in async calls. Synchronous ImageSynthesis SDK calls do not return this field.
Properties image_count integerNumber of generated images. For qwen-image-2.0 series models this equals the requested n (1–6).width integerWidth of the generated image, in pixels.height integerHeight of the generated image, in pixels. | |
request_id stringUnique request identifier for tracing and troubleshooting. | |
code stringError code. Returned only for failed requests. See Error codes. | |
message stringDetailed error message. Returned only for failed requests. See Error codes. |
DashScope SDK call
The DashScope SDK supports Python and Java.
The parameter names in the SDK closely match the HTTP parameters, and the parameter structures follow language-specific conventions. For synchronous call parameters, see HTTP.
- Python
- Java
Request example
Response example
Image URLs expire after 24 hours. Download the images promptly.
Asynchronous API
HTTP
Asynchronous calls use a two-step HTTP workflow:
- Create a task to get a task ID: Send a request to create a task. The response returns a task ID (task_id).
- Poll for results using the task ID: Poll the task status with the task_id until it completes and returns an image URL.
Step 1: Create a task to get a task ID
Singapore:POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesis
Beijing:POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesis
- After the task is created, use the returned
task_idto query the result. Thetask_idis valid for 24 hours. Do not create duplicate tasks. Instead, use polling to retrieve the result. - For guidance for beginners, see Call APIs with Postman or cURL.
Request parameters |
|
Request headers | |
Content-Type string (Required)The content type of the request. Must be application/json. | |
Authorization string (Required)Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx. | |
X-DashScope-Async string (Required)Enables asynchronous processing. HTTP requests support only asynchronous calls. Must be enable. | |
Request body | |
model string (required)Model name.Example: qwen-image-3.0-pro. | |
input object (required)Input information.
Properties prompt string (required)A positive prompt describing the visual elements and characteristics you want in the generated image.Supports Chinese and English. Maximum length is 800 characters. Each Chinese character, letter, digit, or symbol counts as one character. Excess characters are truncated automatically.Example: A sitting orange cat with a joyful expression, lively and adorable, highly realistic.negative_prompt string (optional)A negative prompt describing what you do not want in the image.Supports Chinese and English. Maximum length is 500 characters. Excess characters are truncated automatically.Example: Low resolution, low quality, distorted limbs, malformed fingers, oversaturated colors, wax-like appearance, no facial details, overly smooth surfaces, AI-generated look. Chaotic composition. Blurry or distorted text. | |
parameters object (optional)Image processing parameters.
Properties size string (optional)Output image resolution, formatted as width*height.qwen-image-2.0 series models: Total pixels must be between 512×512 and 2048×2048. Default resolution is 2048×2048. Recommended resolutions:
integer (optional)Number of generated images. This value is fixed at 1. Setting any other value returns an error.prompt_extend bool (optional)Enable smart prompt rewriting. The model optimizes the positive prompt. Does not affect the negative prompt.
View rewriting examples Only asynchronous calls return the actual rewritten prompt.Original prompt (orig_prompt): A sitting ginger cat with a joyful expression, looking lively, adorable, and incredibly lifelike.Actual prompt (actual_prompt): Photorealistic wildlife portrait: A sitting ginger cat with lush, sun-kissed fur and a vibrant, joyful expression, eyes sparkling with curiosity and warmth. The cat's head is slightly tilted, ears perked forward, mouth gently open in a contented, lively pose—exuding adorable charm and incredible lifelike detail. Soft natural lighting enhances the texture of each individual whisker and fur strand, with subtle highlights on the muzzle and inner ears. Background: a softly blurred autumn garden at golden hour—warm tones of amber leaves, dappled sunlight filtering through trees, and faint hints of mossy stone steps. Composition emphasizes the cat as the central focal point, captured in sharp focus with shallow depth of field. Style: ultra-realistic photography, National Geographic-level detail, 8K resolution, Canon EOS R5, f/1.2 aperture, cinematic lighting, true-to-life color grading, minimal post-processing. No text or overlays. bool (optional)Adds a “Qwen-Image” watermark to the bottom-right corner of the image. Default: false. Watermark style: integer (optional)Random number seed. Valid range: [0,2147483647].Using the same seed yields similar outputs. If omitted, the algorithm uses a random seed.Note: Image generation is probabilistic. Even with the same seed, results may vary. |
Response parameters |
Save the task_id to query the task status and result. |
outputobjectTask output information.
Properties task_id stringThe task ID. Valid for queries for 24 hours.task_status stringThe status of the task.
Enumeration values
| |
request_id stringUnique request identifier for tracing and troubleshooting. | |
code stringError code. Returned only for failed requests. See Error codes. | |
message stringDetailed error message. Returned only for failed requests. See Error codes. |
Step 2: Poll for results using the task ID
- Singapore
- China (Beijing)
GET https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}When calling, replace {WorkspaceId} with your actual workspace ID.- Polling recommendation: Image generation is time-consuming. Use a polling mechanism with a reasonable interval, such as 10 seconds.
- Task state transition: PENDING → RUNNING → SUCCEEDED or FAILED.
- Result link: After a task succeeds, an image URL valid for 24 hours is returned. Download and save the image to permanent storage, such as OSS.
Request parameters |
Replace {task_id} with the task_id value returned by the previous API call. The task_id is valid for queries for 24 hours, Replace {WorkspaceId} with your actual workspace ID. |
Request headers | |
Authorization string (Required)Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx. | |
URL path parameters | |
task_id string (Required)The ID of the task. |
Response parameters |
Task data (task status and image URLs) is retained for only 24 hours and then automatically purged. Save generated images promptly. |
outputobjectTask output information.
Properties task_id stringThe task ID. Valid for queries for 24 hours.task_status stringThe status of the task.
Enumeration values
stringThe time when the task was submitted. The time is in UTC+8 and the format is YYYY-MM-DD HH:mm:ss.SSS.scheduled_time stringThe time when the task was executed. The time is in UTC+8 and the format is YYYY-MM-DD HH:mm:ss.SSS.end_time stringThe time when the task was completed. The time is in UTC+8 and the format is YYYY-MM-DD HH:mm:ss.SSS.results arrayList of task results, including image URLs, prompts, and error messages for failed tasks.
Properties orig_prompt stringThe original input prompt, corresponding to the request parameter prompt.actual_prompt stringThe optimized prompt used when prompt rewriting is enabled. Not returned when disabled.url stringURL of the generated image. Expires after 24 hours. Download and save the image promptly.stringError code. Returned only for failed requests. See Error codes.message stringDetailed error message. Returned only for failed requests. See Error codes. | |
usage objectOutput statistics. Counts only successful results.
Properties image_count integerNumber of generated images. For qwen-image-2.0 series models this equals the requested n (1–6). | |
request_id stringUnique request identifier for tracing and troubleshooting. |
DashScope SDK
The DashScope SDK supports Python and Java.
SDK parameter names closely match their HTTP counterparts. Parameter structures follow language-specific conventions. For asynchronous call parameters, see HTTP.
Image models require longer processing times, so the underlying service uses asynchronous execution. The SDK provides two modes:
- Synchronous call (blocking mode): The SDK waits for the task to complete and returns the final result. This matches standard synchronous call behavior.
- Asynchronous call (non-blocking mode): The call returns immediately with a task ID. Poll for the task status and final result using that ID.
Python SDK
- Synchronous
- Asynchronous
Request example
Response example
URLs expire after 24 hours. Download images promptly.
Java SDK
- Synchronous
- Asynchronous
Request example
Response example
URLs expire after 24 hours. Download images promptly.
Use with the OpenAI Agents SDK
Image generation models such as Qwen-Image are called through the DashScope native API and do not support OpenAI-compatible (compatible-mode) mode, so they cannot be used directly as the reasoning model of an Agent in the OpenAI Agents SDK.
In agent frameworks such as the OpenAI Agents SDK, you can wrap image generation as a tool (function tool) and let a text chat model that supports OpenAI-compatible mode (such as qwen-plus) act as the Agent's reasoning core to orchestrate it. For example:
Before running, install the dependencies: pip install openai-agents dashscope.
Billing and rate limiting
- For free quotas and pricing, see Model pricing.
- For rate limits, see Qwen-Image.
- Billing details: Each successfully generated image is billed. Failed calls or processing errors do not incur charges or consume your new user free quota.
Error codes
If the model call fails and returns an error message, see Error codes for resolution.
FAQ
Q: Should I enable or disable the prompt_extend parameter?
A: Enable this option (default) if you want more diverse image content and for the model to add details. Disable it if you need tighter control over image details, and optimize your prompts using the Text-to-Image Prompt Guide.
Q: What are the differences between qwen-image-2.0 series models?
A:
-
Combined image generation and editing models: Support both text-to-image and image editing.
qwen-image-2.0-proandqwen-image-2.0-pro-2026-03-03: Same capabilities. The Pro series delivers more professional text rendering, finer realistic textures, detailed realistic scenes, and stronger semantic adherence. Supports synchronous calls only.qwen-image-2.0andqwen-image-2.0-2026-03-03: Same capabilities. The accelerated version balances model performance and quality. Supports synchronous calls only.
