"vscode:/vscode.git/clone" did not exist on "77060d462cc0ef171d5ebb66b8070175c53212df"
deploy_local_windows.md 8.07 KB
Newer Older
gushiqiao's avatar
gushiqiao committed
1
# Windows Local Deployment Guide
helloyongyang's avatar
helloyongyang committed
2

gushiqiao's avatar
gushiqiao committed
3
## 📖 Overview
gushiqiao's avatar
gushiqiao committed
4

gushiqiao's avatar
gushiqiao committed
5
This document provides detailed instructions for deploying LightX2V locally on Windows environments, including batch file inference, Gradio Web interface inference, and other usage methods.
gushiqiao's avatar
gushiqiao committed
6

gushiqiao's avatar
gushiqiao committed
7
## 🚀 Quick Start
gushiqiao's avatar
gushiqiao committed
8

gushiqiao's avatar
gushiqiao committed
9
### Environment Requirements
gushiqiao's avatar
gushiqiao committed
10

gushiqiao's avatar
gushiqiao committed
11
12
13
14
#### Hardware Requirements
- **GPU**: NVIDIA GPU, recommended 8GB+ VRAM
- **Memory**: Recommended 16GB+ RAM
- **Storage**: Strongly recommended to use SSD solid-state drives, mechanical hard drives will cause slow model loading
gushiqiao's avatar
gushiqiao committed
15
16


gushiqiao's avatar
gushiqiao committed
17
## 🎯 Usage Methods
gushiqiao's avatar
gushiqiao committed
18

gushiqiao's avatar
gushiqiao committed
19
### Method 1: Using Batch File Inference
gushiqiao's avatar
gushiqiao committed
20

