README.md 9.66 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> Lightweight Video Generation Inference Framework</h1>
helloyongyang's avatar
helloyongyang committed
3

Yang Yong(雍洋)'s avatar
Yang Yong(雍洋) committed
4
<img alt="logo" src="assets/img_lightx2v.png" width=75%></img>
helloyongyang's avatar
helloyongyang committed
5

helloyongyang's avatar
helloyongyang committed
6
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
PengGao's avatar
PengGao committed
7
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/ModelTC/lightx2v)
helloyongyang's avatar
helloyongyang committed
8
9
[![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)
helloyongyang's avatar
helloyongyang committed
11
[![Docker](https://badgen.net/badge/icon/docker?icon=docker&label)](https://hub.docker.com/r/lightx2v/lightx2v/tags)
PengGao's avatar
PengGao committed
12

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

helloyongyang's avatar
helloyongyang committed
15
16
17
</div>

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

gushiqiao's avatar
gushiqiao committed
19
**LightX2V** is an advanced lightweight video generation inference framework engineered to deliver efficient, high-performance video synthesis solutions. This unified platform integrates multiple state-of-the-art video generation techniques, supporting diverse generation tasks including text-to-video (T2V) and image-to-video (I2V). **X2V represents the transformation of different input modalities (X, such as text or images) into video output (V)**.
helloyongyang's avatar
helloyongyang committed
20

helloyongyang's avatar
helloyongyang committed
21
22
23
24
## 💡 Quick Start

For comprehensive usage instructions, please refer to our documentation: **[English Docs](https://lightx2v-en.readthedocs.io/en/latest/) | [中文文档](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/)**

helloyongyang's avatar
helloyongyang committed
25

gushiqiao's avatar
gushiqiao committed
26
27
28
29
## 🤖 Supported Model Ecosystem

### Official Open-Source Models
-[HunyuanVideo](https://huggingface.co/tencent/HunyuanVideo)
helloyongyang's avatar
helloyongyang committed
30
-[Wan2.1 & Wan2.2](https://huggingface.co/Wan-AI/)
Harahan's avatar
Harahan committed
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)
helloyongyang's avatar
helloyongyang committed
33

gushiqiao's avatar
gushiqiao committed
34
35
36
37
38
39
40
41
42
43
44
### Quantized Models
-[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)

### Distilled Models (**🚀 Recommended: 4-step inference**)
-[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
45
46
🔔 Follow our [HuggingFace page](https://huggingface.co/lightx2v) for the latest model releases from our team.

gushiqiao's avatar
gushiqiao committed
47
48
49
### Autoregressive Models
-[Wan2.1-T2V-CausVid](https://huggingface.co/lightx2v/Wan2.1-T2V-14B-CausVid)

gushiqiao's avatar
gushiqiao committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
## 🚀 Frontend Interfaces

We provide multiple frontend interface deployment options:

- **🎨 Gradio Interface**: Clean and user-friendly web interface, perfect for quick experience and prototyping
  - 📖 [Gradio Deployment Guide](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/deploy_gradio.html)
- **🎯 ComfyUI Interface**: Powerful node-based workflow interface, supporting complex video generation tasks
  - 📖 [ComfyUI Deployment Guide](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/deploy_comfyui.html)
- **🚀 Windows One-Click Deployment**: Convenient deployment solution designed for Windows users, featuring automatic environment configuration and intelligent parameter optimization
  - 📖 [Windows One-Click Deployment Guide](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/deploy_local_windows.html)

**💡 Recommended Solutions**:
- **First-time Users**: We recommend the Windows one-click deployment solution
- **Advanced Users**: We recommend the ComfyUI interface for more customization options
- **Quick Experience**: The Gradio interface provides the most intuitive operation experience
gushiqiao's avatar
gushiqiao committed
65
66
67
68

## 🚀 Core Features

### 🎯 **Ultimate Performance Optimization**
gushiqiao's avatar
gushiqiao committed
69
- **🔥 SOTA Inference Speed**: Achieve **~20x** acceleration via step distillation and system optimization (single GPU)
gushiqiao's avatar
gushiqiao committed
70
71
72
73
74
75
76
77
78
79
80
81
82
- **⚡️ Revolutionary 4-Step Distillation**: Compress original 40-50 step inference to just 4 steps without CFG requirements
- **🛠️ Advanced Operator Support**: Integrated with cutting-edge operators including [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)

### 💾 **Resource-Efficient Deployment**
- **💡 Breaking Hardware Barriers**: Run 14B models for 480P/720P video generation with only **8GB VRAM + 16GB RAM**
- **🔧 Intelligent Parameter Offloading**: Advanced disk-CPU-GPU three-tier offloading architecture with phase/block-level granular management
- **⚙️ Comprehensive Quantization**: Support for `w8a8-int8`, `w8a8-fp8`, `w4a4-nvfp4` and other quantization strategies

### 🎨 **Rich Feature Ecosystem**
- **📈 Smart Feature Caching**: Intelligent caching mechanisms to eliminate redundant computations
- **🔄 Parallel Inference**: Multi-GPU parallel processing for enhanced performance
- **📱 Flexible Deployment Options**: Support for Gradio, service deployment, ComfyUI and other deployment methods
- **🎛️ Dynamic Resolution Inference**: Adaptive resolution adjustment for optimal generation quality
PengGao's avatar
PengGao committed
83
- **🎞️ Video Frame Interpolation**: RIFE-based frame interpolation for smooth frame rate enhancement
gushiqiao's avatar
gushiqiao committed
84
85


gushiqiao's avatar
gushiqiao committed
86
87
88
89
90
91
92
93
94
95
96
97
98
99
## 🏆 Performance Benchmarks

For detailed performance metrics and comparisons, please refer to our [benchmark documentation](https://github.com/ModelTC/LightX2V/blob/main/docs/EN/source/getting_started/benchmark_source.md).

[Detailed Service Deployment Guide →](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/deploy_service.html)

## 📚 Technical Documentation

### 📖 **Method Tutorials**
- [Model Quantization](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/quantization.html) - Comprehensive guide to quantization strategies
- [Feature Caching](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/cache.html) - Intelligent caching mechanisms
- [Attention Mechanisms](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/attention.html) - State-of-the-art attention operators
- [Parameter Offloading](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/offload.html) - Three-tier storage architecture
- [Parallel Inference](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/parallel.html) - Multi-GPU acceleration strategies
helloyongyang's avatar
helloyongyang committed
100
- [Changing Resolution Inference](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/changing_resolution.html) - U-shaped resolution strategy
gushiqiao's avatar
gushiqiao committed
101
- [Step Distillation](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/step_distill.html) - 4-step inference technology
helloyongyang's avatar
helloyongyang committed
102
- [Video Frame Interpolation](https://lightx2v-en.readthedocs.io/en/latest/method_tutorials/video_frame_interpolation.html) - Base on the RIFE technology
gushiqiao's avatar
gushiqiao committed
103
104
105
106
107
108

### 🛠️ **Deployment Guides**
- [Low-Resource Deployment](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/for_low_resource.html) - Optimized 8GB VRAM solutions
- [Low-Latency Deployment](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/for_low_latency.html) - Ultra-fast inference optimization
- [Gradio Deployment](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/deploy_gradio.html) - Web interface setup
- [Service Deployment](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/deploy_service.html) - Production API service deployment
helloyongyang's avatar
helloyongyang committed
109
- [Lora Model Deployment](https://lightx2v-en.readthedocs.io/en/latest/deploy_guides/lora_deploy.html) - Flexible Lora deployment
helloyongyang's avatar
helloyongyang committed
110

Harahan's avatar
Harahan committed
111
## 🧾 Contributing Guidelines
helloyongyang's avatar
helloyongyang committed
112

gushiqiao's avatar
gushiqiao committed
113
We maintain code quality through automated pre-commit hooks to ensure consistent formatting across the project.
helloyongyang's avatar
helloyongyang committed
114

Harahan's avatar
Harahan committed
115
> [!TIP]
gushiqiao's avatar
gushiqiao committed
116
> **Setup Instructions:**
Harahan's avatar
Harahan committed
117
>
gushiqiao's avatar
gushiqiao committed
118
> 1. Install required dependencies:
Harahan's avatar
Harahan committed
119
120
> ```shell
> pip install ruff pre-commit
gushiqiao's avatar
gushiqiao committed
121
> ```
Harahan's avatar
Harahan committed
122
>
gushiqiao's avatar
gushiqiao committed
123
> 2. Run before committing:
Harahan's avatar
Harahan committed
124
125
> ```shell
> pre-commit run --all-files
gushiqiao's avatar
gushiqiao committed
126
> ```
Dongz's avatar
Dongz committed
127

gushiqiao's avatar
gushiqiao committed
128
We appreciate your contributions to making LightX2V better!
Dongz's avatar
Dongz committed
129

Harahan's avatar
Harahan committed
130
## 🤝 Acknowledgments
Dongz's avatar
Dongz committed
131

gushiqiao's avatar
gushiqiao committed
132
We extend our gratitude to all the model repositories and research communities that inspired and contributed to the development of LightX2V. This framework builds upon the collective efforts of the open-source community.
Dongz's avatar
Dongz committed
133

Harahan's avatar
Harahan committed
134
## 🌟 Star History
Dongz's avatar
Dongz committed
135

gushiqiao's avatar
gushiqiao committed
136
[![Star History Chart](https://api.star-history.com/svg?repos=ModelTC/lightx2v&type=Timeline)](https://star-history.com/#ModelTC/lightx2v&Timeline)
helloyongyang's avatar
helloyongyang committed
137

Harahan's avatar
Harahan committed
138
## ✏️ Citation
helloyongyang's avatar
helloyongyang committed
139

gushiqiao's avatar
gushiqiao committed
140
If you find LightX2V useful in your research, please consider citing our work:
helloyongyang's avatar
helloyongyang committed
141

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

## 📞 Contact & Support

For questions, suggestions, or support, please feel free to reach out through:
- 🐛 [GitHub Issues](https://github.com/ModelTC/lightx2v/issues) - Bug reports and feature requests
- 💬 [GitHub Discussions](https://github.com/ModelTC/lightx2v/discussions) - Community discussions and Q&A

---

<div align="center">
Built with ❤️ by the LightX2V team
</div>