Skip to main content
POST
/
generate
/
bailian
/
wan2-text-to-image
Tongyi Wanxiang Wan2 Text-to-Image
curl --request POST \
  --url https://api.sinancode.com/v1/generate/bailian/wan2-text-to-image \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "model": "wan2.5-t2i-preview",
  "negative_prompt": "<string>",
  "seed": 1073741823,
  "size": "<string>"
}
'
{
  "task_id": "01234567-89ab-cdef-0123-456789abcdef"
}
Generate images from text using Alibaba Cloud’s Tongyi Wanxiang Wan2 series models. Key Features:
  • Multiple Model Options - Support wan2.5-t2i-preview/wan2.2-t2i-flash/wan2.2-t2i-plus
  • Native Multimodal - Single architecture supporting text and image modality input/output
  • Native Chinese - Industry-leading Chinese understanding, use Chinese prompts directly
  • Complex Instruction Understanding - Support camera movements and complex continuous instructions

Authorizations

Authorization
string
header
required

Please use your API Token for authentication

Body

application/json

Task parameters

prompt
string
required

Positive prompt (required, max 2000 characters)

Required string length: 1 - 2000
model
enum<string>

Model selection (optional, default wan2.5-t2i-preview) Available: wan2.5-t2i-preview, wan2.2-t2i-flash, wan2.2-t2i-plus

Available options:
wan2.5-t2i-preview,
wan2.2-t2i-flash,
wan2.2-t2i-plus
negative_prompt
string

Negative prompt (optional, max 500 characters)

Maximum string length: 500
seed
integer

Random seed (optional, range 0-2147483647)

Required range: 0 <= x <= 2147483647
size
string

Image size (optional, default 12801280) wan2.5-t2i-preview: total pixels [768768, 1440*1440], aspect ratio [1:4, 4:1] wan2.2 and below: width/height [512, 1440]

Response

OK

task_id
string
required

Task ID

Example:

"01234567-89ab-cdef-0123-456789abcdef"