Wan 2.5 Video Generation
Video Series
Wan 2.5 Video Generation
Alibaba Wan 2.5 text-to-video and image-to-video
POST
Wan 2.5 Video Generation
Introduction
Wan 2.5 is Alibaba Cloud Bailianâs video generation family, consisting of text-to-video (wan2.5-t2v-preview) and image-to-video (wan2.5-i2v-preview). It supports 480P, 720P, and 1080P output.
Use GravitexAIâs unified video API: submit a task to get a task id, then query the task to poll status and get the video URL.
Wan 2.5 recommends passing underlying DashScope parameters via
metadata.input and metadata.parameters. Top-level fields like prompt and duration are for compatibility; metadata.parameters takes precedence.Authentication
string
required
Bearer Token, e.g.
Bearer sk-xxxxxxxxxxSupported models
Call flow
- Submit:
POST /v1/video/generationswithmodel,prompt, and Wan parameters inmetadata. - Poll:
GET /llm-api/v1/video/generations/{id}(hostmaas.gravitex.ai) every 3â15 seconds untildata.statusiscompletedorfailed. - Result: On success, get the video URL from
data.url,data.video_url, ordata.metadata.output.video_url(typically a temporary linkâdownload promptly).
Request structure
Submit response
The submit endpoint returns an OpenAI Video-style object; useid as the task ID for subsequent queries:
Query response
The query endpoint returns a wrapped structure;data.status of completed indicates success:
Use cases
- Text-to-video (T2V)
- Image-to-video (I2V)
Generate video from text prompts with smart prompt rewriting and custom resolution/aspect ratio.Text-to-video example:
string
required
Text prompt; keep in sync with top-level
promptstring
default:"720P"
480P, 720P, or 1080Pstring
default:"16:9"
Aspect ratio:
16:9, 9:16, 1:1, 4:3, 3:4integer
default:"5"
Video duration in seconds; common values: 3, 5, 10
boolean
default:"true"
Enable smart prompt rewriting
boolean
default:"false"
Add watermark
integer
Random seed, range
[0, 2147483647]Parameter reference
metadata.parameters
metadata.input
Query response key fields
Status mapping
Error handling
On failure,
data.status is failed; check data.metadata.output.task_status for details.
FAQ
Top-level duration vs metadata.parameters.duration?
Top-level duration vs metadata.parameters.duration?
metadata.parameters.duration wins. For production, either omit top-level duration or keep both values identical.How many times should I send prompt?
How many times should I send prompt?
Keep top-level
prompt and metadata.input.prompt in sync so orig_prompt in query results matches your request.How long is the video URL valid?
How long is the video URL valid?
video_url is typically a temporary OSS link. Download and store it promptly after success.How do I know the task succeeded?
How do I know the task succeeded?
Check in this order:
data.status == "completed"data.video_urlordata.urlis non-emptydata.metadata.output.task_status == "SUCCEEDED"
How is Wan 2.5 different from Wan 2.7?
How is Wan 2.5 different from Wan 2.7?
Wan 2.5 supports text-to-video and first-frame image-to-video only, using
metadata.input.img_url instead of 2.7âs media array. Wan 2.7 adds reference-to-video, continuation, first+last frame, and more. See Wan 2.7.Related APIs
Submit video task
Unified video task submission and multi-model parameters
Query video task
Poll task status and get video URL
