This allows you to utilize Google Colab (or other notebooks) to run wan2.2 image to video
Wan2.2 Google Colab โ Complete Video Generation Suite
A comprehensive Google Colab notebook covering every generation mode in Wan2.2 โ the open-source MoE video generation model from Alibaba. Includes text-to-video, image-to-video, speech-to-video, pose-driven animation, character replacement, and more.
Supported Generation Modes
| Section | Mode | Model | Resolution | Notes | |---------|------|-------|------------|-------| | 2 | Text-to-Video | T2V-A14B | 480P / 720P | MoE 27B total / 14B active | | 3 | Image-to-Video | I2V-A14B | 480P / 720P | Aspect ratio follows input image | | 4 | Text+Image-to-Video | TI2V-5B | 720P @ 24fps | Runs on RTX 4090 (24 GB) | | 5a | Speech-to-Video | S2V-14B | 480P / 720P | Image + audio file โ talking video | | 5b | Pose-Driven Speech-to-Video | S2V-14B | 480P / 720P | Image + audio + pose MP4 | | 5c | TTS Speech-to-Video | S2V-14B + CosyVoice | 480P / 720P | Synthesize voice, then animate | | 6a | Character Animation | Animate-14B | 720P | Character mimics motion from video | | 6b | Character Replacement | Animate-14B | 720P | Swap character into existing video |
Quick Start
1. Open in Google Colab
Click the badge above or upload wan22.ipynb directly to colab.research.google.com.
2. Select a GPU Runtime
Go to Runtime โ Change runtime type โ select A100 (recommended for A14B models) or T4/L4 (for TI2V-5B).
3. Run Section 0 โ Setup
Run the setup cells once per session. They:
- Check your GPU
- Clone the Wan2.2 repo (skips if already present)
- Install all Python dependencies
- Optionally install flash-attn and CosyVoice (S2V TTS) extras
4. Run Section 1 โ Download Your Model(s)
Each model has its own download cell. Only download what you need:
| Cell | Model | Approx Size | |------|-------|-------------| | 1.1 | Wan2.2-T2V-A14B | ~28 GB | | 1.2 | Wan2.2-I2V-A14B | ~28 GB | | 1.3 | Wan2.2-TI2V-5B | ~10 GB | | 1.4 | Wan2.2-S2V-14B | ~28 GB | | 1.5 | Wan2.2-Animate-14B | ~28 GB |
5. Jump to Any Generation Section
Each section is self-contained. Configure settings via the @param widgets, upload your inputs, and run the generation cell.
Notebook Structure
wan2_2.ipynb
โโโ Section 0 โ Setup & Installation
โ โโโ 0.1 GPU check
โ โโโ 0.2 Clone Wan2.2 repo
โ โโโ 0.3 Install core dependencies
โ โโโ 0.4 Install flash-attn (optional)
โ โโโ 0.5 Install S2V / CosyVoice deps (optional)
โ โโโ 0.6 Install huggingface-hub CLI
โ
โโโ Section 1 โ Model Download
โ โโโ 1.1 T2V-A14B
โ โโโ 1.2 I2V-A14B
โ โโโ 1.3 TI2V-5B
โ โโโ 1.4 S2V-14B
โ โโโ 1.5 Animate-14B
โ
โโโ Section 2 โ Text-to-Video (T2V-A14B)
โ โโโ 2.1 Configuration (resolution, steps, seed, prompt extension)
โ โโโ 2.2 Run generation
โ
โโโ Section 3 โ Image-to-Video (I2V-A14B)
โ โโโ 3.1 Upload image
โ โโโ 3.2 Configuration
โ โโโ 3.3 Run generation
โ
โโโ Section 4 โ Text+Image-to-Video (TI2V-5B)
โ โโโ 4.1 Upload image (optional โ omit for pure T2V)
โ โโโ 4.2 Configuration
โ โโโ 4.3 Run generation
โ
โโโ Section 5 โ Speech-to-Video (S2V-14B)
โ โโโ 5.1 Upload image & audio
โ โโโ 5.2a Basic S2V config + run
โ โโโ 5.3b Pose-driven S2V (upload pose video) + run
โ โโโ 5.4c TTS S2V โ CosyVoice voice cloning + run
โ
โโโ Section 6 โ Character Animation & Replacement (Animate-14B)
โ โโโ 6.1 Upload character image & motion video
โ โโโ 6.2 Choose mode (animate / replace) & resolution
โ โโโ 6.3 Preprocess input video (extracts pose/face signals)
โ โโโ 6.4a Run โ Animation mode
โ โโโ 6.4b Run โ Replacement mode
โ
โโโ Section 7 โ Display & Download
โโโ 7.1 List all generated videos
โโโ 7.2 Preview video inline
โโโ 7.3 Download to local machine
GPU Requirements
| Model | Minimum VRAM | Recommended | |-------|-------------|-------------| | TI2V-5B | 24 GB | RTX 4090 / L4 | | T2V-A14B | 24 GB (with offload flags) | A100 80 GB | | I2V-A14B | 24 GB (with offload flags) | A100 80 GB | | S2V-14B | 80 GB | A100 80 GB | | Animate-14B | 80 GB | A100 80 GB |
All A14B sections include--offloadmodel,--convertmodeldtype, and--t5cputoggle flags to reduce VRAM usage on smaller GPUs.
Prompt Extension
For richer, more detailed outputs, the T2V and I2V sections support prompt extension via:
- Local Qwen โ runs a Qwen2.5 LLM (T2V) or Qwen2.5-VL (I2V) locally to expand your prompt. No API key needed.
- Dashscope API โ uses Alibaba Cloud's hosted
qwen-plus/qwen-vl-maxmodels. Requires a free Dashscope API key.
Troubleshooting
Out of Memory (OOM)
- Enable all three memory flags:
offloadmodel,convertmodeldtype,t5cpu - Drop resolution to 832ร480
- Use TI2V-5B (Section 4) instead of the A14B models โ it runs on 24 GB
Model Download Fails
- Re-run the download cell โ
huggingface-cliresumes partial downloads - Log in to Hugging Face to avoid rate limits: uncomment the
login()line in cell 0.6
flash-attn Build Fails
- Skip cell 0.4 โ the model falls back to standard attention automatically
- Or try:
pip install flash-attn --no-build-isolationafter installing all other deps first
S2V / CosyVoice Import Errors
- Make sure you ran cell 0.5 before Section 5c
- CosyVoice requires the
requirements_s2v.txtextras
Animate Preprocessing Fails
- Ensure
Wan2.2-Animate-14B/process_checkpointexists (downloaded in cell 1.5) - Input video should be a standard MP4 with a clearly visible human subject
Repository Structure
wan2.2-google-colab/
โโโ wan2_2.ipynb # Main notebook (all generation modes)
โโโ README.md # This file
โโโ SECURITY.md
Credits & Links
- Wan2.2 Model: Wan-Video/Wan2.2
- Hugging Face: Wan-AI
- Paper: arXiv:2503.20314
- CosyVoice (TTS): FunAudioLLM/CosyVoice
License
This template is released under the same Apache 2.0 License as the upstream Wan2.2 project.
This is an unofficial Colab template. For questions about the Wan2.2 model itself, refer to the official repository or join their Discord.