
Aliyun Wan R2v
- 52 installs
- 396 repo stars
- Updated July 18, 2026
- cinience/alicloud-skills
Generates reference-based multi-shot videos from reference video or image material with Alibaba Cloud Model Studio Wan R2V models.
About
This skill builds reference-to-video requests for Model Studio Wan R2V models, preserving character or style from reference media. A developer uses it to produce multi-shot videos anchored to reference input, distinct from single-image i2v.
- Models wan2.6-r2v-flash and wan2.6-r2v, flash favored for lower latency
- Async submission with reference_video required and optional reference_image
Aliyun Wan R2v by the numbers
- 52 all-time installs (skills.sh)
- Ranked #884 of 1,335 Generative Media skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cinience/alicloud-skills --skill aliyun-wan-r2vAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 52 |
|---|---|
| repo stars | ★ 396 |
| Last updated | July 18, 2026 |
| Repository | cinience/alicloud-skills ↗ |
What it does
Generates reference-based multi-shot videos from reference video or image material with Alibaba Cloud Model Studio Wan R2V models.
Files
Category: provider
Model Studio Wan R2V
Validation
mkdir -p output/aliyun-wan-r2v
python -m py_compile skills/ai/video/aliyun-wan-r2v/scripts/prepare_r2v_request.py && echo "py_compile_ok" > output/aliyun-wan-r2v/validate.txtPass 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:
wan2.6-r2v-flashwan2.6-r2v
Newer official releases may prefer the flash variant for lower latency and lower cost.
Prerequisites
- Install SDK in a virtual environment:
python3 -m venv .venv
. .venv/bin/activate
python -m pip install dashscope- Set
DASHSCOPE_API_KEYin your environment, or adddashscope_api_keyto~/.alibabacloud/credentials.
Normalized interface (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)
Response
video_url(string)task_id(string, when async)request_id(string)
Async handling
- Prefer async submission for production traffic.
- Poll task result with 15-20s intervals.
- Stop polling when
SUCCEEDEDor terminal failure status is returned.
Local helper script
Prepare a normalized request JSON and validate response schema:
.venv/bin/python skills/ai/video/aliyun-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/aliyun-wan-r2v/videos/ - 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
references/sources.md
interface:
display_name: "Alibaba Cloud AI Video Wan R2V"
short_description: "Wan reference-to-video workflows"
default_prompt: "Use $aliyun-wan-r2v to complete this ai/video reference-based generation task on Alibaba Cloud."
- https://help.aliyun.com/zh/model-studio/wan-video-to-video-api-reference
- https://help.aliyun.com/zh/model-studio/newly-released-models
- https://help.aliyun.com/zh/model-studio/reference-to-video
- https://help.aliyun.com/zh/model-studio/models
#!/usr/bin/env python3
"""Prepare and validate normalized request/response for Wan R2V."""
from __future__ import annotations
import argparse
import json
import sys
from pathlib import Path
def _load_json(path: str) -> dict:
return json.loads(Path(path).read_text(encoding="utf-8"))
def main() -> None:
parser = argparse.ArgumentParser(description="Prepare video.generate_reference request and validate response shape")
parser.add_argument("--prompt", required=True)
parser.add_argument("--reference-video", required=True)
parser.add_argument("--reference-image")
parser.add_argument("--duration", type=float)
parser.add_argument("--fps", type=float)
parser.add_argument("--size")
parser.add_argument("--seed", type=int)
parser.add_argument("--output", default="output/ai-video-wan-r2v/request.json")
parser.add_argument("--validate-response", help="Path to JSON response file")
args = parser.parse_args()
req = {
"prompt": args.prompt,
"reference_video": args.reference_video,
}
if args.reference_image:
req["reference_image"] = args.reference_image
if args.duration is not None:
req["duration"] = args.duration
if args.fps is not None:
req["fps"] = args.fps
if args.size:
req["size"] = args.size
if args.seed is not None:
req["seed"] = args.seed
out = Path(args.output)
out.parent.mkdir(parents=True, exist_ok=True)
out.write_text(json.dumps(req, ensure_ascii=False, indent=2), encoding="utf-8")
result = {"ok": True, "request_path": str(out)}
if args.validate_response:
resp = _load_json(args.validate_response)
if "video_url" not in resp and "task_id" not in resp:
print(json.dumps({"ok": False, "error": "missing video_url and task_id"}, ensure_ascii=False))
sys.exit(1)
result["response_valid"] = True
print(json.dumps(result, ensure_ascii=False))
if __name__ == "__main__":
main()