alicloud-ai-video-wan-r2v

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Category: 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
    DASHSCOPE_API_KEY
    in your environment, or add
    dashscope_api_key
    to
    ~/.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

请求参数

  • prompt
    (string, required)
  • reference_video
    (string | bytes, required)
  • reference_image
    (string | bytes, optional)
  • duration
    (number, optional)
  • fps
    (number, optional)
  • size
    (string, optional)
  • seed
    (int, optional)
  • prompt
    (字符串,必填)
  • reference_video
    (字符串 | 字节,必填)
  • reference_image
    (字符串 | 字节,可选)
  • duration
    (数字,可选)
  • fps
    (数字,可选)
  • size
    (字符串,可选)
  • seed
    (整数,可选)

Response

响应参数

  • video_url
    (string)
  • task_id
    (string, when async)
  • request_id
    (string)
  • video_url
    (字符串)
  • task_id
    (字符串,异步请求时返回)
  • request_id
    (字符串)

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.
  • 生产环境流量优先使用异步提交。
  • 以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