gushiqiao's avatar
gushiqiao committed
21
Refer to [Quick Start Guide](../getting_started/quickstart.md) to install environment, and use [batch files](https://github.com/ModelTC/LightX2V/tree/main/scripts/win) to run.
gushiqiao's avatar
gushiqiao committed
22

gushiqiao's avatar
gushiqiao committed
23
### Method 2: Using Gradio Web Interface Inference
gushiqiao's avatar
gushiqiao committed
24

gushiqiao's avatar
gushiqiao committed
25
#### Manual Gradio Configuration
gushiqiao's avatar
gushiqiao committed
26

gushiqiao's avatar
gushiqiao committed
27
Refer to [Quick Start Guide](../getting_started/quickstart.md) to install environment, refer to [Gradio Deployment Guide](./deploy_gradio.md)
gushiqiao's avatar
gushiqiao committed
28

gushiqiao's avatar
gushiqiao committed
29
#### One-Click Gradio Startup (Recommended)
gushiqiao's avatar
gushiqiao committed
30

gushiqiao's avatar
gushiqiao committed
31
**📦 Download Software Package**
gushiqiao's avatar
gushiqiao committed
32
33
- [Baidu Cloud](https://pan.baidu.com/s/1lLb2LYl8kbmjluaM9-jCjg?pwd=ugd4)
- [Quark Cloud](https://pan.quark.cn/s/d0b8be4bc619)
gushiqiao's avatar
gushiqiao committed
34

gushiqiao's avatar
gushiqiao committed
35
36
**📁 Directory Structure**
After extraction, ensure the directory structure is as follows:
gushiqiao's avatar
gushiqiao committed
37
38

```
gushiqiao's avatar
gushiqiao committed
39
40
41
42
43
├── env/                        # LightX2V environment directory
├── LightX2V/                   # LightX2V project directory
├── start_lightx2v.bat          # One-click startup script
├── lightx2v_config.txt         # Configuration file
├── LightX2V使用说明.txt         # LightX2V usage instructions
gushiqiao's avatar
gushiqiao committed
44
├── outputs/                    # Generated video save directory
gushiqiao's avatar
gushiqiao committed
45
46
47
48
49
50
51
52
53
└── models/                     # Model storage directory
    ├── 说明.txt                       # Model documentation
    ├── Wan2.1-I2V-14B-480P-Lightx2v/  # Image-to-video model (480P)
    ├── Wan2.1-I2V-14B-720P-Lightx2v/  # Image-to-video model (720P)
    ├── Wan2.1-I2V-14B-480P-StepDistill-CfgDistil-Lightx2v/  # Image-to-video model (4-step distillation, 480P)
    ├── Wan2.1-I2V-14B-720P-StepDistill-CfgDistil-Lightx2v/  # Image-to-video model (4-step distillation, 720P)
    ├── Wan2.1-T2V-1.3B-Lightx2v/      # Text-to-video model (1.3B parameters)
    ├── Wan2.1-T2V-14B-Lightx2v/       # Text-to-video model (14B parameters)
    └── Wan2.1-T2V-14B-StepDistill-CfgDistill-Lightx2v/      # Text-to-video model (4-step distillation)
gushiqiao's avatar
gushiqiao committed
54
55
```

gushiqiao's avatar
gushiqiao committed
56
57
58
59
60
61
62
63
64
65
66
67
68
69
**📥 Model Download**:

Refer to the [Model Structure Documentation](./model_structure.md) to download complete models (including quantized and non-quantized versions) or download only quantized/non-quantized versions.

**Download Options**:

- **Complete Model**: When downloading complete models with both quantized and non-quantized versions, you can freely choose the quantization precision for DIT/T5/CLIP in the advanced options of the `Gradio` Web frontend.

- **Non-quantized Version Only**: When downloading only non-quantized versions, in the `Gradio` Web frontend, the quantization precision for `DIT/T5/CLIP` can only be set to bf16/fp16. If you need to use quantized versions of models, please manually download quantized weights to the `i2v_model_path` or `t2v_model_path` directory where Gradio is started.

- **Quantized Version Only**: When downloading only quantized versions, in the `Gradio` Web frontend, the quantization precision for `DIT/T5/CLIP` can only be set to fp8 or int8 (depending on the weights you downloaded). If you need to use non-quantized versions of models, please manually download non-quantized weights to the `i2v_model_path` or `t2v_model_path` directory where Gradio is started.

- **Note**: Whether you download complete models or partial models, the values for `i2v_model_path` and `t2v_model_path` parameters should be the first-level directory paths. For example: `Wan2.1-I2V-14B-480P-Lightx2v/`, not `Wan2.1-I2V-14B-480P-Lightx2v/int8`.

gushiqiao's avatar
gushiqiao committed
70
**📋 Configuration Parameters**
gushiqiao's avatar
gushiqiao committed
71

gushiqiao's avatar
gushiqiao committed
72
Edit the `lightx2v_config.txt` file and modify the following parameters as needed:
gushiqiao's avatar
gushiqiao committed
73

gushiqiao's avatar
gushiqiao committed
74
75
76
```ini
# Task type (i2v: image-to-video, t2v: text-to-video)
task=i2v
gushiqiao's avatar
gushiqiao committed
77

gushiqiao's avatar
gushiqiao committed
78
79
# Interface language (zh: Chinese, en: English)
lang=en
gushiqiao's avatar
gushiqiao committed
80

gushiqiao's avatar
gushiqiao committed
81
82
# Server port
port=8032
gushiqiao's avatar
gushiqiao committed
83

gushiqiao's avatar
gushiqiao committed
84
85
# GPU device ID (0, 1, 2...)
gpu=0
gushiqiao's avatar
gushiqiao committed
86

gushiqiao's avatar
gushiqiao committed
87
88
# Model size (14b: 14B parameter model, 1.3b: 1.3B parameter model)
model_size=14b
gushiqiao's avatar
gushiqiao committed
89

gushiqiao's avatar
gushiqiao committed
90
91
# Model class (wan2.1: standard model, wan2.1_distill: distilled model)
model_cls=wan2.1
gushiqiao's avatar
gushiqiao committed
92
93
94
95
96
97

# Image-to-video model path
i2v_model_path=models/Wan2.1-I2V-14B-480P-StepDistill-CfgDistill-Lightx2v

# Text-to-video model path
t2v_model_path=models/Wan2.1-T2V-1.3B-Lightx2v
gushiqiao's avatar
gushiqiao committed
98
99
```

gushiqiao's avatar
gushiqiao committed
100
**⚠️ Important Note**: If using distilled models (model names containing StepDistill-CfgDistil field), please set `model_cls` to `wan2.1_distill`
gushiqiao's avatar
gushiqiao committed
101

gushiqiao's avatar
gushiqiao committed
102
**🚀 Start Service**
gushiqiao's avatar
gushiqiao committed
103

gushiqiao's avatar
gushiqiao committed
104
105
106
107
108
Double-click to run the `start_lightx2v.bat` file, the script will:
1. Automatically read configuration file
2. Verify model paths and file integrity
3. Start Gradio Web interface
4. Automatically open browser to access service
gushiqiao's avatar
gushiqiao committed
109

gushiqiao's avatar
gushiqiao committed
110
**💡 Usage Suggestion**: After opening the Gradio Web page, it's recommended to check "Auto-configure Inference Options", the system will automatically select appropriate optimization configurations for your machine. When reselecting resolution, you also need to re-check "Auto-configure Inference Options".
gushiqiao's avatar
gushiqiao committed
111

gushiqiao's avatar
Fix  
gushiqiao committed
112
![Gradio English Interface](../../../../assets/figs/portabl_windows/pic_gradio_en.png)
gushiqiao's avatar
gushiqiao committed
113
114
115
116
117

**⚠️ Important Notes**:
- **First Run**: The system will automatically extract the environment file `env.zip`, which may take several minutes. Please be patient. Subsequent launches will skip this step.
- **Faster Startup**: You can also manually extract the `env.zip` file to the current directory to save time on first startup.
- **Display Issues**: If the webpage opens blank or displays abnormally, please run `pip install --upgrade gradio` to upgrade the Gradio version.
gushiqiao's avatar
gushiqiao committed
118

gushiqiao's avatar
gushiqiao committed
119
### Method 3: Using ComfyUI Inference
gushiqiao's avatar
gushiqiao committed
120

gushiqiao's avatar
Fix  
gushiqiao committed
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
This guide will instruct you on how to download and use the portable version of the Lightx2v-ComfyUI environment, so you can avoid manual environment configuration steps. This is suitable for users who want to quickly start experiencing accelerated video generation with Lightx2v on Windows systems.

#### Download the Windows Portable Environment:

- [Baidu Cloud Download](https://pan.baidu.com/s/1FVlicTXjmXJA1tAVvNCrBw?pwd=wfid), extraction code: wfid

The portable environment already packages all Python runtime dependencies, including the code and dependencies for ComfyUI and LightX2V. After downloading, simply extract to use.

After extraction, the directory structure is as follows:

```shell
lightx2v_env
├──📂 ComfyUI                    # ComfyUI code
├──📂 portable_python312_embed   # Standalone Python environment
└── run_nvidia_gpu.bat            # Windows startup script (double-click to start)
```

#### Start ComfyUI

Directly double-click the run_nvidia_gpu.bat file. The system will open a Command Prompt window and run the program. The first startup may take a while, please be patient. After startup is complete, the browser will automatically open and display the ComfyUI frontend interface.

![i2v example workflow](../../../../assets/figs/portabl_windows/pic1.png)

The plugin used by LightX2V-ComfyUI is [ComfyUI-Lightx2vWrapper](https://github.com/ModelTC/ComfyUI-Lightx2vWrapper). Example workflows can be obtained from this project.

#### Tested Graphics Cards (offload mode)

- Tested model: `Wan2.1-I2V-14B-480P`

| GPU Model   | Task Type   | VRAM Capacity | Actual Max VRAM Usage | Actual Max RAM Usage |
|:-----------|:------------|:--------------|:---------------------|:---------------------|
| 3090Ti     | I2V         | 24G           | 6.1G                 | 7.1G                 |
| 3080Ti     | I2V         | 12G           | 6.1G                 | 7.1G                 |
| 3060Ti     | I2V         | 8G            | 6.1G                 | 7.1G                 |


#### Environment Packaging and Usage Reference
- [ComfyUI](https://github.com/comfyanonymous/ComfyUI)
- [Portable-Windows-ComfyUI-Docs](https://docs.comfy.org/zh-CN/installation/comfyui_portable_windows#portable-%E5%8F%8A%E8%87%AA%E9%83%A8%E7%BD%B2)