Wan Reference to Video
Submit an asynchronous Ali wan2.7-r2v reference-to-video generation task.
This capability uses the top-level media array as the public multimodal input. Supported media.type values are reference_image, reference_video, and first_frame.
Current public rules:
promptis required;- include at least one
reference_imageorreference_videoitem; - you may provide at most five
reference_image/reference_videoitems in total; first_frameis optional and can appear at most once;sizesupports only720Pand1080P;ratiosupports16:9,9:16,1:1,4:3, and3:4;secondsaccepts integer strings from2to15, but when anyreference_videois included the allowed range is2to10.
Prompt referencing follows the submitted media order. Refer to image references as Image 1, Image 2, and to video references as Video 1, Video 2, counting separately within each media type. If only one reference image or video is provided, you can simply use “reference image” or “reference video” in the prompt.
Authorizations
Pass Authorization: Bearer <token> in the request header.
Body
Ali wan2.7-r2v model. Available value: wan2.7-r2v.
wan2.7-r2v Text prompt describing the desired video content and visual characteristics. Supports Chinese and English; each character, letter, or punctuation mark counts as one character. Excess characters are automatically truncated.
wan2.7-r2v: up to 5000 characters.
Reference naming conventions:
- For Chinese prompts, reference images with markers like "图1", "图2" and reference videos with markers like "视频1", "视频2".
- For English prompts, use markers like "Image 1", "Video 1" (capitalized first letter, space between letter and number).
- The order matches the
mediaarray order. Images and videos are counted separately, e.g. "图1" and "视频1" can exist simultaneously. - If only one reference image or video is provided, you can simply use "reference image" or "reference video".
Scene description examples:
- Direct reference: "图1 in 图2" (Image 1 is playing in Image 2).
- Combined description: "The cat from Image 1 plays in the room from Image 2".
Multi-panel/storyboard images: When the reference image is a multi-panel (storyboard) image, describe the content in a multi-shot narrative format. You do not need to describe every panel; provide key shot content and the model will automatically identify the panel logic and intelligently fill in the details. For best results, it is recommended to provide only one multi-panel image per request.
Array of media assets, including images, videos, and audio. Supports image/video input as visual reference, and images can provide multi-view references for characters, props, scenes, etc.
Each element in the array is a media object containing type and url fields.
The order in the array defines the reference mapping order in the prompt. Images and videos are counted separately, so "Image 1" and "Video 1" can exist simultaneously.
- The 1st
reference_videoin the array corresponds to "Video 1", the 2nd to "Video 2", etc. - The 1st
reference_imagein the array corresponds to "Image 1", the 2nd to "Image 2", etc.
Important: size directly affects cost. Confirm the model pricing before calling.
Output video resolution tier, controlling video clarity (total pixels).
wan2.7-r2v: available values 720P, 1080P. Default: 1080P.
720P, 1080P Important: seconds directly affects cost. Confirm the model pricing before calling.
Video duration in seconds.
wan2.7-r2v: default5.- When reference assets include a video: range [2, 10].
- When reference assets do not include a video: range [2, 15].
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 Video aspect ratio.
Behavior logic:
- If no first frame image is provided: generates video at the specified
ratio. - If a first frame image is provided: the
ratioparameter is ignored and the video is generated at an approximate ratio matching the first frame image's aspect ratio.
Available values and corresponding output resolutions:
720P:
16:9→ 1280×7209:16→ 720×12801:1→ 960×9604:3→ 1104×8323:4→ 832×1104
1080P:
16:9→ 1920×10809:16→ 1080×19201:1→ 1440×14404:3→ 1648×12483:4→ 1248×1648
16:9, 9:16, 1:1, 4:3, 3:4 Negative prompt describing content you do not want to see in the video. Limits unwanted visual elements. Supports Chinese and English, up to 500 characters.
Example: low resolution, error, worst quality, low quality, deformed, extra fingers, bad proportions, etc.
Whether to enable intelligent prompt rewriting. When enabled, a large language model rewrites the input prompt for better results. Particularly effective for short prompts, but increases processing time.
true(default): enable intelligent rewriting.false: disable intelligent rewriting.
Whether to add a watermark to the video. The watermark is positioned at the bottom-right corner with the text 'AI生成'.
false(default): no watermark.true: add watermark.
Random seed, range [0, 2147483647]. If not specified, the system automatically generates a random seed. To improve reproducibility of generation results, it is recommended to fix the seed value.
Note: Due to the probabilistic nature of model generation, the same seed does not guarantee identical results every time.
0 <= x <= 2147483647Response
Submission successful. Returns the unified OpenAI-style video task object.
Public task ID.
Public task ID alias.
"video"
Model name.
Unified video task status.
queued, in_progress, completed, failed, unknown Task progress percentage.
Unix timestamp in seconds.