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 from a single first-frame image with DashScope HappyHorse 1.0 image-to-video model (happyhorse-1.0-i2v). Use when implementing first-frame video generation with optional text guidance via the video-synthesis async API on Alibaba Cloud Model Studio.
$ npx -y skills add cinience/alicloud-skills --skill aliyun-happyhorse-i2v --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/aliyun-happyhorse-i2vContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when generating videos from a single first-frame image with DashScope HappyHorse 1.0 image-to-video model (happyhorse-1.0-i2v). Use when implementing first-frame video generation with optional text guidance via the video-synthesis async API on Alibaba Cloud Model Studio.
name: aliyun-happyhorse-i2v description: Use when generating videos from a single first-frame image with DashScope HappyHorse 1.0 image-to-video model (happyhorse-1.0-i2v). Use when implementing first-frame video generation with optional text guidance via the video-synthesis async API on Alibaba Cloud Model Studio.
mkdir -p output/aliyun-happyhorse-i2v python -m py_compile skills/ai/video/aliyun-happyhorse-i2v/scripts/i2v_happyhorse.py && echo "py_compile_ok" > output/aliyun-happyhorse-i2v/validate.txt
Pass criteria: command exits 0 and `output/aliyun-happyhorse-i2v/validate.txt` is generated.
python3 -m venv .venv . .venv/bin/activate python -m pip install requests
| Capability | Description | Required media | |---|---|---| | First-frame video | Generate a video from one first-frame image, optionally guided by a text prompt | `first_frame` (exactly 1) |
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.
The output video aspect ratio follows the input first-frame image; **`ratio` is not supported** for i2v.
**First-frame image** (`type=first_frame`):
import os
import time
import requests
API_KEY = os.getenv("DASHSCOPE_API_KEY")
BASE_URL = "https://dashscope.aliyuncs.com/api/v1"
def create_i2v_task(req: dict) -> str:
"""Create an image-to-video task and return task_id."""
payload = {
"model": "happyhorse-1.0-i2v",
"input": {
"prompt": req.get("prompt", ""),
"media": [{"type": "first_frame", "url": req["first_frame_url"]}],
},
"parameters": {
"resolution": req.get("resolution", "1080P"),
"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)# Minimal — first-frame only
task_id = create_i2v_task({
"first_frame_url": "https://cdn.translate.alibaba.com/r/wanx-demo-1.png",
"prompt": "一只猫在草地上奔跑",
"duration": 5,
})
# 720P with custom seed for reproducibility
task_id = create_i2v_task({
"first_frame_url": "https://example.com/portrait.jpg",
"prompt": "Slow head turn, soft window light",
"resolution": "720P",
"duration": 8,
"seed": 42,
})| Error | Likely cause | Action | |---|---|---| | 401 / `InvalidApiKey` | Missing or invalid `DASHSCOPE_API_KEY` | Check env var or credentials file | | 400 `InvalidParameter` | Wrong resolution, duration out of [3,15], image too small or wrong format | Validate parameters and image | | `current user api does not support synchronous calls` | Missing `X-DashScope-Async: enable
Use 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…