Unverified Commit 0a900eca authored by Gu Shiqiao's avatar Gu Shiqiao Committed by GitHub
Browse files

update docs (#592)

parent b19d2ca2
...@@ -5,6 +5,7 @@ import importlib.util ...@@ -5,6 +5,7 @@ import importlib.util
import json import json
import os import os
os.environ["PROFILING_DEBUG_LEVEL"] = "2"
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True" os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True"
os.environ["DTYPE"] = "BF16" os.environ["DTYPE"] = "BF16"
import random import random
...@@ -795,12 +796,18 @@ def auto_configure(resolution): ...@@ -795,12 +796,18 @@ def auto_configure(resolution):
{ {
"cpu_offload_val": True, "cpu_offload_val": True,
"use_tiling_vae_val": True, "use_tiling_vae_val": True,
"t5_cpu_offload_val": True,
"vae_cpu_offload_val": True,
"clip_cpu_offload_val": True,
}, },
), ),
( (
16, 16,
{ {
"cpu_offload_val": True, "cpu_offload_val": True,
"t5_cpu_offload_val": True,
"vae_cpu_offload_val": True,
"clip_cpu_offload_val": True,
"use_tiling_vae_val": True, "use_tiling_vae_val": True,
"offload_granularity_val": "phase", "offload_granularity_val": "phase",
"rope_chunk_val": True, "rope_chunk_val": True,
...@@ -811,6 +818,9 @@ def auto_configure(resolution): ...@@ -811,6 +818,9 @@ def auto_configure(resolution):
8, 8,
{ {
"cpu_offload_val": True, "cpu_offload_val": True,
"t5_cpu_offload_val": True,
"vae_cpu_offload_val": True,
"clip_cpu_offload_val": True,
"use_tiling_vae_val": True, "use_tiling_vae_val": True,
"offload_granularity_val": "phase", "offload_granularity_val": "phase",
"rope_chunk_val": True, "rope_chunk_val": True,
...@@ -829,6 +839,9 @@ def auto_configure(resolution): ...@@ -829,6 +839,9 @@ def auto_configure(resolution):
24, 24,
{ {
"cpu_offload_val": True, "cpu_offload_val": True,
"t5_cpu_offload_val": True,
"vae_cpu_offload_val": True,
"clip_cpu_offload_val": True,
"use_tiling_vae_val": True, "use_tiling_vae_val": True,
}, },
), ),
...@@ -836,6 +849,9 @@ def auto_configure(resolution): ...@@ -836,6 +849,9 @@ def auto_configure(resolution):
16, 16,
{ {
"cpu_offload_val": True, "cpu_offload_val": True,
"t5_cpu_offload_val": True,
"vae_cpu_offload_val": True,
"clip_cpu_offload_val": True,
"use_tiling_vae_val": True, "use_tiling_vae_val": True,
"offload_granularity_val": "phase", "offload_granularity_val": "phase",
}, },
...@@ -844,6 +860,9 @@ def auto_configure(resolution): ...@@ -844,6 +860,9 @@ def auto_configure(resolution):
8, 8,
{ {
"cpu_offload_val": True, "cpu_offload_val": True,
"t5_cpu_offload_val": True,
"vae_cpu_offload_val": True,
"clip_cpu_offload_val": True,
"use_tiling_vae_val": True, "use_tiling_vae_val": True,
"offload_granularity_val": "phase", "offload_granularity_val": "phase",
}, },
......
...@@ -5,6 +5,7 @@ import importlib.util ...@@ -5,6 +5,7 @@ import importlib.util
import json import json
import os import os
os.environ["PROFILING_DEBUG_LEVEL"] = "2"
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True" os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True"
os.environ["DTYPE"] = "BF16" os.environ["DTYPE"] = "BF16"
import random import random
...@@ -795,12 +796,18 @@ def auto_configure(resolution): ...@@ -795,12 +796,18 @@ def auto_configure(resolution):
{ {
"cpu_offload_val": True, "cpu_offload_val": True,
"use_tiling_vae_val": True, "use_tiling_vae_val": True,
"t5_cpu_offload_val": True,
"vae_cpu_offload_val": True,
"clip_cpu_offload_val": True,
}, },
), ),
( (
16, 16,
{ {
"cpu_offload_val": True, "cpu_offload_val": True,
"t5_cpu_offload_val": True,
"vae_cpu_offload_val": True,
"clip_cpu_offload_val": True,
"use_tiling_vae_val": True, "use_tiling_vae_val": True,
"offload_granularity_val": "phase", "offload_granularity_val": "phase",
"rope_chunk_val": True, "rope_chunk_val": True,
...@@ -811,6 +818,9 @@ def auto_configure(resolution): ...@@ -811,6 +818,9 @@ def auto_configure(resolution):
8, 8,
{ {
"cpu_offload_val": True, "cpu_offload_val": True,
"t5_cpu_offload_val": True,
"vae_cpu_offload_val": True,
"clip_cpu_offload_val": True,
"use_tiling_vae_val": True, "use_tiling_vae_val": True,
"offload_granularity_val": "phase", "offload_granularity_val": "phase",
"rope_chunk_val": True, "rope_chunk_val": True,
...@@ -829,6 +839,9 @@ def auto_configure(resolution): ...@@ -829,6 +839,9 @@ def auto_configure(resolution):
24, 24,
{ {
"cpu_offload_val": True, "cpu_offload_val": True,
"t5_cpu_offload_val": True,
"vae_cpu_offload_val": True,
"clip_cpu_offload_val": True,
"use_tiling_vae_val": True, "use_tiling_vae_val": True,
}, },
), ),
...@@ -836,6 +849,9 @@ def auto_configure(resolution): ...@@ -836,6 +849,9 @@ def auto_configure(resolution):
16, 16,
{ {
"cpu_offload_val": True, "cpu_offload_val": True,
"t5_cpu_offload_val": True,
"vae_cpu_offload_val": True,
"clip_cpu_offload_val": True,
"use_tiling_vae_val": True, "use_tiling_vae_val": True,
"offload_granularity_val": "phase", "offload_granularity_val": "phase",
}, },
...@@ -844,6 +860,9 @@ def auto_configure(resolution): ...@@ -844,6 +860,9 @@ def auto_configure(resolution):
8, 8,
{ {
"cpu_offload_val": True, "cpu_offload_val": True,
"t5_cpu_offload_val": True,
"vae_cpu_offload_val": True,
"clip_cpu_offload_val": True,
"use_tiling_vae_val": True, "use_tiling_vae_val": True,
"offload_granularity_val": "phase", "offload_granularity_val": "phase",
}, },
......
...@@ -29,8 +29,7 @@ Refer to [Quick Start Guide](../getting_started/quickstart.md) to install enviro ...@@ -29,8 +29,7 @@ Refer to [Quick Start Guide](../getting_started/quickstart.md) to install enviro
#### One-Click Gradio Startup (Recommended) #### One-Click Gradio Startup (Recommended)
**📦 Download Software Package** **📦 Download Software Package**
- [Baidu Cloud](https://pan.baidu.com/s/14bMAbOuFFSj8yzt4Zdmyqw) - [Quark Cloud](https://pan.quark.cn/s/8af1162d7a15)
- [Quark Cloud](https://pan.quark.cn/s/97b4ad6bc76c)
**📁 Directory Structure** **📁 Directory Structure**
After extraction, ensure the directory structure is as follows: After extraction, ensure the directory structure is as follows:
...@@ -43,37 +42,18 @@ After extraction, ensure the directory structure is as follows: ...@@ -43,37 +42,18 @@ After extraction, ensure the directory structure is as follows:
├── LightX2V使用说明.txt # LightX2V usage instructions ├── LightX2V使用说明.txt # LightX2V usage instructions
├── outputs/ # Generated video save directory ├── outputs/ # Generated video save directory
└── models/ # Model storage directory └── 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)
``` ```
**📥 Model Download**: **📥 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. Refer to [Model Structure Documentation](./model_structure.md) or [Gradio Deployment Guide](./deploy_gradio.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`.
**📋 Configuration Parameters** **📋 Configuration Parameters**
Edit the `lightx2v_config.txt` file and modify the following parameters as needed: Edit the `lightx2v_config.txt` file and modify the following parameters as needed:
```ini ```ini
# Task type (i2v: image-to-video, t2v: text-to-video)
task=i2v
# Interface language (zh: Chinese, en: English) # Interface language (zh: Chinese, en: English)
lang=en lang=en
...@@ -84,21 +64,10 @@ port=8032 ...@@ -84,21 +64,10 @@ port=8032
# GPU device ID (0, 1, 2...) # GPU device ID (0, 1, 2...)
gpu=0 gpu=0
# Model size (14b: 14B parameter model, 1.3b: 1.3B parameter model) # Model path
model_size=14b model_path=models/
# Model class (wan2.1: standard model, wan2.1_distill: distilled model)
model_cls=wan2.1
# 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
``` ```
**⚠️ Important Note**: If using distilled models (model names containing StepDistill-CfgDistil field), please set `model_cls` to `wan2.1_distill`
**🚀 Start Service** **🚀 Start Service**
Double-click to run the `start_lightx2v.bat` file, the script will: Double-click to run the `start_lightx2v.bat` file, the script will:
...@@ -107,13 +76,10 @@ Double-click to run the `start_lightx2v.bat` file, the script will: ...@@ -107,13 +76,10 @@ Double-click to run the `start_lightx2v.bat` file, the script will:
3. Start Gradio Web interface 3. Start Gradio Web interface
4. Automatically open browser to access service 4. Automatically open browser to access service
**💡 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".
![Gradio English Interface](../../../../assets/figs/portabl_windows/pic_gradio_en.png) ![Gradio English Interface](../../../../assets/figs/portabl_windows/pic_gradio_en.png)
**⚠️ Important Notes**: **⚠️ 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. - **Display Issues**: If the webpage opens blank or displays abnormally, please run `pip install --upgrade gradio` to upgrade the Gradio version.
### Method 3: Using ComfyUI Inference ### Method 3: Using ComfyUI Inference
......
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
#### 一键启动Gradio(推荐) #### 一键启动Gradio(推荐)
**📦 下载软件包** **📦 下载软件包**
- [百度云](https://pan.baidu.com/s/14bMAbOuFFSj8yzt4Zdmyqw) - [夸克网盘](https://pan.quark.cn/s/8af1162d7a15)
- [夸克网盘](https://pan.quark.cn/s/97b4ad6bc76c)
**📁 目录结构** **📁 目录结构**
解压后,确保目录结构如下: 解压后,确保目录结构如下:
...@@ -42,37 +41,18 @@ ...@@ -42,37 +41,18 @@
├── LightX2V使用说明.txt # LightX2V使用说明 ├── LightX2V使用说明.txt # LightX2V使用说明
├── outputs/ # 生成的视频保存目录 ├── outputs/ # 生成的视频保存目录
└── models/ # 模型存放目录 └── models/ # 模型存放目录
├── 说明.txt # 模型说明文档
├── Wan2.1-I2V-14B-480P-Lightx2v/ # 图像转视频模型(480P)
├── Wan2.1-I2V-14B-720P-Lightx2v/ # 图像转视频模型(720P)
├── Wan2.1-I2V-14B-480P-StepDistill-CfgDistil-Lightx2v/ # 图像转视频模型(4步蒸馏,480P)
├── Wan2.1-I2V-14B-720P-StepDistill-CfgDistil-Lightx2v/ # 图像转视频模型(4步蒸馏,720P)
├── Wan2.1-T2V-1.3B-Lightx2v/ # 文本转视频模型(1.3B参数)
├── Wan2.1-T2V-14B-Lightx2v/ # 文本转视频模型(14B参数)
└── Wan2.1-T2V-14B-StepDistill-CfgDistill-Lightx2v/ # 文本转视频模型(4步蒸馏)
``` ```
**📥 下载模型**: **📥 下载模型**:
可参考[模型结构文档](./model_structure.md)下载完整模型(包含量化和非量化版本)或仅下载量化/非量化版本。 可参考[模型结构文档](./model_structure.md)或者[gradio部署文档](./deploy_gradio.md)下载完整模型(包含量化和非量化版本)或仅下载量化/非量化版本。
**下载选项说明**
- **完整模型**:下载包含量化和非量化版本的完整模型时,在`Gradio` Web前端的高级选项中可以自由选择DIT/T5/CLIP的量化精度。
- **仅非量化版本**:仅下载非量化版本时,在`Gradio` Web前端中,`DIT/T5/CLIP`的量化精度只能选择bf16/fp16。如需使用量化版本的模型,请手动下载量化权重到Gradio启动的`i2v_model_path`或者`t2v_model_path`目录下。
- **仅量化版本**:仅下载量化版本时,在`Gradio` Web前端中,`DIT/T5/CLIP`的量化精度只能选择fp8或int8(取决于您下载的权重)。如需使用非量化版本的模型,请手动下载非量化权重到Gradio启动的`i2v_model_path`或者`t2v_model_path`目录下。
- **注意**:无论是下载了完整模型还是部分模型,`i2v_model_path``t2v_model_path` 参数的值都应该是一级目录的路径。例如:`Wan2.1-I2V-14B-480P-Lightx2v/`,而不是 `Wan2.1-I2V-14B-480P-Lightx2v/int8`
**📋 配置参数** **📋 配置参数**
编辑 `lightx2v_config.txt` 文件,根据需要修改以下参数: 编辑 `lightx2v_config.txt` 文件,根据需要修改以下参数:
```ini ```ini
# 任务类型 (i2v: 图像转视频, t2v: 文本转视频)
task=i2v
# 界面语言 (zh: 中文, en: 英文) # 界面语言 (zh: 中文, en: 英文)
lang=zh lang=zh
...@@ -83,21 +63,10 @@ port=8032 ...@@ -83,21 +63,10 @@ port=8032
# GPU设备ID (0, 1, 2...) # GPU设备ID (0, 1, 2...)
gpu=0 gpu=0
# 模型大小 (14b: 14B参数模型, 1.3b: 1.3B参数模型) # 模型路径
model_size=14b model_path=models/
# 模型类别 (wan2.1: 标准模型, wan2.1_distill: 蒸馏模型)
model_cls=wan2.1
# 图像转视频模型路径
i2v_model_path=models/Wan2.1-I2V-14B-480P-StepDistill-CfgDistill-Lightx2v
# 文本转视频模型路径
t2v_model_path=models/Wan2.1-T2V-1.3B-Lightx2v
``` ```
**⚠️ 重要提示**: 如果使用蒸馏模型(模型名称包含StepDistill-CfgDistil字段),请将`model_cls`设置为`wan2.1_distill`
**🚀 启动服务** **🚀 启动服务**
双击运行 `start_lightx2v.bat` 文件,脚本将: 双击运行 `start_lightx2v.bat` 文件,脚本将:
...@@ -106,13 +75,10 @@ t2v_model_path=models/Wan2.1-T2V-1.3B-Lightx2v ...@@ -106,13 +75,10 @@ t2v_model_path=models/Wan2.1-T2V-1.3B-Lightx2v
3. 启动 Gradio Web 界面 3. 启动 Gradio Web 界面
4. 自动打开浏览器访问服务 4. 自动打开浏览器访问服务
**💡 使用建议**: 当打开Gradio Web页面后,建议勾选"自动配置推理选项",系统会自动选择合适的优化配置针对您的机器。当重新选择分辨率后,也需要重新勾选"自动配置推理选项"。
![Gradio中文界面](../../../../assets/figs/portabl_windows/pic_gradio_zh.png) ![Gradio中文界面](../../../../assets/figs/portabl_windows/pic_gradio_zh.png)
**⚠️ 重要提示**: **⚠️ 重要提示**:
- **首次运行**: 系统会自动解压环境文件 `env.zip`,此过程需要几分钟时间,请耐心等待。后续启动无需重复此步骤。
- **加速启动**: 您也可以手动解压 `env.zip` 文件到当前目录以节省首次启动时间。
- **页面显示问题**: 如果网页打开空白或显示异常,请运行 `pip install --upgrade gradio` 升级Gradio版本。 - **页面显示问题**: 如果网页打开空白或显示异常,请运行 `pip install --upgrade gradio` 升级Gradio版本。
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment