Communitygithub.com

Wan2.2-Animate Image-to-Video

Synthesizes motion videos by transferring motion and expression from a reference video to a static character image (motion imitation/dance replication/anime character animation). Input a character image + a reference video, output an MP4 where the character follows the same actions and expressions. Use this skill when users mention 'make this image move', 'dance like the video', 'motion imitation', 'character replacement', 'animate', 'Wan2.2-Animate', or ask to transfer someone's motion to another image.

What is Wan2.2-Animate Image-to-Video?

This skill, named Wan2.2-Animate Image-to-Video, enables motion transfer from a reference video to a static character image. It leverages Alibaba Cloud Bailian's API with the fixed model name `wan2.2-animate-move` to produce dynamic MP4 videos where the character mimics the actions and expressions of the reference video. Designed for developers and AI agent users, it supports both standard (wan-std, faster and cheaper) and professional (wan-pro, smoother but slower and more expensive) modes. The skill automatically handles uploading local assets, creating asynchronous tasks, polling every 15 seconds, and downloading the final output. It requires a valid Alibaba Cloud Bailian API Key set via the environment variable `DASHSCOPE_API_KEY`, with optional business space domain configurations for improved speed and stability. Key constraints include image dimensions (200-4096 px, aspect ratio 1:3 to 3:1, ≤5MB) and video duration (2-30 seconds, dimensions 200-2048 px, ≤200MB). Error messages from Bailian are translated into human-readable explanations for easy troubleshooting. The skill emphasizes checking asset compatibility before submission and optimizing results by ensuring similar character proportions and high-quality reference video.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add vermicellichina-max/wan22-animate

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does Wan2.2-Animate Image-to-Video do?

Transfer motion and expression from a reference video to a static character image, generating a dynamic video. Uses Alibaba Cloud Bailian API with the fixed model name wan2.2-animate-move.

Pre-checks (Always Do First)

This skill requires an Alibaba Cloud Bailian API Key. First, switch the working directory to where this SKILL.md is located, then run:

python scripts/wan_animate.py check

If the path reports "file not found", retry using the absolute path of the skill directory (replace scripts/wan_animate.py with <skill_directory>/scripts/wan_animate.py). Do not give up or write requests yourself just because the script is missing.

  • Output "api_key_set": true → proceed directly.
  • Output false → Stop and ask the user for the API Key, do not guess or hardcode it. Inform the user to create one in the Alibaba Cloud Bailian console and set the environment variable:
# Windows PowerShell
$env:DASHSCOPE_API_KEY="sk-xxxx"
# macOS / Linux
export DASHSCOPE_API_KEY=sk-xxxx

Do not write the user's API Key into any files, notes, or conversation summaries. Only pass it via environment variables in the current session.

If the user wants to use a business space-specific domain (faster and more stable), have them provide it and set DASHSCOPE_API_HOST: https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com or for Singapore region https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com. Note that API Keys for Beijing and Singapore are not interchangeable.

Execution

python scripts/wan_animate.py run \
  --image <character image path or URL> \
  --video <reference video path or URL> \
  --mode wan-std \
  --out ./output

Parameter Descriptions:

ParameterDescription
--imageRequired. Character image, can be a local path or public URL. Local files are automatically uploaded to Bailian temporary storage by the script.
--videoRequired. Reference video, same as above. Duration 2~30 seconds.
--modewan-std standard mode, fast and cheap, default; wan-pro professional mode, smoother but slower and more expensive.
--watermarkAdds an "AI-generated" watermark, not added by default.
--outOutput directory, default ./wan_animate_output.
--no-downloadOnly return the result link, no local download. Result links are valid for 24 hours; downloading locally is usually better.

The script automatically: uploads local assets → creates an async task → polls every 15 seconds → downloads the final output locally. A single video typically takes a few minutes—this is normal, do not abort midway, let the polling complete. Finally, it outputs the result JSON between RESULT_JSON_BEGIN / RESULT_JSON_END, and informs the user of the video path.

Asset Constraints (Check Before Submitting to Save a Round of Failure)

  • Image: JPG/JPEG/PNG/BMP/WEBP, width and height both 200~4096 px, aspect ratio 1:3 ~ 3:1, ≤ 5MB
  • Video: MP4/AVI/MOV, duration 2~30 seconds, width and height both 200~2048 px, aspect ratio 1:3 ~ 3:1, ≤ 200MB
  • Both assets must be publicly accessible URLs or local files. Regular URLs requiring login or anti-leeching will fail; in such cases, have the user download the file locally first and use the local path.

If constraints are exceeded, inform the user before calling and explain what needs to be done (crop, compress, transcode). Do not submit blindly.

Quality Optimization (Check These First When Output Looks Poor)

  1. The character's framing ratio in the image and reference video should be similar — a full-body and a half-body shot will almost certainly fail.
  2. The body proportions of the characters should match.
  3. The reference video should have as high resolution and frame rate as possible; blurry videos will directly degrade output quality.
  4. For the first attempt, use wan-std to verify motion alignment. Once satisfied, use wan-pro for the final version — pro mode is expensive, don't waste money upfront.

Common Error Handling

The script translates Bailian error codes into plain language; you only need to relay them to the user:

  • UrlOrFileNotReachable / downloadFail → link unreachable or requires authentication, switch to local file upload.
  • DataInspectionFailed / IPInfringementSuspect → asset failed content review or suspected infringement, replace the asset.
  • Arrearage / FreeQuotaExhausted → account overdue or free quota exhausted, requires recharge/purchasing the paid plan.
  • InvalidApiKey → Key invalid, have the user regenerate it.
  • Throttling → rate-limited, wait and retry.
  • InvalidParameter → asset dimensions/duration do not meet requirements, check against the constraints above.

Billing: Input is free; charged by the number of seconds of successfully generated video; failed calls are not charged. For specific unit prices, refer to the Bailian console. If the user asks, direct them to the "Model Pricing" page—do not quote from memory.

If the user has not yet provided assets, first ask where the image and video are. Do not fabricate file paths.

Related Skills