Skip to content

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.

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

ItemValue
MethodPOST
Path/v1/images/generations
Base URLhttps://open.dieyuyun.com
ProtocolOpenAI Images API

Authentication

Bearer Token: Authorization: Bearer YOUR_API_KEY

Supported Models

ModelCategoryFeaturesMax ResolutionSync
wan2.6-t2i2.6 LatestLatest protocol, sync+async, supports prompt_extend1440²Yes
wan2.2-t2i-plus2.2 High-QualHigh quality legacy, each side [512, 1440]1440²No (async)
wan2.2-t2i-flash2.2 FastFast legacy, high speed and low cost1440²No (async)
wanx2.1-t2i-turbo2.1 Fast2.1 fast variant1440²No (async)
wanx2.1-t2i-plus2.1 High-Qual2.1 high quality variant1440²No (async)

Model Comparison

Featurewan2.6-t2iwan2.2-t2i-pluswan2.2-t2i-flashwanx2.1-t2i-turbowanx2.1-t2i-plus
Sync ResponseYesNoNoNoNo
prompt_extendYesNoNoNoNo
watermarkYesNoNoNoNo
negative_promptYesYesYesYesYes
Batch Gen (n)1–41–41–41–41–4
Max Resolution1440²1440²1440²1440²1440²

Standard Request Fields

Common to All Models

FieldTypeRequiredDefaultDescription
modelstringYesModel identifier. See Supported Models
promptstringYesImage description text
sizestringNoSee size tablesImage size. Supported sizes vary by model
nintegerNo4Number of images to generate, range 1–4
response_formatstringNourlResponse format: url or b64_json
negative_promptstringNoNegative prompt describing unwanted content
seedintegerNoRandom seed for reproducible results

Supported Sizes

wan2.6-t2i

Total pixel range: [1280², 1440²]

SizeAspect RatioDescription
1280x12801:1Square
1696x96016:9Widescreen
960x16969:16Full-screen tall
1472x11044:3Landscape
1104x14723:4Portrait

wan2.2 / wanx2.1 Series

Each side range: [512, 1440]

SizeAspect RatioDescription
1024x10241:1Square
1440x14401:1Square HD
1280x72016:9Widescreen
720x12809:16Full-screen tall
1024x1440~3:4Portrait
1440x1024~4:3Landscape
768x11522:3Portrait
1152x7683:2Landscape
960x12803:4Portrait
1280x9604:3Landscape
512x10241:2Narrow portrait
1024x5122:1Wide landscape

Extended Parameters

wan2.6-t2i Only

FieldTypeRequiredDefaultDescription
prompt_extendbooleanNotrueWhether to automatically extend the prompt for better results
watermarkbooleanNofalseWhether 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)

FieldTypeDescription
negative_promptstringNegative prompt describing unwanted content
seedintegerRandom 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"
    }
  ]
}
FieldTypeDescription
createdintegerUnix timestamp
dataarrayArray of generated results
data[].urlstringImage URL
data[].revised_promptstringThe revised/optimized prompt used for generation

Error Response

See Error Codes for details.

Best Practices

  • Sync generation: Use wan2.6-t2i when 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-plus or wanx2.1-t2i-plus, which excel in detail and composition.
  • Fast generation: For speed and low cost, choose wan2.2-t2i-flash or wanx2.1-t2i-turbo, ideal for rapid iteration.
  • Batch generation: All models support generating 1–4 images per request (n defaults to 4), useful for quick comparison and design selection.
  • Negative prompts: Use negative_prompt to exclude unwanted elements, e.g. negative_prompt: "blurry, low quality, deformed".
  • Prompt extension: wan2.6-t2i has prompt_extend enabled by default (true), which automatically enhances your prompt. Set to false for 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.