README_zh.md 8.81 KB
Newer Older
Harahan's avatar
Harahan committed
1
<div align="center" style="font-family: charter;">
gushiqiao's avatar
gushiqiao committed
2
  <h1>⚡️ LightX2V:<br> 轻量级视频生成推理框架</h1>
Harahan's avatar
Harahan committed
3
4
5
6
7
8
9

<img alt="logo" src="assets/img_lightx2v.png" width=75%></img>

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/ModelTC/lightx2v)
[![Doc](https://img.shields.io/badge/docs-English-99cc2)](https://lightx2v-en.readthedocs.io/en/latest)
[![Doc](https://img.shields.io/badge/文档-中文-99cc2)](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest)
helloyongyang's avatar
helloyongyang committed
10
[![Papers](https://img.shields.io/badge/论文集-中文-99cc2)](https://lightx2v-papers-zhcn.readthedocs.io/zh-cn/latest)
Harahan's avatar
Harahan committed
11
12
[![Docker](https://badgen.net/badge/icon/docker?icon=docker&label)](https://hub.docker.com/r/lightx2v/lightx2v/tags)

helloyongyang's avatar
helloyongyang committed
13
14
**\[ [English](README.md) | 中文 \]**

Harahan's avatar
Harahan committed
15
16
</div>

helloyongyang's avatar
helloyongyang committed
17
18
--------------------------------------------------------------------------------

gushiqiao's avatar
gushiqiao committed
19
20
**LightX2V** 是一个先进的轻量级视频生成推理框架,专为提供高效、高性能的视频合成解决方案而设计。该统一平台集成了多种前沿的视频生成技术,支持文本生成视频(T2V)和图像生成视频(I2V)等多样化生成任务。**X2V 表示将不同的输入模态(X,如文本或图像)转换为视频输出(V)**

helloyongyang's avatar
helloyongyang committed
21
22
23
24
## 💡 快速开始

详细使用说明请参考我们的文档:**[英文文档](https://lightx2v-en.readthedocs.io/en/latest/) | [中文文档](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/)**

gushiqiao's avatar
gushiqiao committed
25
## 🤖 支持的模型生态
Harahan's avatar
Harahan committed
26

gushiqiao's avatar
gushiqiao committed
27
28
29
### 官方开源模型
-[HunyuanVideo](https://huggingface.co/tencent/HunyuanVideo)
-[Wan2.1](https://huggingface.co/Wan-AI/)
Harahan's avatar
Harahan committed
30
31
32
-[SkyReels-V2-DF](https://huggingface.co/Skywork/SkyReels-V2-DF-14B-540P)
-[CogVideoX1.5-5B-T2V](https://huggingface.co/THUDM/CogVideoX1.5-5B)

gushiqiao's avatar
gushiqiao committed
33
34
35
36
37
38
39
40
41
42
43
### 量化模型
-[Wan2.1-T2V-1.3B-Lightx2v](https://huggingface.co/lightx2v/Wan2.1-T2V-1.3B-Lightx2v)
-[Wan2.1-T2V-14B-Lightx2v](https://huggingface.co/lightx2v/Wan2.1-T2V-14B-Lightx2v)
-[Wan2.1-I2V-14B-480P-Lightx2v](https://huggingface.co/lightx2v/Wan2.1-I2V-14B-480P-Lightx2v)
-[Wan2.1-I2V-14B-720P-Lightx2v](https://huggingface.co/lightx2v/Wan2.1-I2V-14B-720P-Lightx2v)

### 蒸馏模型 (**🚀 推荐:4步推理**)
-[Wan2.1-T2V-14B-StepDistill-CfgDistill-Lightx2v](https://huggingface.co/lightx2v/Wan2.1-T2V-14B-StepDistill-CfgDistill-Lightx2v)
-[Wan2.1-I2V-14B-480P-StepDistill-CfgDistill-Lightx2v](https://huggingface.co/lightx2v/Wan2.1-I2V-14B-480P-StepDistill-CfgDistill-Lightx2v)
-[Wan2.1-I2V-14B-720P-StepDistill-CfgDistill-Lightx2v](https://huggingface.co/lightx2v/Wan2.1-I2V-14B-720P-StepDistill-CfgDistill-Lightx2v)

helloyongyang's avatar
helloyongyang committed
44
45
🔔 可以关注我们的[HuggingFace主页](https://huggingface.co/lightx2v),及时获取我们团队的模型。

gushiqiao's avatar
gushiqiao committed
46
47
48
### 自回归模型
-[Wan2.1-T2V-CausVid](https://huggingface.co/lightx2v/Wan2.1-T2V-14B-CausVid)

gushiqiao's avatar
gushiqiao committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
## 🚀 前端展示

我们提供了多种前端界面部署方式:

- **🎨 Gradio界面**: 简洁易用的Web界面,适合快速体验和原型开发
  - 📖 [Gradio部署文档](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/deploy_gradio.html)
- **🎯 ComfyUI界面**: 强大的节点式工作流界面,支持复杂的视频生成任务
  - 📖 [ComfyUI部署文档](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/deploy_comfyui.html)
- **🚀 Windows一键部署**: 专为Windows用户设计的便捷部署方案,支持自动环境配置和智能参数优化
  - 📖 [Windows一键部署文档](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/deploy_local_windows.html)

**💡 推荐方案**:
- **首次使用**: 建议选择Windows一键部署方案
- **高级用户**: 推荐使用ComfyUI界面获得更多自定义选项
- **快速体验**: Gradio界面提供最直观的操作体验

gushiqiao's avatar
gushiqiao committed
65
66
67
## 🚀 核心特性

### 🎯 **极致性能优化**
gushiqiao's avatar
gushiqiao committed
68
- **🔥 SOTA推理速度**: 通过步数蒸馏和系统优化实现**20倍**极速加速(单GPU)
gushiqiao's avatar
gushiqiao committed
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
- **⚡️ 革命性4步蒸馏**: 将原始40-50步推理压缩至仅需4步,且无需CFG配置
- **🛠️ 先进算子支持**: 集成顶尖算子,包括[Sage Attention](https://github.com/thu-ml/SageAttention)[Flash Attention](https://github.com/Dao-AILab/flash-attention)[Radial Attention](https://github.com/mit-han-lab/radial-attention)[q8-kernel](https://github.com/KONAKONA666/q8_kernels)[sgl-kernel](https://github.com/sgl-project/sglang/tree/main/sgl-kernel)[vllm](https://github.com/vllm-project/vllm)

### 💾 **资源高效部署**
- **💡 突破硬件限制**: **仅需8GB显存 + 16GB内存**即可运行14B模型生成480P/720P视频
- **🔧 智能参数卸载**: 先进的磁盘-CPU-GPU三级卸载架构,支持阶段/块级别的精细化管理
- **⚙️ 全面量化支持**: 支持`w8a8-int8``w8a8-fp8``w4a4-nvfp4`等多种量化策略

### 🎨 **丰富功能生态**
- **📈 智能特征缓存**: 智能缓存机制,消除冗余计算,提升效率
- **🔄 并行推理加速**: 多GPU并行处理,显著提升性能表现
- **📱 灵活部署选择**: 支持Gradio、服务化部署、ComfyUI等多种部署方式
- **🎛️ 动态分辨率推理**: 自适应分辨率调整,优化生成质量


gushiqiao's avatar
gushiqiao committed
84
85
86
87
88
## 🏆 性能基准测试

详细的性能指标和对比分析,请参考我们的[基准测试文档](https://github.com/ModelTC/LightX2V/blob/main/docs/ZH_CN/source/getting_started/benchmark_source.md)

[详细服务部署指南 →](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/deploy_service.html)
Harahan's avatar
Harahan committed
89

gushiqiao's avatar
gushiqiao committed
90
## 📚 技术文档
Harahan's avatar
Harahan committed
91

gushiqiao's avatar
gushiqiao committed
92
93
94
95
96
97
### 📖 **方法教程**
- [模型量化](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/method_tutorials/quantization.html) - 量化策略全面指南
- [特征缓存](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/method_tutorials/cache.html) - 智能缓存机制详解
- [注意力机制](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/method_tutorials/attention.html) - 前沿注意力算子
- [参数卸载](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/method_tutorials/offload.html) - 三级存储架构
- [并行推理](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/method_tutorials/parallel.html) - 多GPU加速策略
helloyongyang's avatar
helloyongyang committed
98
- [变分辨率推理](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/method_tutorials/changing_resolution.html) - U型分辨率策略
gushiqiao's avatar
gushiqiao committed
99
- [步数蒸馏](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/method_tutorials/step_distill.html) - 4步推理技术
PengGao's avatar
PengGao committed
100
- [视频帧插值](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/method_tutorials/video_frame_interpolation.html) - 基于RIFE的帧插值技术
gushiqiao's avatar
gushiqiao committed
101
102
103
104
105
106

### 🛠️ **部署指南**
- [低资源场景部署](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/for_low_resource.html) - 优化的8GB显存解决方案
- [低延迟场景部署](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/for_low_latency.html) - 极速推理优化
- [Gradio部署](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/deploy_gradio.html) - Web界面搭建
- [服务化部署](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/deploy_service.html) - 生产级API服务部署
helloyongyang's avatar
helloyongyang committed
107
- [Lora模型部署](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/deploy_guides/lora_deploy.html) - Lora灵活部署
gushiqiao's avatar
gushiqiao committed
108
109
110
111
112
113
114

## 🧾 代码贡献指南

我们通过自动化的预提交钩子来保证代码质量,确保项目代码格式的一致性。

> [!TIP]
> **安装说明:**
Harahan's avatar
Harahan committed
115
>
gushiqiao's avatar
gushiqiao committed
116
> 1. 安装必要的依赖:
Harahan's avatar
Harahan committed
117
118
> ```shell
> pip install ruff pre-commit
gushiqiao's avatar
gushiqiao committed
119
> ```
Harahan's avatar
Harahan committed
120
>
gushiqiao's avatar
gushiqiao committed
121
> 2. 提交前运行:
Harahan's avatar
Harahan committed
122
123
> ```shell
> pre-commit run --all-files
gushiqiao's avatar
gushiqiao committed
124
> ```
Harahan's avatar
Harahan committed
125

gushiqiao's avatar
gushiqiao committed
126
感谢您为LightX2V的改进做出贡献!
Harahan's avatar
Harahan committed
127
128
129

## 🤝 致谢

gushiqiao's avatar
gushiqiao committed
130
我们向所有启发和促进LightX2V开发的模型仓库和研究社区表示诚挚的感谢。此框架基于开源社区的集体努力而构建。
Harahan's avatar
Harahan committed
131

gushiqiao's avatar
gushiqiao committed
132
## 🌟 Star 历史
Harahan's avatar
Harahan committed
133
134
135
136
137

[![Star History Chart](https://api.star-history.com/svg?repos=ModelTC/lightx2v&type=Timeline)](https://star-history.com/#ModelTC/lightx2v&Timeline)

## ✏️ 引用

gushiqiao's avatar
gushiqiao committed
138
如果您发现LightX2V对您的研究有用,请考虑引用我们的工作:
Harahan's avatar
Harahan committed
139
140
141

```bibtex
@misc{lightx2v,
gushiqiao's avatar
gushiqiao committed
142
 author = {LightX2V Contributors},
helloyongyang's avatar
helloyongyang committed
143
 title = {LightX2V: Light Video Generation Inference Framework},
gushiqiao's avatar
gushiqiao committed
144
145
146
147
 year = {2025},
 publisher = {GitHub},
 journal = {GitHub repository},
 howpublished = {\url{https://github.com/ModelTC/lightx2v}},
Harahan's avatar
Harahan committed
148
149
}
```
gushiqiao's avatar
gushiqiao committed
150
151
152
153
154
155
156
157
158
159
160
161

## 📞 联系与支持

如有任何问题、建议或需要支持,欢迎通过以下方式联系我们:
- 🐛 [GitHub Issues](https://github.com/ModelTC/lightx2v/issues) - 错误报告和功能请求
- 💬 [GitHub Discussions](https://github.com/ModelTC/lightx2v/discussions) - 社区讨论和问答

---

<div align="center">
由 LightX2V 团队用 ❤️ 构建
</div>