Skip to main content
POST
/
vendors
/
alibaba
/
v1
/
wan2.6-t2i
/
generation
Create Generation Task
curl --request POST \
  --url https://api.mulerouter.ai/vendors/alibaba/v1/wan2.6-t2i/generation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "negative_prompt": "<string>",
  "size": "1280*1280",
  "n": 4,
  "prompt_extend": false,
  "seed": 1073741823
}
'
{
  "task_info": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "status": "pending",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}
This API is compatible with Alibaba’s Tongyi Wanxiang (Wan2) models. Please refer to Alibaba Cloud’s official documentation for more details.

Overview

Generate high-quality images from text descriptions using the wan2.6-t2i model. This is the latest Wan2.6 text-to-image model.

Resolution Guidelines

  • Default: 1280*1280
  • Total pixels: Between 768*768 and 1440*1440
  • Aspect ratio: Between 1:4 and 4:1

Common Aspect Ratios

Aspect RatioRecommended Resolution
1:11280*1280 or 1024*1024
2:3800*1200
3:21200*800
3:4960*1280
4:31280*960
9:16720*1280
16:91280*720

Example Requests

Basic Text-to-Image

{
  "prompt": "A small cat running in the moonlight",
  "n": 1
}

With Negative Prompt

{
  "prompt": "A serene mountain landscape at sunset, dramatic clouds, vibrant colors",
  "negative_prompt": "low resolution, error, worst quality, low quality",
  "size": "1280*720",
  "n": 4
}

With Custom Seed

{
  "prompt": "Futuristic cityscape at night, neon lights, cyberpunk style",
  "size": "1280*720",
  "n": 1,
  "seed": 12345
}

Parameters

n (Number of Images)

  • Range: 1-4
  • Default: 4
  • Note: Directly affects cost

prompt_extend (Prompt Rewriting)

  • Default: false
  • Effect: Uses AI to enhance and expand short prompts

seed (Random Seed)

  • Range: 0 to 2,147,483,647
  • Purpose: Improves reproducibility of results

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
prompt
string
required

Text description for the image (max 2000 characters).

Maximum string length: 2000
negative_prompt
string

Negative prompt describing unwanted content (max 500 characters)

Maximum string length: 500
size
string
default:1280*1280

Image resolution in format "width*height" (e.g., "1280*1280")

Default: 1280*1280 Total pixels: [768*768, 1440*1440], aspect ratio: [1:4, 4:1]

n
integer
default:4

Number of images to generate (1-4)

Required range: 1 <= x <= 4
prompt_extend
boolean
default:false

Enable intelligent prompt rewriting (improves short prompts but increases processing time)

seed
integer

Random seed for reproducibility [0, 2147483647]

Required range: 0 <= x <= 2147483647

Response

202 - application/json

Accepted - Task created successfully

task_info
object