Legacy Wan Text-to-Image
Legacy Alibaba Wanxiang text-to-image models including wan2.6-t2i, wan2.2, and wanx2.1 series, offering multiple sizes, batch generation, and negative prompt support.
Try it Online
Quick Start
python
from openai import OpenAI
client = OpenAI(
base_url="https://open.dieyuyun.com/v1",
api_key="YOUR_API_KEY"
)
response = client.images.generate(
model="wan2.6-t2i",
prompt="An orange tabby cat dozing under a cherry blossom tree",
size="1280x1280",
n=2
)
print(response.data[0].url)Endpoint
| Item | Value |
|---|---|
| Method | POST |
| Path | /v1/images/generations |
| Base URL | https://open.dieyuyun.com |
| Protocol | OpenAI Images API |
Authentication
Bearer Token: Authorization: Bearer YOUR_API_KEY
Supported Models
| Model | Category | Features | Max Resolution | Sync |
|---|---|---|---|---|
wan2.6-t2i | 2.6 Latest | Latest protocol, sync+async, supports prompt_extend | 1440² | Yes |
wan2.2-t2i-plus | 2.2 High-Qual | High quality legacy, each side [512, 1440] | 1440² | No (async) |
wan2.2-t2i-flash | 2.2 Fast | Fast legacy, high speed and low cost | 1440² | No (async) |
wanx2.1-t2i-turbo | 2.1 Fast | 2.1 fast variant | 1440² | No (async) |
wanx2.1-t2i-plus | 2.1 High-Qual | 2.1 high quality variant | 1440² | No (async) |
Model Comparison
| Feature | wan2.6-t2i | wan2.2-t2i-plus | wan2.2-t2i-flash | wanx2.1-t2i-turbo | wanx2.1-t2i-plus |
|---|---|---|---|---|---|
| Sync Response | Yes | No | No | No | No |
| prompt_extend | Yes | No | No | No | No |
| watermark | Yes | No | No | No | No |
| negative_prompt | Yes | Yes | Yes | Yes | Yes |
| Batch Gen (n) | 1–4 | 1–4 | 1–4 | 1–4 | 1–4 |
| Max Resolution | 1440² | 1440² | 1440² | 1440² | 1440² |
Standard Request Fields
Common to All Models
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| model | string | Yes | — | Model identifier. See Supported Models |
| prompt | string | Yes | — | Image description text |
| size | string | No | See size tables | Image size. Supported sizes vary by model |
| n | integer | No | 4 | Number of images to generate, range 1–4 |
| response_format | string | No | url | Response format: url or b64_json |
| negative_prompt | string | No | — | Negative prompt describing unwanted content |
| seed | integer | No | — | Random seed for reproducible results |
Supported Sizes
wan2.6-t2i
Total pixel range: [1280², 1440²]
| Size | Aspect Ratio | Description |
|---|---|---|
1280x1280 | 1:1 | Square |
1696x960 | 16:9 | Widescreen |
960x1696 | 9:16 | Full-screen tall |
1472x1104 | 4:3 | Landscape |
1104x1472 | 3:4 | Portrait |
wan2.2 / wanx2.1 Series
Each side range: [512, 1440]
| Size | Aspect Ratio | Description |
|---|---|---|
1024x1024 | 1:1 | Square |
1440x1440 | 1:1 | Square HD |
1280x720 | 16:9 | Widescreen |
720x1280 | 9:16 | Full-screen tall |
1024x1440 | ~3:4 | Portrait |
1440x1024 | ~4:3 | Landscape |
768x1152 | 2:3 | Portrait |
1152x768 | 3:2 | Landscape |
960x1280 | 3:4 | Portrait |
1280x960 | 4:3 | Landscape |
512x1024 | 1:2 | Narrow portrait |
1024x512 | 2:1 | Wide landscape |
Extended Parameters
wan2.6-t2i Only
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| prompt_extend | boolean | No | true | Whether to automatically extend the prompt for better results |
| watermark | boolean | No | false | Whether to add a watermark. Set to true to enable |
Note
The wan2.2 and wanx2.1 legacy models do not support prompt_extend or watermark parameters in compatible mode.
Common Extended Parameters (All Models)
| Field | Type | Description |
|---|---|---|
| negative_prompt | string | Negative prompt describing unwanted content |
| seed | integer | Random seed for reproducible results |
Request Examples
bash
curl https://open.dieyuyun.com/v1/images/generations \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.6-t2i",
"prompt": "An orange tabby cat dozing under a cherry blossom tree",
"size": "1280x1280",
"n": 2
}'python
from openai import OpenAI
client = OpenAI(
base_url="https://open.dieyuyun.com/v1",
api_key="YOUR_API_KEY"
)
response = client.images.generate(
model="wan2.6-t2i",
prompt="An orange tabby cat dozing under a cherry blossom tree",
size="1280x1280",
n=2
)
print(response.data[0].url)javascript
import OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://open.dieyuyun.com/v1',
apiKey: 'YOUR_API_KEY',
})
const response = await client.images.generate({
model: 'wan2.6-t2i',
prompt: 'An orange tabby cat dozing under a cherry blossom tree',
size: '1280x1280',
n: 2,
})
console.log(response.data[0].url)Using Negative Prompts
bash
curl https://open.dieyuyun.com/v1/images/generations \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.6-t2i",
"prompt": "An orange tabby cat dozing under a cherry blossom tree, watercolor style",
"size": "1280x1280",
"negative_prompt": "blurry, low quality, deformed",
"n": 2
}'Disable Prompt Extension (wan2.6-t2i)
bash
curl https://open.dieyuyun.com/v1/images/generations \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.6-t2i",
"prompt": "An orange tabby cat dozing under a cherry blossom tree",
"size": "1280x1280",
"prompt_extend": false,
"n": 2
}'Response Format
Success Response
json
{
"created": 1717000000,
"data": [
{
"url": "https://...",
"revised_prompt": "An orange tabby cat peacefully dozing beneath a blooming cherry blossom tree, petals gently falling, dappled sunlight filtering through the leaves"
},
{
"url": "https://...",
"revised_prompt": "An orange tabby cat peacefully dozing beneath a blooming cherry blossom tree, petals gently falling, dappled sunlight filtering through the leaves"
}
]
}| Field | Type | Description |
|---|---|---|
| created | integer | Unix timestamp |
| data | array | Array of generated results |
| data[].url | string | Image URL |
| data[].revised_prompt | string | The revised/optimized prompt used for generation |
Error Response
See Error Codes for details.
Best Practices
- Sync generation: Use
wan2.6-t2iwhen you need synchronous results — it is the only model that supports sync responses, eliminating the need to poll for task_id. - High quality: For the best image quality, choose
wan2.2-t2i-plusorwanx2.1-t2i-plus, which excel in detail and composition. - Fast generation: For speed and low cost, choose
wan2.2-t2i-flashorwanx2.1-t2i-turbo, ideal for rapid iteration. - Batch generation: All models support generating 1–4 images per request (
ndefaults to 4), useful for quick comparison and design selection. - Negative prompts: Use
negative_promptto exclude unwanted elements, e.g.negative_prompt: "blurry, low quality, deformed". - Prompt extension:
wan2.6-t2ihasprompt_extendenabled by default (true), which automatically enhances your prompt. Set tofalsefor precise control. - Size selection: Choose the right size for your use case — 9:16 for social media stories, 16:9 for banners, 1:1 for general purpose.
- Async model note: The wan2.2 and wanx2.1 series return asynchronously. You need to poll by task_id to retrieve results.
Rate Limits
See Rate Limits for details.
Related Documentation
- Wanxiang 2.7 - Tongyi Wanxiang video generation model
- Qwen-Image - Qwen image generation model
- Z-Image Turbo - High-speed image generation model
- Model List & Pricing - Browse available models and pricing
- Playground - Test image generation interactively