alicloud-ai-video-wan-r2v
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCategory: provider
分类:供应商
Model Studio Wan R2V
Model Studio Wan R2V
Use Wan R2V for reference-to-video generation. This is different from i2v (single image to video).
使用Wan R2V进行参考转视频生成。这与i2v(单图转视频)不同。
Critical model name
关键模型名称
Use ONLY this exact model string:
wan2.6-r2v-flash
请仅使用以下精确的模型字符串:
wan2.6-r2v-flash
Prerequisites
前置条件
- Install SDK in a virtual environment:
bash
python3 -m venv .venv
. .venv/bin/activate
python -m pip install dashscope- Set in your environment, or add
DASHSCOPE_API_KEYtodashscope_api_key.~/.alibabacloud/credentials
- 在虚拟环境中安装SDK:
bash
python3 -m venv .venv
. .venv/bin/activate
python -m pip install dashscope- 在环境变量中设置,或者在
DASHSCOPE_API_KEY中添加~/.alibabacloud/credentials。dashscope_api_key
Normalized interface (video.generate_reference)
标准化接口(video.generate_reference)
Request
请求参数
- (string, required)
prompt - (string | bytes, required)
reference_video - (string | bytes, optional)
reference_image - (number, optional)
duration - (number, optional)
fps - (string, optional)
size - (int, optional)
seed
- (字符串,必填)
prompt - (字符串 | 字节,必填)
reference_video - (字符串 | 字节,可选)
reference_image - (数字,可选)
duration - (数字,可选)
fps - (字符串,可选)
size - (整数,可选)
seed
Response
响应参数
- (string)
video_url - (string, when async)
task_id - (string)
request_id
- (字符串)
video_url - (字符串,异步请求时返回)
task_id - (字符串)
request_id
Async handling
异步处理
- Prefer async submission for production traffic.
- Poll task result with 15-20s intervals.
- Stop polling when or terminal failure status is returned.
SUCCEEDED
- 生产环境流量优先使用异步提交。
- 以15-20秒的间隔轮询任务结果。
- 当返回或终端失败状态时停止轮询。
SUCCEEDED
Local helper script
本地辅助脚本
Prepare a normalized request JSON and validate response schema:
bash
.venv/bin/python skills/ai/video/alicloud-ai-video-wan-r2v/scripts/prepare_r2v_request.py \
--prompt "Generate a short montage with consistent character style" \
--reference-video "https://example.com/reference.mp4"准备标准化的请求JSON并验证响应 schema:
bash
.venv/bin/python skills/ai/video/alicloud-ai-video-wan-r2v/scripts/prepare_r2v_request.py \
--prompt "Generate a short montage with consistent character style" \
--reference-video "https://example.com/reference.mp4"Output location
输出位置
- Default output:
output/ai-video-wan-r2v/videos/ - Override base dir with .
OUTPUT_DIR
- 默认输出路径:
output/ai-video-wan-r2v/videos/ - 可通过覆盖基础目录。
OUTPUT_DIR
References
参考资料
references/sources.md
references/sources.md