This guide covers installation for different GPU generations and operating systems.
- Python 3.10.9
- Conda or Python venv
- Compatible GPU (RTX 10XX or newer recommended)
This installation uses PyTorch 2.7.0 which is well-tested and stable. Unless you need absolutely to use Pytorch compilation (with RTX 50xx), it is not recommeneded to use PytTorch 2.8.0 as some RAM memory leaks have been observed when switching models.
# Clone the repository
git clone https://github.com/deepbeepmeep/Wan2GP.git
cd Wan2GP
# Create Python 3.10.9 environment using conda
conda create -n wan2gp python=3.10.9
conda activate wan2gp# Install PyTorch 2.7.1 with CUDA 12.8
pip install torch==2.7.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/test/cu128# Install core dependencies
pip install -r requirements.txt# Windows only: Install Triton
pip install triton-windows
# For both Windows and Linux
pip install sageattention==1.0.6 # Windows
pip install triton-windows
pip install https://github.com/woct0rdho/SageAttention/releases/download/v2.2.0-windows.post3/sageattention-2.2.0+cu128torch2.7.1.post3-cp39-abi3-win_amd64.whl
# Linux (manual compilation required)
python -m pip install "setuptools<=75.8.2" --force-reinstall
git clone https://github.com/thu-ml/SageAttention
cd SageAttention
pip install -e .# May require CUDA kernel compilation on Windows
pip install flash-attn==2.7.2.post1WanGP supports several attention implementations:
- SDPA (default): Available by default with PyTorch
- Sage: 30% speed boost with small quality cost
- Sage2: 40% speed boost
- Flash: Good performance, may be complex to install on Windows
- RTX 10XX, 20XX: SDPA
- RTX 30XX, 40XX: SDPA, Flash Attention, Xformers, Sage, Sage2
- RTX 50XX: SDPA, SDPA, Flash Attention, Xformers, Sage2
Choose a profile based on your hardware:
- Profile 3 (LowRAM_HighVRAM): Loads entire model in VRAM, requires 24GB VRAM for 8-bit quantized 14B model
- Profile 4 (LowRAM_LowVRAM): Default, loads model parts as needed, slower but lower VRAM requirement
If Sage attention doesn't work:
- Check if Triton is properly installed
- Clear Triton cache
- Fallback to SDPA attention:
python wgp.py --attention sdpa
- Use lower resolution or shorter videos
- Enable quantization (default)
- Use Profile 4 for lower VRAM usage
- Consider using 1.3B models instead of 14B models
For more troubleshooting, see TROUBLESHOOTING.md