Instructions to use lightx2v/Self-Forcing-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use lightx2v/Self-Forcing-NVFP4 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("lightx2v/Self-Forcing-NVFP4", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Diffusion Single File
How to use lightx2v/Self-Forcing-NVFP4 with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,10 +1,127 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
| 3 |
-
base_model: Wan-AI/Wan2.1-T2V-1.3B-Diffusers
|
| 4 |
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
- text-to-video
|
| 6 |
-
- video-generation
|
| 7 |
-
- diffusers
|
| 8 |
library_name: diffusers
|
| 9 |
-
|
| 10 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
|
|
|
| 3 |
tags:
|
| 4 |
+
- diffusion-single-file
|
| 5 |
+
- comfyui
|
| 6 |
+
- distillation
|
| 7 |
+
- NVFP4
|
| 8 |
+
- video
|
| 9 |
+
- video genration
|
| 10 |
+
base_model:
|
| 11 |
+
- Wan-AI/Wan2.1-T2V-1.3B
|
| 12 |
+
- gdhe17/Self-Forcing
|
| 13 |
+
pipeline_tags:
|
| 14 |
- text-to-video
|
|
|
|
|
|
|
| 15 |
library_name: diffusers
|
| 16 |
+
---
|
| 17 |
+
# π¬ Self-Forcing-NVFP4-4Steps Models
|
| 18 |
+
|
| 19 |
+
> **NVFP4 Quantization-Aware Step Distillation for Blackwell Architecture**
|
| 20 |
+
|
| 21 |
+
[](https://github.com/ModelTC/LightX2V)
|
| 22 |
+
[](https://huggingface.co/lightx2v/)
|
| 23 |
+
|
| 24 |
+
## π Table of Contents
|
| 25 |
+
|
| 26 |
+
- [β¨ Features](#-features)
|
| 27 |
+
- [π Quick Start](#-quick-start)
|
| 28 |
+
- [π¬ Generation Results](#-generation-results)
|
| 29 |
+
- [π¦ Installation](#-installation)
|
| 30 |
+
- [π οΈ Usage](#-usage)
|
| 31 |
+
- [π§ Project Structure](#-project-structure)
|
| 32 |
+
- [β οΈ Notes](#οΈ-notes)
|
| 33 |
+
- [π€ Community](#-community)
|
| 34 |
+
|
| 35 |
+
## β¨ Features
|
| 36 |
+
|
| 37 |
+
- **β‘ 4-Step Inference**: Dramatically accelerated end-to-end generation approaching real-time performance (tested on RTX 5090 single GPU)
|
| 38 |
+
- **π― NVFP4 Quantization**: Reduced memory and bandwidth usage, optimized for Blackwell architecture
|
| 39 |
+
- **π§ LightX2V Integration**: Optimal performance and stability on the official framework
|
| 40 |
+
- **π High-Quality Generation**: Maintains Self-Forcing's superior video quality while achieving unprecedented speed
|
| 41 |
+
|
| 42 |
+
## π Quick Start
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
# 1. Install LightX2V
|
| 46 |
+
git clone https://github.com/ModelTC/LightX2V.git
|
| 47 |
+
cd LightX2V
|
| 48 |
+
uv pip install -v .
|
| 49 |
+
|
| 50 |
+
# 2. Install NVFP4 Kernel
|
| 51 |
+
pip install scikit_build_core uv
|
| 52 |
+
git clone https://github.com/NVIDIA/cutlass.git
|
| 53 |
+
cd lightx2v_kernel
|
| 54 |
+
|
| 55 |
+
MAX_JOBS=$(nproc) CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) \
|
| 56 |
+
uv build --wheel \
|
| 57 |
+
-Cbuild-dir=build . \
|
| 58 |
+
-Ccmake.define.CUTLASS_PATH=/path/to/cutlass \
|
| 59 |
+
--verbose --color=always --no-build-isolation
|
| 60 |
+
|
| 61 |
+
pip install dist/*whl --force-reinstall --no-deps
|
| 62 |
+
|
| 63 |
+
# 3. Run inference
|
| 64 |
+
# config
|
| 65 |
+
https://github.com/ModelTC/LightX2V/blob/main/configs/self_forcing/wan_t2v_sf_nvfp4.json
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
## π¬ Generation Results
|
| 69 |
+
|
| 70 |
+
<div style="background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin: 16px 0;">
|
| 71 |
+
<p style="font-style: italic; color: #475569; margin: 0; padding: 12px; background: white; border-radius: 6px; border-left: 4px solid #3b82f6;">
|
| 72 |
+
"A leprechaun, with green hat and traditional Irish attire, standing in a lush forest filled with vib..."
|
| 73 |
+
</p>
|
| 74 |
+
</div>
|
| 75 |
+
|
| 76 |
+
<table style="width: 100%; border-collapse: collapse; margin: 20px 0;">
|
| 77 |
+
<tr>
|
| 78 |
+
<th style="text-align: center; padding: 12px; background: #f1f5f9; border: 1px solid #e2e8f0; font-weight: 600;">Self-Forcing-1.3B-BF16</th>
|
| 79 |
+
<th style="text-align: center; padding: 12px; background: #f1f5f9; border: 1px solid #e2e8f0; font-weight: 600;">Self-Forcing-1.3B-NVFP4</th>
|
| 80 |
+
</tr>
|
| 81 |
+
|
| 82 |
+
<tr>
|
| 83 |
+
<td style="text-align: center; padding: 12px; border: 1px solid #e2e8f0;">
|
| 84 |
+
<video controls style="width: 260px; height: 180px; border-radius: 6px; object-fit: cover;" src="https://cdn-uploads.huggingface.co/production/uploads/680de13385293771bc57400b/YIoBk3b3CZh0HXSCbDAJB.mp4"></video>
|
| 85 |
+
</td>
|
| 86 |
+
<td style="text-align: center; padding: 12px; border: 1px solid #e2e8f0;">
|
| 87 |
+
<video controls style="width: 260px; height: 180px; border-radius: 6px; object-fit: cover;" src="https://cdn-uploads.huggingface.co/production/uploads/680de13385293771bc57400b/yDYFsVJfHBxVQ541SDxH8.mp4"></video>
|
| 88 |
+
</td>
|
| 89 |
+
</tr>
|
| 90 |
+
</table>
|
| 91 |
+
|
| 92 |
+
<div style="background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin: 16px 0;">
|
| 93 |
+
<p style="font-style: italic; color: #475569; margin: 0; padding: 12px; background: white; border-radius: 6px; border-left: 4px solid #10b981;">
|
| 94 |
+
"A mystical and spiritual scene filled with loving energy emanating from the heavens. The sky is bath..."
|
| 95 |
+
</p>
|
| 96 |
+
</div>
|
| 97 |
+
|
| 98 |
+
| Self-Forcing-1.3B-BF16 | Self-Forcing-1.3B-NVFP4 |
|
| 99 |
+
| --- | --- |
|
| 100 |
+
| <video controls style="width: 260px; height: 180px; border-radius: 6px; object-fit: cover;" src="https://cdn-uploads.huggingface.co/production/uploads/680de13385293771bc57400b/Bkbs_Ery2XpQUWp-X6aBX.mp4"></video> | <video controls style="width: 260px; height: 180px; border-radius: 6px; object-fit: cover;" src="https://cdn-uploads.huggingface.co/production/uploads/680de13385293771bc57400b/xFMNI2DBU7h11Inh0Nvn6.mp4"></video> |
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
## β οΈ Notes
|
| 104 |
+
|
| 105 |
+
### System Requirements
|
| 106 |
+
- **Required Hardware**: NVIDIA RTX 50-series GPUs (RTX 5090/5080/5070/5060) or other Blackwell architecture GPUs
|
| 107 |
+
|
| 108 |
+
### Dependencies
|
| 109 |
+
- Prepare T5 / CLIP / VAE components yourself (same as Self-Forcing structure)
|
| 110 |
+
|
| 111 |
+
### Performance Tips
|
| 112 |
+
- Use Blackwell + NVFP4 for best performance
|
| 113 |
+
- Enable CPU offload for GPUs with limited memory
|
| 114 |
+
|
| 115 |
+
## π€ Community
|
| 116 |
+
|
| 117 |
+
- **π Issues**: [GitHub Issues](https://github.com/ModelTC/LightX2V/issues)
|
| 118 |
+
- **π€ Models**: [HuggingFace Hub](https://huggingface.co/lightx2v/)
|
| 119 |
+
- **π Documentation**: [LightX2V Docs](https://github.com/ModelTC/LightX2V)
|
| 120 |
+
|
| 121 |
+
---
|
| 122 |
+
|
| 123 |
+
<div align="center">
|
| 124 |
+
|
| 125 |
+
**If you find this project helpful, please give us a β on [GitHub](https://github.com/ModelTC/LightX2V)**
|
| 126 |
+
|
| 127 |
+
</div>
|