Category: provider
Model Studio Wan R2V
Validation
CODEBLOCK0
Pass criteria: command exits 0 and output/aliyun-wan-r2v/validate.txt is generated.
Output And Evidence
- - Save reference input metadata, request payloads, and task outputs in
output/aliyun-wan-r2v/. - Keep at least one polling result snapshot.
Use Wan R2V for reference-to-video generation. This is different from i2v (single image to video).
Critical model names
Use one of these exact model strings:
Newer official releases may prefer the flash variant for lower latency and lower cost.
Prerequisites
- - Install SDK in a virtual environment:
CODEBLOCK1
- - Set
DASHSCOPE_API_KEY in your environment, or add dashscope_api_key to ~/.alibabacloud/credentials.
Normalized interface (video.generate_reference)
Request
- -
prompt (string, required) - INLINECODE8 (string | bytes, required)
- INLINECODE9 (string | bytes, optional)
- INLINECODE10 (number, optional)
- INLINECODE11 (number, optional)
- INLINECODE12 (string, optional)
- INLINECODE13 (int, optional)
Response
- -
video_url (string) - INLINECODE15 (string, when async)
- INLINECODE16 (string)
Async handling
- - Prefer async submission for production traffic.
- Poll task result with 15-20s intervals.
- Stop polling when
SUCCEEDED or terminal failure status is returned.
Local helper script
Prepare a normalized request JSON and validate response schema:
CODEBLOCK2
Output location
- - Default output: INLINECODE18
- Override base dir with
OUTPUT_DIR.
Workflow
1) Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.
2) Run one minimal read-only query first to verify connectivity and permissions.
3) Execute the target operation with explicit parameters and bounded scope.
4) Verify results and save output/evidence files.
References
技能名称: aliyun-wan-r2v
详细描述:
分类: provider
Model Studio Wan R2V
验证
bash
mkdir -p output/aliyun-wan-r2v
python -m pycompile skills/ai/video/aliyun-wan-r2v/scripts/preparer2vrequest.py && echo pycompile_ok > output/aliyun-wan-r2v/validate.txt
通过标准:命令退出码为0,且成功生成 output/aliyun-wan-r2v/validate.txt 文件。
输出与证据
- - 将参考输入元数据、请求负载和任务输出保存至 output/aliyun-wan-r2v/ 目录。
- 至少保留一次轮询结果快照。
使用 Wan R2V 进行参考视频生成。这与 i2v(单图生成视频)不同。
关键模型名称
请使用以下精确模型字符串之一:
- - wan2.6-r2v-flash
- wan2.6-r2v
较新的官方版本可能更倾向于使用 flash 变体,以降低延迟和成本。
前提条件
bash
python3 -m venv .venv
. .venv/bin/activate
python -m pip install dashscope
- - 在环境中设置 DASHSCOPEAPIKEY,或将 dashscopeapikey 添加到 ~/.alibabacloud/credentials 文件中。
标准化接口(video.generate_reference)
请求参数
- - prompt(字符串,必填)
- referencevideo(字符串或字节,必填)
- referenceimage(字符串或字节,可选)
- duration(数字,可选)
- fps(数字,可选)
- size(字符串,可选)
- seed(整数,可选)
响应参数
- - videourl(字符串)
- taskid(字符串,异步时返回)
- request_id(字符串)
异步处理
- - 生产环境流量建议使用异步提交。
- 以15-20秒间隔轮询任务结果。
- 当返回 SUCCEEDED 或终端失败状态时停止轮询。
本地辅助脚本
准备标准化的请求 JSON 并验证响应模式:
bash
.venv/bin/python skills/ai/video/aliyun-wan-r2v/scripts/preparer2vrequest.py \
--prompt 生成一个角色风格一致的短蒙太奇 \
--reference-video https://example.com/reference.mp4
输出位置
- - 默认输出:output/aliyun-wan-r2v/videos/
- 可通过 OUTPUT_DIR 覆盖基础目录。
工作流程
1) 确认用户意图、区域、标识符,以及操作是只读还是修改型。
2) 首先执行一次最小化的只读查询,以验证连接和权限。
3) 使用明确的参数和限定范围执行目标操作。
4) 验证结果并保存输出/证据文件。
参考资料