Appearance
Qwen qwen-image and Wan wan models for text-to-image
Reference, synced 2026-06-13.
flowchart TD n0["Models"] n1["Overview"] n2["Products"] n3["Solutions"] n4["Pricing"] n5["Resources"] n6["Partners"] n7["Support"] n8["Language"] n0 --> n1 n1 --> n2 n2 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8
Free access Accelerate Delivery with Fixed-Cost Agentic CodingWatch how it works
Models
Empowering AI innovation for both enterprises and developers with Alibaba Cloud’s best-in-class Qwen models, AI-native apps, and AI solutions.
Alibaba Cloud Model Studio \ Enterprise-grade large model service and application development platform.
Try Visual Model \ Supports image understanding, image generation, and video generation.
Models
HappyHorse-1.0-T2V \ Cinematic creative generation, ultimate dynamic details Qwen3-VL-Plus \ Native VL, spatial reasoning, 1M-context video analysis Wan2.7-VideoEdit \ Supports both localized and global editing with prompt
Qwen3.6-Plus \ Native multimodal, 1M context, agentic coding Wan2.7-Image-Pro \ Interactive editing, long-text rendering, precise prompt following Qwen-Plus \ Balanced intelligence, efficient inference, production-ready performance
Qwen-Image-2.0 \ Professional infographics, exquisite photorealism Z-Image-Turbo \ Ultra-fast image generation, high throughput, cost-optimized inference Qwen3-Coder-Next \ Multi-turn tool interactions, future-ready development support
Wan2.7-T2V \ High-fidelity T2V, 15s duration, advanced camera control Wan2.7-I2V \ Cinematic I2V with emotional depth and visceral impact Wan2.7-R2V \ Up to 5 mixed image/video inputs and audio timbre cloning
GenAI Application
Qoder \ Intelligent coding assistant, available for enterprise-dedicated deployment. Qoder CN \ AI-powered coding assistant that boosts developer productivity with intelligent code completion, AI chat, multi-file editing, and task automation.
AI Service
Model Experience \ Experience full-scale, multimodal model capabilities online. Platform for AI \ An AI-native algorithm engineering platform for end-to-end modeling, training, and inference service deployment. Fine-tune Video Generation Model \ Customize Wan’s text-to-video capabilities through model fine-tuning to meet your unique requirements.
AI Use Case
AI Savings Plan Hot \ Save up to 47% on AI costs. Limited-time offer tailored to your usage. AI Video Creation \ Elevate your professional video production with Wan 2.6.
AI Token Plan \ One plan. Multiple models. Big Savings with a Fixed Subscription. AI Image Creation \ All-in-one creative suite for copywriting, image generation, and poster design.
Overview
As a global full-stack AI leader, Alibaba Cloud aims to make computing accessible to everyone and help worldwide customers accelerate innovation.
Why Alibaba Cloud
About Alibaba Cloud \ AI Powered Cloud Technology Our Global Network \ Explore our global presence and deployment regions around the world Our Global Offices \ With offices in 4 continents, we're always close to where it matters.
Asia Accelerator \ Accelerate Success in Asia with Alibaba Cloud Go Global \ Benefits of our Global Alliance Trust Center \ Empowering enterprises with a secure, compliant, and globally trusted cloud infrastructure
Customers and Insights
Olympic Games \ Alibaba Cloud Powers Olympic Games with AI-powered cloud technology Case Studies \ Learn how customers are scaling their businesses on Alibaba Cloud Analyst Reports \ Learn what the top industry analyst firms are saying about Alibaba Cloud
What's New
Events and Webinars \ Quick access to upcoming and on-demand events Product Updates \ Stay informed of the latest innovations Press Room \ Latest news and media releases
Products
Featured ProductsAI & Machine Learning Computing Container Storage Networking & CDN Security Middleware Database Analytics ComputingMedia ServicesEnterprise Services & Cloud CommunicationDomain Names and WebsitesEnd User ComputingServerlessDeveloper ToolsMigration & O&M ManagementApsara Stack
Featured Products
Alibaba Cloud Model Studio \ Supercharge your AI journey effortlessly with industry-leading GenAI models ApsaraDB RDS \ Store and manage your business data, with automated monitoring and backups Certificate Management Service (Original SSL Certificate) \ Create a safe and secure connection between your website and users
Elastic Compute Service (ECS) \ Host websites anywhere and scale enterprise workloads Container Service for Kubernetes (ACK) \ Run and scale containerized applications on managed Kubernetes infrastructure Object Storage Service (OSS) \ Store large amounts of data in the cloud and access it anywhere, anytime
Simple Application Server (SAS) \ All-in-one services for fast deployment Elastic IP Address (EIP) \ Manage your public IPs independently to improve internet network quality Domain Names and Website \ Get the perfect domain name to suit your every need
Related Programs
Solutions
Solutions by Industry Technical Solutions AI WebsitesNetworking Security and ComplianceData and AnalyticsEnterprise Service and ApplicationCloud MigrationCloud NativeHybrid CloudSMB solutions
Financial Services \ Innovate faster with Alibaba Cloud Games \ Grow your game rapidly with high global availability
New Retail \ Alibaba Cloud enables digital retail transformation to fuel growth and realize an omnichannel customer experience throughout the consumer journey. Media and Entertainment \ Ready your content for today's media market with a digitalized media journey
Supply Chain \ Power your supply chain with intelligent, efficient, and reliable solutions Sports \ Digitizing the sports industry with intelligent tech
Sustainability \ Achieve a sustainable future with low-carbon and energy-efficient technologies
Pricing
Flexible options like pay-as-you-go and clear billing rules to meet diverse business needs.
Overview & Tools
Pricing Calculator \ Get an instant pricing estimate based on your usage and needs Free Trial \ Try our 80+ cloud products for free.
Pricing Options \ Get the most out of Alibaba Cloud with flexible pricing
Optimize your cost
Migrate & Save \ Superior Performance At Lower Pricing. Save up to 50%. Promotion Center \ Unlock the latest Alibaba Cloud offers & promos
Resources
Official documentation, extensive tools, training resources, and a community to grow and innovate in the cloud.
Technical Resources
Documentation \ Product guides and FAQs Architecture Center \ Design reliable, secure, and efficient cloud architecture. Intelligent Solution Explorer \ Find the right solution for you, powered by AI
Blog \ Latest cloud insights and developer trends Whitepapers \ Research that explores the how and why behind our technology
Training&Certification
Alibaba Cloud Academy \ Build cloud skills and earn certifications with expert-led training.
Developer Hub
Alibaba Cloud Project Hub \ Explore real-world projects built by developers using our platform. Our Developer MVPs \ Celebrating the developers who lead, build, and inspire our community
Partners
Partner-first strategy offering collaborative product, sales, and service models, plus high-quality partner solutions that complement Alibaba Cloud’s capabilities.
Marketplace
AI Alliance for ISVs \ Partner with us to build and grow AI solutions together ISV Benefits \ Unlock resources, market access, and go-to-market support as an ISV partner
Alibaba Cloud Marketplace \ Explore ready-to-deploy solutions from our partners and ISVs
Find a Partner
Partner Hub \ Find your ideal partner in no time
Become a Partner
Partner Network \ A partner portal for Alibaba Cloud Channel, Technology, MSP partner and other partner programs
Support
Full-lifecycle support and expert services, from cloud advisory and migration to operations.
Support & Professional Services
Professional Services \ Expert-led services to design, migrate, and optimize your cloud journey Support Plans \ Flexible support for every stage — from startup to enterprise
Partner Support Program \ Priority technical support for partners, with dedicated managers and faster issue resolution
Contact us
Connect With Us \
Talk to a sales expert and get a custom quote for your business
Language
- English
- 简体中文
- 繁體中文
- 日本語
- Bahasa Indonesia
Locale
Visit aliyun.com
Documentation
Alibaba Cloud Model Studio
User Guide (Models) User Guide (Application) API Reference (Models) API Reference (Application)
Search for Help Content
Getting Started
The Beginner's Guide
Well-Architected Framework
AI & Machine Learning
Platform For AI
Alibaba Cloud Model Studio
DashVector
Artificial Intelligence Recommendation
OpenSearch
Image Search
Machine Translation
Intelligent Speech Interaction
Optimization Solver
Intelligent Computing LINGJUN
Computing
Elastic Compute Service
Elastic GPU Service
Elastic Container Instance
Dedicated Host
Compute Nest
Simple Application Server
Cloud Box
Auto Scaling
Elastic High Performance Computing
Batch Compute (Deprecated)
Function Compute
Serverless App Engine
ENS
Elastic Desktop Service
App Streaming
WUYING Terminal
Cloud Phone
Edge Network Acceleration
Alibaba Cloud Linux
AgentBay
Container
Container Service for Kubernetes
Container Compute Service
Container Registry
Storage
Object Storage Service
Cloud Parallel File Storage
File Storage NAS
Tablestore
Storage Capacity Unit
Simple Log Service
Cloud Backup
Intelligent Media Management
Drive and Photo Service
Data Transport
Cloud Storage Gateway
Data Online Migration
Hybrid Cloud Storage Array
Storage Services Overview
Backup and Disaster Recovery Center
Networking and CDN
Server Load Balancer
Elastic IP Address
Internet Shared Bandwidth
Data Transfer Plan
Virtual Private Cloud
NAT Gateway
PrivateLink
Alibaba Cloud DNS PrivateZone
Network Intelligence Service
Cloud Data Transfer
IPv6 Gateway
Anycast Elastic IP Address
Cloud Enterprise Network
Global Accelerator
VPN Gateway
Smart Access Gateway
Express Connect
CDN
Edge Security Acceleration
Cloud Network Well-architected Design Guidelines
Security
Anti-DDoS
Web Application Firewall
Cloud Firewall
Security Center
Bastionhost
Secure Access Service Edge
Certificate Management Service
Key Management Service
Data Security Center
Identity as a Service
Fraud Detection
AI Guardrails
Captcha
Blockchain as a Service
ID Verification
Managed Security Service
Middleware
Enterprise Distributed Application Service
Microservices Engine
Alibaba Cloud Service Mesh
SchedulerX
ApsaraMQ for RocketMQ
ApsaraMQ for Kafka
ApsaraMQ for RabbitMQ
ApsaraMQ for MQTT
Simple Message Queue (formerly MNS)
CloudFlow
EventBridge
Application Real-Time Monitoring Service
Managed Service for Prometheus
Managed Service for Grafana
Managed Service for OpenTelemetry
Performance Testing
Databases
ApsaraDB Console
PolarDB
ApsaraDB RDS
ApsaraDB for OceanBase (Deprecated)
Tair (Redis® OSS-Compatible)
Lindorm
Time Series Database
ApsaraDB for MongoDB
ApsaraDB for HBase
ApsaraDB for Memcache
ApsaraDB for MyBase
AnalyticDB
ApsaraDB for ClickHouse
ApsaraDB for SelectDB
Data Transmission Service
Database Autonomy Service
Data Management
Database Gateway - Deprecated
ApsaraDB for Cassandra - Deprecated
Analytics Computing
MaxCompute
Hologres
Realtime Compute for Apache Flink
Elasticsearch
Vector Retrieval Service for Milvus
E-MapReduce
Data Lake Formation
DataV
Quick BI
Quick Audience
Quick Tracking
DataWorks
DataHub
Dataphin
Media Services
ApsaraVideo VOD
ApsaraVideo Live
Intelligent Media Services
ApsaraVideo Media Processing
Apsara Video SDK
Enterprise Services & Cloud Communication
Energy Expert
CloudQuotation
Salesforce on Alibaba Cloud
GoChina ICP Filing Assistant
Marketplace
Alibaba Mail
Direct Mail
Short Message Service
Voice Service
Phone Number Verification Service
Cell Phone Number Service
Chat App Message Service
Financial Intelligence Engine
Domain Names and Websites
Domain Names
ICP Filing
Alibaba Cloud DNS
End User Computing
Elastic Desktop Service
App Streaming
WUYING Terminal
Cloud Phone
AgentBay
Internet of Things
IoT Platform
Serverless
Serverless App Engine
CloudFlow
EventBridge
Simple Message Queue (formerly MNS)
Function Compute
Developer Tools
OpenAPI Explorer
Alibaba Cloud SDK
Cloud Shell
Resource Orchestration Service
Alibaba Cloud CLI
BSS OpenAPI
Terraform
Pulumi
Ticket System API
Mobile Platform as a Service
Alibaba Cloud DevOps
API Gateway
Cloud Control API
AI Coding Assistant Lingma
Cloud Skills Portal
Migration & O&M Management
CloudOps Orchestration Service
Cloud Monitor
Intelligent Advisor
Cloud Governance Center
ActionTrail
Cloud Config
Resource Access Management
Resource Management
Cloud Architect Design Tools
Migration Hub
Server Migration Center
Service Catalog
Logic Composer
Quota Center
CloudSSO
HTTPDNS
Solutions
SAP
SuperApp
OpenLake
Membership Service
Expenses and Costs
Account Center
More
Support
Legal
Tech Share Terms and Conditions
After Sales Support
China Gateway Program
Service Level Objectives
Management Console
Security Control
Use the text-to-image API to generate images from text descriptions. Model Studio offers three model families: Wan, Qwen-Image, and Z-Image.
Try it online: Singapore | Beijing
Model performance
Qwen-Image
| Complex text | Long paragraph | Complex layout |
| Poster creation | Illustration design | Photorealistic photography |
View prompt
Complex text: Bookstore window display. A sign displays “ New Arrivals This Week”. Below, a shelf tag with the text “ Best-Selling Novels Here”. To the side, a colorful poster advertises “ Author Meet And Greet on Saturday” with a central portrait of the author. There are four books on the bookshelf, namely “The Light Between Worlds” “When Stars Are Scattered” “The Silent Patient” “The Night Circus”.
Long paragraph: A young girl dressed in a school uniform stands in a classroom, writing on the blackboard. Centered on the board, neatly inscribed in white chalk, is the text: “ Introducing Qwen-Image, a foundational image generation model that excels in complex text rendering and precise image editing.” Soft natural light streams through the windows, casting gentle shadows. The scene is rendered in a realistic photographic style, with finely detailed textures, shallow depth of field, and warm tonal hues. The girl’s focused expression and the chalk dust suspended in the air add a sense of movement and vitality. Background elements—including student desks and educational posters—are slightly blurred to emphasize the central action. Ultra-high 32K resolution, DSLR-quality imagery, soft bokeh effect, and documentary-style composition.
Complex layout: Create a classroom PowerPoint slide for a speech. The slide features artistic, decorative shapes framing neatly arranged textual information as an elegant infographic. Centered title: ‘Habits for Emotional Wellbeing’, surrounded by a symmetrical floral pattern. Top left: ‘Practice Mindfulness’ + minimalist lotus icon + text ‘Be present, observe without judging, and accept without resisting.’ Below it: ‘Cultivate Gratitude’ + open hand illustration + text ‘Appreciate simple joys and acknowledge positivity daily.’ Bottom left: ‘Stay Connected’ + minimalistic chat bubble icon + text ‘Build and maintain meaningful relationships to sustain emotional energy.’ Bottom right: ‘Prioritize Sleep’ + crescent moon illustration + text ‘Quality sleep benefits both body and mind.’ Top right: ‘Regular Physical Activity’ + jogging runner icon + text ‘Exercise boosts mood and relieves anxiety.’ Upper right: ‘Continuous Learning’ + book icon + text ‘Engage in new skills and knowledge for growth.’ The layout balances clarity and artistry to guide viewers naturally. --ar 16:9 --style clean - presentation.
Poster Design: This charming, hand-drawn poster features three puppies playing with a ball on lush green grass, decorated with elements such as birds and stars. The main title, “Come Play Ball!”, is prominently displayed at the top in a bold, blue, cartoon-style font. Below the title, the subtitle “Come [Show Off Your Skills]!” appears in a green font. A speech bubble adds a playful touch with the text: “Hehe, watch me amaze my little friends next!” At the bottom, additional text reads: “We get to play ball with our friends again!” The color palette is centered on fresh greens and blues, with bright pink and yellow accents that create a cheerful and childlike atmosphere.
Illustration design: A vibrant and lively illustration of a sunny, bustling commercial street scene, slice of life. In the foreground, a young boy in a white shirt and shorts is intently choosing items from a market stall. The stall is filled with snacks, drinks, and daily goods. The stall owner, a middle-aged man in an apron, is organizing the products. A wooden sign with “Qwen-Image” in a handwritten style hangs above the stall. The background features modern, colorful buildings with prominent signs for “Alibaba”, “Model Studio”, and “Text-to-Image”. The sky is azure blue with fluffy white clouds and soaring seagulls. Art Style: Realism illustration, delicate and soft, vibrant colors, rich layers, subtle hand-drawn texture, detailed, strong light and shadow, full composition, strong sense of depth, cheerful and relaxing atmosphere.
Photorealistic photography: An Asian woman in her early twenties. She has a straight bang and long, smooth black hair falling naturally over her shoulders. She sits sideways on a vintage floral-print sofa. The fabric is off-white with pink and green flowers, slightly worn and lived-in. She wears a loose, light-green mohair sweater—soft and fluffy—and a light gray-blue linen skirt. Her look is fresh, natural, and relaxed. Her right hand holds a red tomato near her chin, casually posed. She looks directly at the camera with calm, slightly detached eyes. A light ceramic dish sits to her right, holding three or four plump, bright red tomatoes with green stems—vivid against the cool green palette. The background is a weathered teal-green wall, textured and imperfect. Natural light streams in from a window, forming clear diagonal beams across her and the wall. Light and shadow layers are rich. Potted plants sit on the windowsill and in corners. A deep brown antique wooden cabinet appears faintly on the left. The photo uses a cool green tone, with visible film grain and subtle light leaks. The composition is full. The mood is quiet, artistic, and strongly evokes vintage film portraiture.
Wan
| Portrait photography | Realistic photography | Artistic styles |
| Text rendering | Poster design | Image set generation |
View prompt
Portrait photography: Hyper-realistic Scandinavian woman portrait. Flowing platinum blonde hair and piercing blue eyes with prominent freckles. Sharp intellectual gaze. Nordic cold-toned directional lighting creates an icy atmosphere. Minimalist modern styling with clean lines. Shallow depth-of-field blurred cold-gradient background. Authentic Nordic facial features and porcelain skin texture.
Photorealistic photography: Fish-eye perspective forest scene with dramatic perspective distortion. Ultra-detailed red fox staring into lens with piercing amber eyes. Hyper-realistic fur texture showing individual guard hairs and undercoat layers. Radially warped trees forming circular background patterns. Watercolor painting style with translucent washes and organic pigment bleeding. Soft pastel palette of moss green and earth ochre tones. Painterly lighting with atmospheric glow through canopy gaps.
Artistic styles: Vintage oil painting style pastoral song. A farmer herds sheep across a meadow full of wildflowers. A windmill turns in the distance under blue sky and white clouds. Smoke curls from the chimney of a wooden house. Bright and soft colors. Full of tranquility and comfort.
Text rendering: A page from a plant identification guide. Hand-drawn watercolor style. Depicts a “dandelion” with labeled parts.
Poster design: Cinematic poster scene: Extreme macro close-up of eye in wooden crack. Minimalist monochrome, watercolor-CGI fusion, low saturation. Slow push-in with tremor for surreal intensity. Vast negative space, hidden title. Optimized for immersive video generation.
Image set generation: A lifetime of memories for an elderly man. Four portraits in different frames: childhood (black-and-white photo), youth (military uniform photo), middle age (business suit work photo), and old age (photo with spouse).
Supported models
Recommended models
Recommended models
Recommended models
Recommended models
wan2.7-image-pro: The most feature-rich model. Supports multi-image generation and resolutions up to 4096x4096, with enhanced control over facial features, colors, and long text rendering.
qwen-image-2.0-pro: Excels at text rendering, accurately generating Chinese and English text that blends naturally with physical materials. Ideal for creating charts, posters, and presentations.
z-image-turbo: Optimized for speed and cost-efficiency. Generates images quickly at a lower cost, excelling at highly realistic portraits and product images.
Getting started
Prerequisites
Get your API key. Then set your API key as an environment variable. If you use the DashScope SDK, also install the SDK.
Sample code
Calling methods:
All Wan text-to-image models support asynchronous calls. The wan2.7-image-pro, wan2.7-image, wan2.6-image, and wan2.6-t2i models also support synchronous calls. See Wan2.7 - image generation and editing, Wan2.6 - image generation and editing, and Wan – text-to-image v2.
All Qwen text-to-image models support synchronous calls. The qwen-image-plus and qwen-image models also support asynchronous calls. See Qwen - text-to-image.
Wan – asynchronous call
Qwen – synchronous call
Python
Java
curl
Request example
python
import os
import dashscope
from dashscope.aigc.image_generation import ImageGeneration
from dashscope.api_entities.dashscope_response import Message
# Base URL for Singapore region. Base URLs differ by region.
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'
# If you have not set the environment variable, replace the next line with: api_key="sk-xxx"
# API keys differ by region. Get your API key: https://www.alibabacloud.com/help/en/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")
def main():
message = Message(
role="user",
content=[\
{"text": "A young woman, natural and relaxed selfie style, ultra-high-definition realistic portrait. She wears a yellow floral long-sleeve top. Her long hair falls naturally with gentle waves. The background is outdoor scenery: green plants in the foreground, water and mountains in the distance. Soft, natural sunlight illuminates her face and body, creating natural light and shadow effects. The shot is taken from a medium-distance selfie perspective, with her holding the device. She stands naturally, conveying ease and comfort. The angle is natural, like a casual snapshot—captured spontaneously."}\
]
)
# Submit asynchronous task
print("Submitting asynchronous task...")
response = ImageGeneration.async_call(
model="wan2.7-image-pro",
api_key=api_key,
messages=[message],
enable_sequential=False,
n=1,
size="2K"
)
if response.status_code == 200:
print(f"Task submitted successfully. Task ID: {response.output.task_id}")
# Wait for task completion
status = ImageGeneration.wait(task=response, api_key=api_key)
if status.output.task_status == "SUCCEEDED":
print("Task completed!")
print(f"Result:")
print(status)
else:
print(f"Task failed. Status: {status.output.task_status}")
else:
print(f"Task creation failed: {response.code} - {response.message}")
if __name__ == "__main__":
try:
main()
except Exception as e:
print(f"Error: {e}")Response example
1. Response when creating a task
json
{
"status_code": 200,
"request_id": "4fb3050f-de57-4a24-84ff-e37ee5xxxxxx",
"code": "",
"message": "",
"output": {
"text": null,
"finish_reason": null,
"choices": null,
"audio": null,
"task_id": "77093787-a217-4c29-9cd4-ca7b5ac86xxx",
"task_status": "PENDING"
},
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"characters": 0
}
}2. Response when querying task results
The image URL expires after 24 hours. Download the image promptly.
json
{
"status_code": 200,
"request_id": "56e318fd-ed60-99e8-8ca1-cdef25ca4xxx",
"code": "",
"message": "",
"output": {
"text": null,
"finish_reason": null,
"choices": [\
{\
"finish_reason": "stop",\
"message": {\
"role": "assistant",\
"content": [\
{\
"image": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xxxxxx.png?Expires=xxxxxx",\
"type": "image"\
}\
]\
}\
}\
],
"audio": null,
"task_id": "77093787-a217-4c29-9cd4-ca7b5ac86xxx",
"task_status": "SUCCEEDED",
"submit_time": "2026-03-31 23:04:46.166",
"scheduled_time": "2026-03-31 23:04:46.208",
"end_time": "2026-03-31 23:05:11.664",
"finished": true
},
"usage": {
"input_tokens": 720,
"output_tokens": 11,
"characters": 0,
"size": "2048*2048",
"total_tokens": 731,
"image_count": 1
}
}Request example
java
import com.alibaba.dashscope.aigc.imagegeneration.*;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.exception.UploadFileException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;
import java.util.Collections;
public class Main {
static {
// Base URL for Singapore region. Base URLs differ by region.
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
}
// If you have not set the environment variable, replace the next line with: apiKey="sk-xxx"
// API keys differ by region. Get your API key: https://www.alibabacloud.com/help/en/model-studio/get-api-key
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static ImageGenerationResult waitTask(String taskId)
throws ApiException, NoApiKeyException {
ImageGeneration imageGeneration = new ImageGeneration();
return imageGeneration.wait(taskId, apiKey);
}
public static void asyncCall() throws ApiException, NoApiKeyException, UploadFileException {
ImageGenerationMessage message = ImageGenerationMessage.builder()
.role("user")
.content(Collections.singletonList(
Collections.singletonMap("text", "A young woman, natural and relaxed selfie style, ultra-high-definition realistic portrait. She wears a yellow floral long-sleeve top. Her long hair falls naturally with gentle waves. The background is outdoor scenery: green plants in the foreground, water and mountains in the distance. Soft, natural sunlight illuminates her face and body, creating natural light and shadow effects. The shot is taken from a medium-distance selfie perspective, with her holding the device. She stands naturally, conveying ease and comfort. The angle is natural, like a casual snapshot—captured spontaneously.")
)).build();
ImageGenerationParam param = ImageGenerationParam.builder()
.apiKey(apiKey)
.model("wan2.7-image-pro")
.messages(Collections.singletonList(message))
.enableSequential(false)
.n(1)
.size("2K")
.build();
ImageGeneration imageGeneration = new ImageGeneration();
ImageGenerationResult taskResult = null;
try {
System.out.println("----async call, creating task----");
taskResult = imageGeneration.asyncCall(param);
} catch (ApiException | NoApiKeyException | UploadFileException e) {
throw new RuntimeException(e.getMessage());
}
System.out.println("Task created: " + JsonUtils.toJson(taskResult));
// Wait for task completion
String taskId = taskResult.getOutput().getTaskId();
ImageGenerationResult result = waitTask(taskId);
System.out.println(JsonUtils.toJson(result));
}
public static void main(String[] args) {
try {
asyncCall();
} catch (ApiException | NoApiKeyException | UploadFileException e) {
System.out.println(e.getMessage());
}
}
}Response example
1. Response when creating a task
json
{
"requestId": "7d026dc1-e8c9-9caa-84ac-e82e2da97xxx",
"output": {
"task_id": "2de18c56-c151-4b80-8105-1d164733exxx",
"task_status": "PENDING"
},
"status_code": 200,
"code": "",
"message": ""
}2. Response when querying task results
json
{
"requestId": "daea7295-4ce0-928a-9a11-4d2bea058xxx",
"usage": {
"input_tokens": 720,
"output_tokens": 11,
"total_tokens": 731,
"image_count": 1,
"size": "2048*2048"
},
"output": {
"choices": [\
{\
"finish_reason": "stop",\
"message": {\
"role": "assistant",\
"content": [\
{\
"image": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xxxxxx.png?Expires=xxxxxx",\
"type": "image"\
}\
]\
}\
}\
],
"task_id": "2de18c56-c151-4b80-8105-1d164733exxx",
"task_status": "SUCCEEDED",
"finished": true,
"submit_time": "2026-03-31 19:49:53.124",
"scheduled_time": "2026-03-31 19:49:53.175",
"end_time": "2026-03-31 19:50:53.160"
},
"status_code": 200,
"code": "",
"message": ""
}Note
Set the header parameter
X-DashScope-Asynctoenablefor asynchronous calls.The
task_idfor asynchronous tasks expires after 24 hours. After expiration, the task status becomesUNKNOWN.
Step 1: Submit a task
This request returns a task ID (task_id).
curl
curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/image-generation/generation' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header "X-DashScope-Async: enable" \
--data '{
"model": "wan2.7-image-pro",
"input": {
"messages": [\
{\
"role": "user",\
"content": [\
{"text": "A flower shop with exquisite windows, a beautiful wooden door, and flowers on display"}\
]\
}\
]
},
"parameters": {
"size": "2K",
"n": 1,
"watermark": false,
"thinking_mode": true
}
}'Step 2: Query the result using the task ID
Use the task_id from Step 1. Poll the task status until task_status becomes SUCCEEDED or FAILED.
Replace {task_id} with the task_id value returned by the previous API call. The task_id is valid for queries for 24 hours.
curl
curl -X GET https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"Python
Java
curl
Request example
python
import json
import os
import dashscope
from dashscope import MultiModalConversation
# Use this URL for Singapore region. For Beijing region, replace with: https://dashscope.aliyuncs.com/api/v1
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'
messages = [\
{\
"role": "user",\
"content": [\
{"text": "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!” is prominently displayed 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."}\
]\
}\
]
# API keys differ between Beijing and Singapore regions. Get your API key: https://www.alibabacloud.com/help/en/model-studio/get-api-key
# If you haven't set the environment variable, replace the line below with: api_key="sk-xxx"
api_key = os.getenv("DASHSCOPE_API_KEY")
response = MultiModalConversation.call(
api_key=api_key,
model="qwen-image-2.0-pro",
messages=messages,
result_format='message',
stream=False,
watermark=False,
prompt_extend=True,
negative_prompt="Low resolution, low quality, distorted limbs, malformed fingers, oversaturated colors, wax-figure appearance, lack of facial detail, excessive smoothness, AI-looking artifacts, chaotic composition, blurry or warped text.",
size='2048*2048'
)
if response.status_code == 200:
print(json.dumps(response, ensure_ascii=False))
else:
print(f"HTTP status code: {response.status_code}")
print(f"Error code: {response.code}")
print(f"Error message: {response.message}")
print("See documentation: https://www.alibabacloud.com/help/en/model-studio/error-code")Response example
Image URLs expire after 24 hours. Download the images promptly.
json
{
"status_code": 200,
"request_id": "d2d1a8c0-325f-9b9d-8b90-xxxxxx",
"code": "",
"message": "",
"output": {
"text": null,
"finish_reason": null,
"choices": [\
{\
"finish_reason": "stop",\
"message": {\
"role": "assistant",\
"content": [\
{\
"image": "https://dashscope-result-wlcb.oss-cn-wulanchabu.aliyuncs.com/xxx.png?Expires=xxx"\
}\
]\
}\
}\
]
},
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"width": 2048,
"image_count": 1,
"height": 2048
}
}Request example
java
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversation;
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationParam;
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationResult;
import com.alibaba.dashscope.common.MultiModalMessage;
import com.alibaba.dashscope.common.Role;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.exception.UploadFileException;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
public class QwenImage {
static {
// Use this URL for Singapore region. For Beijing region, replace with: https://dashscope.aliyuncs.com/api/v1
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
}
// API keys differ between Beijing and Singapore regions. Get your API key: https://www.alibabacloud.com/help/en/model-studio/get-api-key
// If you haven't set the environment variable, replace the line below with: static String apiKey="sk-xxx"
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void call() throws ApiException, NoApiKeyException, UploadFileException, IOException {
MultiModalConversation conv = new MultiModalConversation();
MultiModalMessage userMessage = MultiModalMessage.builder().role(Role.USER.getValue())
.content(Arrays.asList(
Collections.singletonMap("text", "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!” is prominently displayed 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.")
)).build();
Map<String, Object> parameters = new HashMap<>();
parameters.put("watermark", false);
parameters.put("prompt_extend", true);
parameters.put("negative_prompt", "Low resolution, low quality, distorted limbs, malformed fingers, oversaturated colors, wax-figure appearance, lack of facial detail, excessive smoothness, AI-looking artifacts, chaotic composition, blurry or warped text.");
parameters.put("size", "2048*2048");
MultiModalConversationParam param = MultiModalConversationParam.builder()
.apiKey(apiKey)
.model("qwen-image-2.0-pro")
.messages(Collections.singletonList(userMessage))
.parameters(parameters)
.build();
MultiModalConversationResult result = conv.call(param);
System.out.println(JsonUtils.toJson(result));
}
public static void main(String[] args) {
try {
call();
} catch (ApiException | NoApiKeyException | UploadFileException | IOException e) {
System.out.println(e.getMessage());
}
System.exit(0);
}Response example
Image URLs expire after 24 hours. Download the images promptly.
json
{
"requestId": "5b6f2d04-b019-40db-a5cc-xxxxxx",
"usage": {
"image_count": 1,
"width": 2048,
"height": 2048
},
"output": {
"choices": [\
{\
"finish_reason": "stop",\
"message": {\
"role": "assistant",\
"content": [\
{\
"image": "https://dashscope-result-wlcb.oss-cn-wulanchabu.aliyuncs.com/xxx.png?Expires=xxx"\
}\
]\
}\
}\
]
}
}Request example
curl
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--data '{
"model": "qwen-image-2.0-pro",
"input": {
"messages": [\
{\
"role": "user",\
"content": [\
{\
"text": "A winter street scene in Beijing featuring two adjacent traditional Chinese shops with gray-tiled roofs and vermilion-red exterior walls standing side by side. Warm-glow lanterns adorned with paper-cut horse motifs hang beneath the eaves, casting soft halos under overcast diffused light that gently reflects off the damp cobblestone pavement. On the left is a calligraphy shop: an aged indigo signboard bears the bold running-script characters “Text Rendering.” A vertical scroll on the storefront glass reads from top to bottom in Tian Yingzhang’s hard-pen style: “Professional Slides, Bilingual Posters, Advanced Infographics,” stamped with a cinnabar seal reading “1k token.” Inside, three vertically mounted calligraphy works are faintly visible on the wall—the first says “Alibaba,” the second “Qwen,” and the third “Image Generation.” An elderly white-haired man stands with his back to the camera, admiring the art. On the right is a flower shop whose sign spells out “Realistic Texture” using fresh blooms. Multi-tiered shelves inside display red roses, pink peonies, and greenery. A circular floral-patterned badge on the door reads “2k resolution,” and a colorful neon sign at the entrance displays the text “Detailed Depiction: People, Nature, Architecture.” Between the two shops sits a snowman holding an old-fashioned chalkboard with the words “Qwen-Image-2.0 Officially Released” scrawled in chalk. On the left side of the street, a young couple leans close together—the woman has a slender face, wears a beige cashmere coat and nude-toned sheer tights, and holds a transparent heart-shaped balloon printed with white text: “Image Generation and Editing in One.” Inside the balloon is a fluffy capybara plush toy. The man wears a well-tailored dark gray wool overcoat layered over a light turtleneck sweater. On the right side of the street, a delivery rider speeds past with “Smaller Model, Faster Speed” written across his back. The entire street blends dynamic motion with serene stillness through interwoven light and shadow."\
}\
]\
}\
]
},
"parameters": {
"negative_prompt": "Low resolution, low quality, distorted limbs, malformed fingers, oversaturated colors, wax-figure appearance, lack of facial detail, excessive smoothness, AI-looking artifacts, chaotic composition, blurry or warped text.",
"prompt_extend": true,
"watermark": false,
"size": "2048*2048"
}
}'curl
curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--data '{
"model": "qwen-image-2.0-pro",
"input": {
"messages": [\
{\
"role": "user",\
"content": [\
{\
"text": "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!” is prominently displayed 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."\
}\
]\
}\
]
},
"parameters": {
"negative_prompt": "Low resolution, low quality, distorted limbs, malformed fingers, oversaturated colors, wax-figure appearance, lack of facial detail, excessive smoothness, AI-looking artifacts, chaotic composition, blurry or warped text.",
"prompt_extend": true,
"watermark": false,
"size": "2048*2048"
}
}'Response example
json
{
"output": {
"choices": [\
{\
"finish_reason": "stop",\
"message": {\
"content": [\
{\
"image": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxx.png?Expires=xxx"\
}\
],\
"role": "assistant"\
}\
}\
]
},
"usage": {
"height": 2048,
"image_count": 1,
"width": 2048
},
"request_id": "d0250a3d-b07f-49e1-bdc8-6793f4929xxx"
}Key capabilities
1. Instruction following (prompts)
Parameters: messages.content.text or input.prompt (required), and negative_prompt (optional).
text \ prompt: Describes the desired image content: subject, scene, style, lighting, and composition.
negative_prompt: Describes what to exclude from the image, such as “blurry” or “extra fingers”.
Tip: Structured prompts yield better results. See Text-to-image prompt guide for best practices.
wan2.7-image-pro and wan2.7-image do not support the
negative_promptparameter. To exclude unwanted elements, describe them in the positive prompt.
2. Prompt rewriting
Parameter: parameters.prompt_extend (boolean, default: true).
This feature expands and refines short prompts to improve image quality. It adds 3 to 5 seconds of latency for prompt rewriting.
Practical advice:
Enable it when your input prompt is brief or general. This significantly improves image quality.
Disable it when you need tight control over details, already provide a detailed description, or require low latency. Set
prompt_extendtofalse.
wan2.7-image-pro and wan2.7-image do not support the
prompt_extendparameter. Usethinking_modeinstead to improve image quality.
3. Set output image resolution
Parameter: parameters.size (string), in the format "width*height".
| Model | Size format | Supported total pixel range | Default | Aspect ratio |
|---|
| Model | Size format | Supported total pixel range | Default | Aspect ratio |
| wan2.7-image-pro | Shorthand | 1K (1024*1024), 2K (2048*2048), 4K (4096*4096) | 2K (2048*2048) | 1:8 to 8:1 |
Custom "width*height" | 768*768 to 4096*4096 | |||
| wan2.7-image | Shorthand | 1K (1024*1024), 2K (2048*2048) | 2K (2048*2048) | 1:8 to 8:1 |
Custom "width*height" | 768*768 to 2048*2048 | |||
| wan2.6-image (interleaved text-image output mode) | Custom "width*height" | 768*768 to 1280*1280 | Matches input aspect ratio (≤1280*1280) | 1:4 to 4:1 |
| wan2.6-t2i, wan2.5-t2i-preview | Custom "width*height" | 1280*1280 to 1440*1440 | 1280*1280 | 1:4 to 4:1 |
| wan2.2 and earlier t2i models | Custom "width*height" | [512, 1440], total pixels ≤1440*1440 | 1024*1024 | - |
| qwen-image-2.0 series | Custom "width*height" | 512*512 to 2048*2048 | 2048*2048 | - |
| qwen-image-max / qwen-image-plus series | Fixed preset sizes only | See preset sizes below | 1664*928 (16:9) | - |
wan2.7-image-pro supports 4K and custom 4096*4096 resolution only in the text-to-image scenario (no image input, no composite image generation). All other scenarios support only 2K and 2048*2048 resolution.
qwen-image-max and qwen-image-plus series: Only the following 5 fixed resolutions are supported:
1664*928(default): 16:91472*1104: 4:31328*1328: 1:11104*1472: 3:4928*1664: 9:16
Recommended resolutions:
| Aspect ratio | 4K (wan2.7-image-pro) | 2K (wan2.7-image, qwen-image-2.0) | 1K (Wan t2i) |
|---|
| Aspect ratio | 4K (wan2.7-image-pro) | 2K (wan2.7-image, qwen-image-2.0) | 1K (Wan t2i) |
| 1:1 | 4096*4096 | 2048*2048 | 1280*1280 |
| 16:9 | 4096*2304 | 2688*1536 | 1696*960 |
| 9:16 | 2304*4096 | 1536*2688 | 960*1696 |
| 4:3 | 4096*3072 | 2368*1728 | 1472*1104 |
| 3:4 | 3072*4096 | 1728*2368 | 1104*1472 |
4. Image set generation
Parameter: parameters.enable_sequential (boolean, default: false). Supported only by wan2.7-image-pro and wan2.7-image.
Set to true to enable image set mode. The model generates multiple story-consistent images in one call, based on the prompt and reference images.
Generation count: Controlled by the
nparameter. When image set mode is enabled, the value of `n` can range from 1 to 12, with a default of 12. The model determines the actual count, up to n.Note: Image set mode disables
thinking_modeandcolor_palette.
5. Thinking mode
Parameter: parameters.thinking_mode (boolean, default: true). Supported only by wan2.7-image-pro and wan2.7-image.
When enabled, the model enhances reasoning to improve image quality but increases generation time.
This feature is available only when image set mode is disabled (
enable_sequential=false).
6. Custom color palette
Parameter: parameters.color_palette (array). Supported only by wan2.7-image-pro and wan2.7-image.
Pass an array of objects with hex colors and ratios to define the color scheme. The array must contain 3 to 10 colors, with 8 being the recommended number. The sum of all ratios must equal 100.00%.
This feature is available only when image set mode is disabled (
enable_sequential=false).
Click to view an input example
json
"color_palette": [\
{\
"hex": "#C2D1E6",\
"ratio": "23.51%"\
},\
{\
"hex": "#CDD8E9",\
"ratio": "20.13%"\
},\
{\
"hex": "#B5C8DB",\
"ratio": "15.88%"\
},\
{\
"hex": "#C0B5B4",\
"ratio": "13.27%"\
},\
{\
"hex": "#DAE0EC",\
"ratio": "10.11%"\
},\
{\
"hex": "#636574",\
"ratio": "8.93%"\
},\
{\
"hex": "#CACAD2",\
"ratio": "5.55%"\
},\
{\
"hex": "#CBD4E4",\
"ratio": "2.62%"\
}\
]Going live
Fault tolerance
Handle rate limiting: When the API returns error code
Throttlingor HTTP status code 429, the request is rate-limited. See Rate limiting.Poll asynchronous tasks: Poll with a reasonable strategy—every 3 seconds for the first 30 seconds, then at increasing intervals—to avoid triggering rate limits. Set a timeout (e.g., 2 minutes) and mark the task as failed if it expires.
Risk prevention
Persistent storage: Image URLs expire after 24 hours. Download images immediately and store them in persistent storage (e.g., Object Storage Service).
Content moderation: All
promptandnegative_promptinputs are moderated. If content violates policies, the request is blocked and returns errorDataInspectionFailed.Copyright and compliance risks: Ensure prompts comply with applicable laws and regulations. Content with brand trademarks, celebrity likenesses, or copyrighted IP may pose infringement risks.
API reference
Qwen-Image
Wan2.7 - image generation and editing
Wan2.6 - image generation and editing
Wan – text-to-image v2
Z-Image
Billing and rate limiting
For free quotas and pricing, see Model pricing.
For rate limits, see Image generation.
Billing note: Charge per successfully generated image. Failed calls incur no charge and do not consume Free quota for new users.
Error codes
If the model call fails and returns an error message, see Error codes for resolution.
FAQ
Q: How long do image URLs last? How do I save images permanently?
A: Image URLs expire after 24 hours. Download images immediately after receiving the URL and save them to persistent storage—such as a local server or Object Storage Service.
Q: My API call returns DataInspectionFailed. How do I fix it?
A: Your input triggered content moderation. Revise your prompt or negative_prompt to remove non-compliant content, then retry.
Q: Should I enable or disable the prompt_extend parameter?
A: Keep it enabled (default) for brief prompts or when you want creative detail. Set it to false when your prompt is already detailed or you need strict latency control.
Note: wan2.7-image-pro and wan2.7-image do not support the prompt_extend parameter. Use thinking_mode instead.
Previous: Image generation and editingNext: Image editing - Qwen
Is this page helpful?
Model performance
Supported models
Recommended models
Getting started
Key capabilities
1. Instruction following (prompts)
2. Prompt rewriting
3. Set output image resolution
4. Image set generation
5. Thinking mode
6. Custom color palette
Going live
API reference
Billing and rate limiting
Error codes
FAQ
Contact Us
Sales Support
Live-chat with our sales team or get in touch with a business development professional in your region.
Contact Sales
Technical Support
Open a ticket and get quick help from our technical team.
Open a Ticket >
Connect & Report Abuse
We look forward to your suggestion.
Post a Suggestion > Report Abuse >
\ \ Hi, I'm Alibaba Cloud AI Assistant!\ \ I can help with questions and solutions.
Why Alibaba Cloud
About Alibaba Cloud
Asia Accelerator
Our Global Network
Global Offices
Trust Center
Case Studies
Analyst Reports
Products & Pricings
Pricing Calculator
ECS
SAS
Model Studio
Database
Security
SMS
Solutions
Financial Services
Retail Services
Media Services
Gaming Services
ISV Solutions
Engage
Developer Community
Partner Network
Startups
Marketplace
Join Alibaba Cloud
Resources & Support
Developer Learning Hub
Documentation Center
Training & Certification
Service Notices
Submit a Ticket
Security Report
Qwen Cloud
Careers About Us Privacy Policy Legal Integrity Compliance Reporting Channel Service Notices Links
© 2009-2026 Copyright by Alibaba Cloud All rights reserved
- YouTube
- TikTok
- contact.us@alibabacloud.com
- Call Us Now
- Discord
© 2009-2026 Copyright by Alibaba Cloud All rights reserved
Careers About Us Privacy Policy Legal Integrity Compliance Reporting Channel Service Notices Links