Skip to main content
Wan

Wan v2 — Generate an image

Async Wan image generation

POST
/services/aigc/image-generation/generation
curl --location 'https://dashscope-intl.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.6-t2i",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "text": "A flower shop with exquisite windows, a beautiful wooden door, and flowers on display"
          }
        ]
      }
    ]
  },
  "parameters": {
    "prompt_extend": true,
    "watermark": false,
    "n": 1,
    "negative_prompt": "",
    "size": "1280*1280"
  }
}'
{
  "request_id": "<string>",
  "output": {
    "task_id": "<string>",
    "task_status": "PENDING"
  }
}

Supported models

The Wan text-to-image family uses different endpoints and request formats by version:
ModelEndpointInput formatResolutionMax prompt length
wan2.6-t2i/services/aigc/image-generation/generationmessages array1280*1280 to 1440*1440, ratio 1:4 to 4:12,100 chars
wan2.5-t2i-preview/services/aigc/text2image/image-synthesisprompt string1280*1280 to 1440*1440, ratio 1:4 to 4:12,000 chars
wan2.2-t2i-plus/services/aigc/text2image/image-synthesisprompt string512–1440 per side, max 1440*1440500 chars
wan2.2-t2i-flash/services/aigc/text2image/image-synthesisprompt string512–1440 per side, max 1440*1440500 chars
wan2.1-t2i-plus/services/aigc/text2image/image-synthesisprompt string512–1440 per side, max 1440*1440500 chars
wan2.1-t2i-turbo/services/aigc/text2image/image-synthesisprompt string512–1440 per side, max 1440*1440500 chars
wanx2.0-t2i-turbo/services/aigc/text2image/image-synthesisprompt string512–1440 per side, max 1440*1440800 chars
wan2.6-t2i also supports a synchronous endpoint (single-request, immediate response).

SDK version requirements

  • wan2.6-t2i: DashScope Python SDK 1.25.7+, Java SDK 2.22.6+
  • wan2.5 and earlier: DashScope Python SDK 1.25.2+, Java SDK 2.22.2+

Authorizations

string
header
required

DashScope API Key. Create one in the Qwen Cloud console.

Header Parameters

enum<string>
required

Must be enable to create an asynchronous task.

enable

Body

application/json
object
enum<string>
required

The model name. For the wan2.6-t2i model, use wan2.6-t2i.

wan2.6-t2i
wan2.6-t2i
object
required

The input object containing the message array.

object

Parameters for wan2.6-t2i model.

Response

200-application/json
string

Unique request identifier for troubleshooting.

object