Wan 2.2 Animate Move (Image-to-Motion)
Validation
mkdir -p output/aliyun-wan-animate-move
python -m py_compile skills/ai/video/aliyun-wan-animate-move/scripts/generate_animate_move.py && echo "py_compile_ok" > output/aliyun-wan-animate-move/validate.txt
Pass criteria: command exits 0 and output/aliyun-wan-animate-move/validate.txt is generated.
Output And Evidence
- Save task IDs, polling responses, and final video URLs to
output/aliyun-wan-animate-move/.
- Keep at least one end-to-end run log for troubleshooting.
Prerequisites
- Install SDK (recommended in a venv):
python3 -m venv .venv
. .venv/bin/activate
python -m pip install requests
- Set
DASHSCOPE_API_KEY in your environment, or add dashscope_api_key to ~/.alibabacloud/credentials.
Critical model names
wan2.2-animate-move -- supports motion transfer from reference video to character image
Capabilities
| Capability |
Description |
Required inputs |
| Motion transfer |
Transfer actions/expressions from reference video to character image |
image_url + video_url |
Service modes
| Mode |
Description |
wan-std |
Standard mode, faster generation, cost-effective, suitable for preview and basic animation |
wan-pro |
Professional mode, smoother animation, better quality, longer processing time |
API endpoint (async only)
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/image2video/video-synthesis
Required headers:
Authorization: Bearer $DASHSCOPE_API_KEY
Content-Type: application/json
X-DashScope-Async: enable
Singapore endpoint: replace dashscope.aliyuncs.com with dashscope-intl.aliyuncs.com.
Normalized interface
Request
image_url (string, required) -- public HTTP/HTTPS URL of the character image
video_url (string, required) -- public HTTP/HTTPS URL of the reference motion video
watermark (boolean, optional) -- add watermark (default: false)
mode (string, required) -- wan-std or wan-pro
check_image (boolean, optional) -- whether to perform image detection (default: true)
Image input limits
- Formats: JPG, JPEG, PNG, BMP, WEBP
- Resolution: [200, 4096] pixels per side
- Aspect ratio: 1:3 to 3:1
- Max size: 5MB
- Content: single person, facing camera, face fully visible, moderate proportion in frame
Video input limits
- Formats: MP4, AVI, MOV
- Duration: 2-30s
- Resolution: [200, 2048] pixels per side
- Aspect ratio: 1:3 to 3:1
- Max size: 200MB
- Content: single person, facing camera, face fully visible, moderate proportion in frame
Response (task creation)
output.task_id (string) -- use for polling, valid 24 hours
output.task_status (string) -- PENDING | RUNNING | SUCCEEDED | FAILED | CANCELED | UNKNOWN
request_id (string)
Response (task result)
output.video_url (string) -- generated video URL
usage.video_count (integer)
usage.video_duration (integer) -- duration in seconds
Quick start (Python + HTTP)
import os
import json
import time
import requests
API_KEY = os.getenv("DASHSCOPE_API_KEY")
BASE_URL = "https://dashscope.aliyuncs.com/api/v1"
def create_animate_move_task(image_url: str, video_url: str, mode: str = "wan-std") -> str:
"""Create an animate-move task and return task_id."""
payload = {
"model": "wan2.2-animate-move",
"input": {
"image_url": image_url,
"video_url": video_url,
"watermark": False,
},
"parameters": {
"mode": mode,
},
}
resp = requests.post(
f"{BASE_URL}/services/aigc/image2video/video-synthesis",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
"X-DashScope-Async": "enable",
},
json=payload,
)
resp.raise_for_status()
data = resp.json()
return data["output"]["task_id"]
def poll_task(task_id: str, interval: int = 15) -> dict:
"""Poll until task completes. Returns final response."""
while True:
resp = requests.get(
f"{BASE_URL}/tasks/{task_id}",
headers={"Authorization": f"Bearer {API_KEY}"},
)
resp.raise_for_status()
data = resp.json()
status = data["output"]["task_status"]
if status in ("SUCCEEDED", "FAILED", "CANCELED"):
return data
time.sleep(interval)
Error handling
| Error |
Likely cause |
Action |
| 401/403 |
Missing or invalid DASHSCOPE_API_KEY |
Check env var or credentials file |
400 InvalidParameter |
Unsupported image/video format, bad dimensions, missing fields |
Validate parameters |
| "does not support synchronous calls" |
Missing X-DashScope-Async: enable header |
Add required header |
| 429 |
Rate limit or quota |
Retry with backoff |
Output location
- Default output:
output/aliyun-wan-animate-move/videos/
- Override base dir with
OUTPUT_DIR.
Anti-patterns
- Do not use model names other than
wan2.2-animate-move.
- Do not call this API synchronously -- async header is required.
- Do not use multiple people in image or video -- single person only.
- Video URLs expire after 24 hours; download and persist immediately.
- Do not use images with occluded faces or extreme proportions.
Workflow
- Confirm user intent: transfer motion from reference video to character image.
- Select service mode:
wan-std (fast/cheap) or wan-pro (high quality).
- Prepare image URL and video URL with valid formats and dimensions.
- Create async task and poll for results.
- Download and save generated video before URL expiration.
References
- See
references/api_reference.md for full HTTP API details.
- See
references/sources.md for source links.
1---2name: aliyun-wan-animate-move3description: Use when generating motion videos from a person image and a reference video with DashScope Wan 2.2 animate-move model (wan2.2-animate-move). Use when transferring actions, expressions, or dance moves from a reference video onto a character image via the image2video async API.4---5
6# Wan 2.2 Animate Move (Image-to-Motion)
7
8## Validation
9
10```bash
11mkdir -p output/aliyun-wan-animate-move
12python -m py_compile skills/ai/video/aliyun-wan-animate-move/scripts/generate_animate_move.py && echo "py_compile_ok" > output/aliyun-wan-animate-move/validate.txt
13```
14
15Pass criteria: command exits 0 and `output/aliyun-wan-animate-move/validate.txt` is generated.
16
17## Output And Evidence
18
19- Save task IDs, polling responses, and final video URLs to `output/aliyun-wan-animate-move/`.
20- Keep at least one end-to-end run log for troubleshooting.
21
22## Prerequisites
23
24- Install SDK (recommended in a venv):
25
26```bash
27python3 -m venv .venv
28. .venv/bin/activate
29python -m pip install requests
30```
31- Set `DASHSCOPE_API_KEY` in your environment, or add `dashscope_api_key` to `~/.alibabacloud/credentials`.
32
33## Critical model names
34
35- `wan2.2-animate-move` -- supports motion transfer from reference video to character image
36
37## Capabilities
38
39| Capability | Description | Required inputs |
40|---|---|---|
41| Motion transfer | Transfer actions/expressions from reference video to character image | `image_url` + `video_url` |
42
43## Service modes
44
45| Mode | Description |
46|---|---|
47| `wan-std` | Standard mode, faster generation, cost-effective, suitable for preview and basic animation |
48| `wan-pro` | Professional mode, smoother animation, better quality, longer processing time |
49
50## API endpoint (async only)
51
52```
53POST https://dashscope.aliyuncs.com/api/v1/services/aigc/image2video/video-synthesis
54```
55
56Required headers:
57- `Authorization: Bearer $DASHSCOPE_API_KEY`
58- `Content-Type: application/json`
59- `X-DashScope-Async: enable`
60
61Singapore endpoint: replace `dashscope.aliyuncs.com` with `dashscope-intl.aliyuncs.com`.
62
63## Normalized interface
64
65### Request
66- `image_url` (string, required) -- public HTTP/HTTPS URL of the character image
67- `video_url` (string, required) -- public HTTP/HTTPS URL of the reference motion video
68- `watermark` (boolean, optional) -- add watermark (default: false)
69- `mode` (string, required) -- `wan-std` or `wan-pro`
70- `check_image` (boolean, optional) -- whether to perform image detection (default: true)
71
72### Image input limits
73
74- Formats: JPG, JPEG, PNG, BMP, WEBP
75- Resolution: [200, 4096] pixels per side
76- Aspect ratio: 1:3 to 3:1
77- Max size: 5MB
78- Content: single person, facing camera, face fully visible, moderate proportion in frame
79
80### Video input limits
81
82- Formats: MP4, AVI, MOV
83- Duration: 2-30s
84- Resolution: [200, 2048] pixels per side
85- Aspect ratio: 1:3 to 3:1
86- Max size: 200MB
87- Content: single person, facing camera, face fully visible, moderate proportion in frame
88
89### Response (task creation)
90- `output.task_id` (string) -- use for polling, valid 24 hours
91- `output.task_status` (string) -- PENDING | RUNNING | SUCCEEDED | FAILED | CANCELED | UNKNOWN
92- `request_id` (string)
93
94### Response (task result)
95- `output.video_url` (string) -- generated video URL
96- `usage.video_count` (integer)
97- `usage.video_duration` (integer) -- duration in seconds
98
99## Quick start (Python + HTTP)
100
101```python
102import os
103import json
104import time
105import requests
106
107API_KEY = os.getenv("DASHSCOPE_API_KEY")
108BASE_URL = "https://dashscope.aliyuncs.com/api/v1"
109
110def create_animate_move_task(image_url: str, video_url: str, mode: str = "wan-std") -> str:
111 """Create an animate-move task and return task_id."""
112 payload = {
113 "model": "wan2.2-animate-move",
114 "input": {
115 "image_url": image_url,
116 "video_url": video_url,
117 "watermark": False,
118 },
119 "parameters": {
120 "mode": mode,
121 },
122 }
123 resp = requests.post(
124 f"{BASE_URL}/services/aigc/image2video/video-synthesis",
125 headers={
126 "Authorization": f"Bearer {API_KEY}",
127 "Content-Type": "application/json",
128 "X-DashScope-Async": "enable",
129 },
130 json=payload,
131 )
132 resp.raise_for_status()
133 data = resp.json()
134 return data["output"]["task_id"]
135
136
137def poll_task(task_id: str, interval: int = 15) -> dict:
138 """Poll until task completes. Returns final response."""
139 while True:
140 resp = requests.get(
141 f"{BASE_URL}/tasks/{task_id}",
142 headers={"Authorization": f"Bearer {API_KEY}"},
143 )
144 resp.raise_for_status()
145 data = resp.json()
146 status = data["output"]["task_status"]
147 if status in ("SUCCEEDED", "FAILED", "CANCELED"):
148 return data
149 time.sleep(interval)
150```
151
152## Error handling
153
154| Error | Likely cause | Action |
155|---|---|---|
156| 401/403 | Missing or invalid `DASHSCOPE_API_KEY` | Check env var or credentials file |
157| 400 `InvalidParameter` | Unsupported image/video format, bad dimensions, missing fields | Validate parameters |
158| "does not support synchronous calls" | Missing `X-DashScope-Async: enable` header | Add required header |
159| 429 | Rate limit or quota | Retry with backoff |
160
161## Output location
162
163- Default output: `output/aliyun-wan-animate-move/videos/`
164- Override base dir with `OUTPUT_DIR`.
165
166## Anti-patterns
167
168- Do not use model names other than `wan2.2-animate-move`.
169- Do not call this API synchronously -- async header is required.
170- Do not use multiple people in image or video -- single person only.
171- Video URLs expire after 24 hours; download and persist immediately.
172- Do not use images with occluded faces or extreme proportions.
173
174## Workflow
175
1761) Confirm user intent: transfer motion from reference video to character image.
1772) Select service mode: `wan-std` (fast/cheap) or `wan-pro` (high quality).
1783) Prepare image URL and video URL with valid formats and dimensions.
1794) Create async task and poll for results.
1805) Download and save generated video before URL expiration.
181
182## References
183
184- See `references/api_reference.md` for full HTTP API details.
185- See `references/sources.md` for source links.