File size: 4,151 Bytes
78360e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# Installation Guide

This guide covers installation for different GPU generations and operating systems.

## Requirements

- Python 3.10.9
- Conda or Python venv
- Compatible GPU (RTX 10XX or newer recommended)

## Installation for RTX 10XX to RTX 40XX (Stable)

This installation uses PyTorch 2.6.0 which is well-tested and stable.

### Step 1: Download and Setup Environment

```shell

# 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

```

### Step 2: Install PyTorch

```shell

# Install PyTorch 2.6.0 with CUDA 12.4

pip install torch==2.6.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/test/cu124  

```

### Step 3: Install Dependencies

```shell

# Install core dependencies

pip install -r requirements.txt

```

### Step 4: Optional Performance Optimizations

#### Sage Attention (30% faster)

```shell

# Windows only: Install Triton

pip install triton-windows 



# For both Windows and Linux

pip install sageattention==1.0.6 

```

#### Sage 2 Attention (40% faster)

```shell

# Windows

pip install triton-windows 

pip install https://github.com/woct0rdho/SageAttention/releases/download/v2.1.1-windows/sageattention-2.1.1+cu126torch2.6.0-cp310-cp310-win_amd64.whl



# Linux (manual compilation required)

git clone https://github.com/thu-ml/SageAttention

cd SageAttention 

pip install -e .

```

#### Flash Attention

```shell

# May require CUDA kernel compilation on Windows

pip install flash-attn==2.7.2.post1

```

## Installation for RTX 50XX (Beta)

RTX 50XX GPUs require PyTorch 2.7.0 (beta). This version may be less stable.

⚠️ **Important:** Use Python 3.10 for compatibility with pip wheels.

### Step 1: Setup Environment

```shell

# Clone and setup (same as above)

git clone https://github.com/deepbeepmeep/Wan2GP.git

cd Wan2GP

conda create -n wan2gp python=3.10.9

conda activate wan2gp

```

### Step 2: Install PyTorch Beta

```shell

# Install PyTorch 2.7.0 with CUDA 12.8

pip install torch==2.7.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/test/cu128

```

### Step 3: Install Dependencies

```shell

pip install -r requirements.txt

```

### Step 4: Optional Optimizations for RTX 50XX

#### Sage Attention

```shell

# Windows

pip install triton-windows 

pip install sageattention==1.0.6 



# Linux

pip install sageattention==1.0.6

```

#### Sage 2 Attention

```shell

# Windows

pip install triton-windows 

pip install https://github.com/woct0rdho/SageAttention/releases/download/v2.1.1-windows/sageattention-2.1.1+cu128torch2.7.0-cp310-cp310-win_amd64.whl 



# Linux (manual compilation)

git clone https://github.com/thu-ml/SageAttention

cd SageAttention 

pip install -e .

```

## Attention Modes

WanGP 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

## Performance Profiles

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

## Troubleshooting

### Sage Attention Issues

If Sage attention doesn't work:

1. Check if Triton is properly installed
2. Clear Triton cache
3. Fallback to SDPA attention:
   ```bash

   python wgp.py --attention sdpa

   ```

### Memory Issues

- 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

### GPU Compatibility

- RTX 10XX, 20XX: Supported with SDPA attention
- RTX 30XX, 40XX: Full feature support
- RTX 50XX: Beta support with PyTorch 2.7.0

For more troubleshooting, see [TROUBLESHOOTING.md](TROUBLESHOOTING.md)