$npx -y skills add cinience/alicloud-skills --skill aliyun-vidu-videoUse when generating videos with DashScope Vidu models. Use when implementing text-to-video, image-to-video (first frame), keyframe-to-video (first+last frame), or reference-to-video generation via the video-synthesis async API.
| 1 | # Vidu Video Generation |
| 2 | |
| 3 | ## Validation |
| 4 | |
| 5 | ```bash |
| 6 | mkdir -p output/aliyun-vidu-video |
| 7 | python -m py_compile skills/ai/video/aliyun-vidu-video/scripts/generate_vidu_video.py && echo "py_compile_ok" > output/aliyun-vidu-video/validate.txt |
| 8 | ``` |
| 9 | |
| 10 | Pass criteria: command exits 0 and `output/aliyun-vidu-video/validate.txt` is generated. |
| 11 | |
| 12 | ## Output And Evidence |
| 13 | |
| 14 | - Save task IDs, polling responses, and final video URLs to `output/aliyun-vidu-video/`. |
| 15 | - Keep at least one end-to-end run log for troubleshooting. |
| 16 | |
| 17 | ## Prerequisites |
| 18 | |
| 19 | - Set `DASHSCOPE_API_KEY` in your environment (Beijing region key required). |
| 20 | - Region: China Mainland (Beijing) only. Model, Endpoint URL, and API Key must belong to the same region. |
| 21 | - Enable Vidu models in the Alibaba Cloud Model Studio console before first use. |
| 22 | |
| 23 | ## Critical model names |
| 24 | |
| 25 | ### Text-to-video |
| 26 | - `vidu/viduq3-pro_text2video` |
| 27 | - `vidu/viduq3-turbo_text2video` |
| 28 | - `vidu/viduq2_text2video` |
| 29 | |
| 30 | ### Image-to-video (first frame) |
| 31 | - `vidu/viduq3-pro_img2video` |
| 32 | - `vidu/viduq3-turbo_img2video` |
| 33 | - `vidu/viduq2-pro_img2video` |
| 34 | - `vidu/viduq2-turbo_img2video` |
| 35 | |
| 36 | ### Keyframe-to-video (first+last frame) |
| 37 | - `vidu/viduq3-pro_start-end2video` |
| 38 | - `vidu/viduq3-turbo_start-end2video` |
| 39 | - `vidu/viduq2-pro_start-end2video` |
| 40 | - `vidu/viduq2-turbo_start-end2video` |
| 41 | |
| 42 | ### Reference-to-video |
| 43 | - `vidu/viduq2_reference2video` |
| 44 | - `vidu/viduq2-pro_reference2video` |
| 45 | |
| 46 | ## Capabilities |
| 47 | |
| 48 | | Capability | Description | Model suffix | Required input | |
| 49 | |---|---|---|---| |
| 50 | | Text-to-video | Generate video from text prompt only | `_text2video` | `prompt` | |
| 51 | | Image-to-video | Generate video from a single image + optional prompt | `_img2video` | `media[image]` | |
| 52 | | Keyframe-to-video | Interpolate video between first and last frame images | `_start-end2video` | `media[image x2]` + `prompt` | |
| 53 | | Reference-to-video | Embed reference subject(s) into prompted scene | `_reference2video` | `media[image 1-7]` + `prompt` | |
| 54 | |
| 55 | ## API endpoint (async only) |
| 56 | |
| 57 | ``` |
| 58 | POST https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis |
| 59 | ``` |
| 60 | |
| 61 | Required headers: |
| 62 | - `Authorization: Bearer $DASHSCOPE_API_KEY` |
| 63 | - `Content-Type: application/json` |
| 64 | - `X-DashScope-Async: enable` |
| 65 | |
| 66 | ## Normalized interface |
| 67 | |
| 68 | ### Request |
| 69 | - `model` (string, required) -- one of the model names listed above |
| 70 | - `input.prompt` (string) -- up to 5000 characters, describes desired video content |
| 71 | - Required for text-to-video, keyframe, and reference modes |
| 72 | - Optional for image-to-video |
| 73 | - `input.media` (array) -- media objects with `type` and `url` fields (not used for text-to-video) |
| 74 | - `type`: `image` or `video` |
| 75 | - `url`: public URL (HTTP/HTTPS) |
| 76 | - `parameters.resolution` (string, optional) -- `540P`, `720P` (default), or `1080P` |
| 77 | - `parameters.size` (string, optional) -- pixel dimensions `width*height` (e.g., `1280*720`). Values depend on resolution tier. For text-to-video and reference-to-video, explicit size values are supported. |
| 78 | - `parameters.duration` (integer, optional) -- video length in seconds |
| 79 | - Q3 models: [1, 16], default 5 |
| 80 | - Q2 models: [1, 10], default 5 |
| 81 | - `parameters.audio` (boolean, optional) -- generate audio track (Q3 models only, default false) |
| 82 | - `parameters.watermark` (boolean, optional) -- add "AI generated" watermark (default false) |
| 83 | - `parameters.seed` (integer, optional) -- range [0, 2147483647] |
| 84 | |
| 85 | ### Size values by resolution tier (text-to-video) |
| 86 | |
| 87 | | Resolution | Aspect ratio | Size (width*height) | |
| 88 | |---|---|---| |
| 89 | | 540P | 16:9 | 960*528 | |
| 90 | | 540P | 9:16 | 528*960 | |
| 91 | | 540P | 1:1 | 720*720 | |
| 92 | | 540P | 4:3 | 816*608 | |
| 93 | | 540P | 3:4 | 608*816 | |
| 94 | | 720P | 16:9 | 1280*720 | |
| 95 | | 720P | 9:16 | 720*1280 | |
| 96 | | 720P | 1:1 | 960*960 | |
| 97 | | 720P | 4:3 | 1104*816 | |
| 98 | | 720P | 3:4 | 816*1104 | |
| 99 | | 1080P | 16:9 | 1920*1080 | |
| 100 | | 1080P | 9:16 | 1080*1920 | |
| 101 | | 1080P | 1:1 | 1440*1440 | |
| 102 | | 1080P | 4:3 | 1674*1238 | |
| 103 | | 1080P | 3:4 | 1238*1674 | |
| 104 | |
| 105 | ### Size values by resolution tier (reference-to-video) |
| 106 | |
| 107 | | Resolution | Aspect ratio | Size (width*height) | |
| 108 | |---|---|---| |
| 109 | | 540P | 16:9 | 960*540 | |
| 110 | | 540P | 9:16 | 540*960 | |
| 111 | | 540P | 1:1 | 540*540 | |
| 112 | | 540P | 4:3 | 720*540 | |
| 113 | | 540P | 3:4 | 540*720 | |
| 114 | | 720P | 16:9 | 1280*720 | |
| 115 | | 720P | 9:16 | 720*1280 | |
| 116 | | 720P | 1:1 | 720*720 | |
| 117 | | 720P | 4:3 | 960*720 | |
| 118 | | 720P | 3:4 | 720*960 | |
| 119 | | 1080P | 16:9 | 1920*1080 | |
| 120 | | 1080P | 9:16 | 1080*1920 | |
| 121 | | 1080P | 1:1 | 1080*1080 | |
| 122 | | 1080P | 4:3 | 1440*1080 | |
| 123 | | 1080P | 3:4 | 1080*1440 | |
| 124 | |
| 125 | ### Media input limits |
| 126 | |
| 127 | **Images** (type=image): |
| 128 | - Formats: JPG, PNG, WEBP |
| 129 | - Aspect ratio: 1:4 to 4:1 |
| 130 | - Max size: 50MB |
| 131 | |
| 132 | **Videos** (type=video, reference-to-video only): |
| 133 | - Formats: mp4, avi, mov |
| 134 | - Resolution: min 128x128 pixels |
| 135 | - Aspect ratio: 1:4 to 4:1 |
| 136 | - Duration: 1-5s |
| 137 | - Max size: 50MB |
| 138 | |
| 139 | ### Response (task creation) |
| 140 | - `output.task_id` (string) -- use for polling, valid 24 hours |
| 141 | - `output. |