aliyun-cosyvoice-voice…
Use when creating cloned voices with Alibaba Cloud Model Studio CosyVoice customization models, especially cosyvoice-v3.5-plus or…
Use when generating videos that fuse 1-9 reference images with DashScope HappyHorse 1.0 reference-to-video model (happyhorse-1.0-r2v). Use when implementing multi-subject reference-to-video synthesis where prompts cite the input images as character1..N via the video-synthesis
$ npx -y skills add cinience/alicloud-skills --skill aliyun-happyhorse-r2v --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/aliyun-happyhorse-r2vContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when generating videos that fuse 1-9 reference images with DashScope HappyHorse 1.0 reference-to-video model (happyhorse-1.0-r2v). Use when implementing multi-subject reference-to-video synthesis where prompts cite the input images as character1..N via the video-synthesis
name: aliyun-happyhorse-r2v description: Use when generating videos that fuse 1-9 reference images with DashScope HappyHorse 1.0 reference-to-video model (happyhorse-1.0-r2v). Use when implementing multi-subject reference-to-video synthesis where prompts cite the input images as character1..N via the video-synthesis async API.
mkdir -p output/aliyun-happyhorse-r2v python -m py_compile skills/ai/video/aliyun-happyhorse-r2v/scripts/r2v_happyhorse.py && echo "py_compile_ok" > output/aliyun-happyhorse-r2v/validate.txt
Pass criteria: command exits 0 and `output/aliyun-happyhorse-r2v/validate.txt` is generated.
python3 -m venv .venv . .venv/bin/activate python -m pip install requests
| Capability | Description | Required media | |---|---|---| | Reference-to-video | Generate a video by fusing multiple subject/object reference images, guided by a prompt that references them as `character1`, `character2`, ... in input order | 1-9 `reference_image` entries |
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
Required headers:
Singapore endpoint: replace `dashscope.aliyuncs.com` with `dashscope-intl.aliyuncs.com`.
Polling endpoint: `GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}` — recommended interval 15s.
**Reference image** (`type=reference_image`):
The first `reference_image` in the `media` array maps to `character1`, the second to `character2`, and so on up to `character9`. Reorder the array if you want a specific reference to bind to a specific `characterN`.
import os
import time
import requests
API_KEY = os.getenv("DASHSCOPE_API_KEY")
BASE_URL = "https://dashscope.aliyuncs.com/api/v1"
def create_r2v_task(req: dict) -> str:
"""Create a reference-to-video task and return task_id."""
refs = req["reference_images"]
if not 1 <= len(refs) <= 9:
raise ValueError("Need 1-9 reference images")
payload = {
"model": "happyhorse-1.0-r2v",
"input": {
"prompt": req["prompt"],
"media": [{"type": "reference_image", "url": u} for u in refs],
},
"parameters": {
"resolution": req.get("resolution", "1080P"),
"ratio": req.get("ratio", "16:9"),
"duration": req.get("duration", 5),
"watermark": req.get("watermark", True),
},
}
if req.get("seed") is not None:
payload["parameters"]["seed"] = req["seed"]
resp = requests.post(
f"{BASE_URL}/services/aigc/video-generation/video-synthesis",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
"X-DashScope-Async": "enable",
},
json=payload,
)
resp.raise_for_status()
return resp.json()["output"]["task_id"]
def poll_task(task_id: str, interval: int = 15) -> dict:
while True:
resp = requests.get(
f"{BASE_URL}/tasks/{task_id}",
headers={"Authorization": f"Bearer {API_KEY}"},
)
resp.raise_for_status()
data = resp.json()
if data["output"]["task_status"] in ("SUCCEEDED", "FAILED", "CANCELED"):
return data
time.sleep(interval)# Single subject — character1 references the only image
task_id = create_r2v_task({
"reference_images": ["https://example.com/girl.jpg"],
"prompt": "character1 walkUse when creating cloned voices with Alibaba Cloud Model Studio CosyVoice customization models, especially cosyvoice-v3.5-plus or…
Use when designing custom voices with Alibaba Cloud Model Studio CosyVoice customization models, especially cosyvoice-v3.5-plus…
Use when low-latency realtime speech recognition is needed with Alibaba Cloud Model Studio Qwen ASR Realtime models, including…
Use when transcribing non-realtime speech with Alibaba Cloud Model Studio Qwen ASR models (`qwen3-asr-flash`, `qwen-audio-asr`,…
Use when live speech translation is needed with Alibaba Cloud Model Studio Qwen LiveTranslate models, including bilingual…
Use when real-time speech synthesis is needed with Alibaba Cloud Model Studio Qwen TTS Realtime models. Use when low-latency…