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
| license: apache-2.0 | |
| tags: | |
| - diffusion-single-file | |
| - comfyui | |
| - distillation | |
| - NVFP4 | |
| - video | |
| - video genration | |
| base_model: | |
| - Wan-AI/Wan2.1-T2V-1.3B | |
| - gdhe17/Self-Forcing | |
| pipeline_tags: | |
| - text-to-video | |
| library_name: diffusers | |
| # π¬ Self-Forcing-NVFP4-4Steps Models | |
| > **NVFP4 Quantization-Aware Step Distillation for Blackwell Architecture** | |
| [](https://github.com/ModelTC/LightX2V) | |
| [](https://huggingface.co/lightx2v/) | |
| ## π Table of Contents | |
| - [β¨ Features](#-features) | |
| - [π Quick Start](#-quick-start) | |
| - [π¬ Generation Results](#-generation-results) | |
| - [π¦ Installation](#-installation) | |
| - [π οΈ Usage](#-usage) | |
| - [π§ Project Structure](#-project-structure) | |
| - [β οΈ Notes](#οΈ-notes) | |
| - [π€ Community](#-community) | |
| ## β¨ Features | |
| - **β‘ 4-Step Inference**: Dramatically accelerated end-to-end generation approaching real-time performance (tested on RTX 5090 single GPU) | |
| - **π― NVFP4 Quantization**: Reduced memory and bandwidth usage, optimized for Blackwell architecture | |
| - **π§ LightX2V Integration**: Optimal performance and stability on the official framework | |
| - **π High-Quality Generation**: Maintains Self-Forcing's superior video quality while achieving unprecedented speed | |
| ## π Quick Start | |
| ```bash | |
| # 1. Install LightX2V | |
| git clone https://github.com/ModelTC/LightX2V.git | |
| cd LightX2V | |
| uv pip install -v . | |
| # 2. Install NVFP4 Kernel | |
| pip install scikit_build_core uv | |
| git clone https://github.com/NVIDIA/cutlass.git | |
| cd lightx2v_kernel | |
| MAX_JOBS=$(nproc) CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) \ | |
| uv build --wheel \ | |
| -Cbuild-dir=build . \ | |
| -Ccmake.define.CUTLASS_PATH=/path/to/cutlass \ | |
| --verbose --color=always --no-build-isolation | |
| pip install dist/*whl --force-reinstall --no-deps | |
| # 3. Run inference | |
| # config | |
| https://github.com/ModelTC/LightX2V/blob/main/configs/self_forcing/wan_t2v_sf_nvfp4.json | |
| ``` | |
| ## π¬ Generation Results | |
| <div style="background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin: 16px 0;"> | |
| <p style="font-style: italic; color: #475569; margin: 0; padding: 12px; background: white; border-radius: 6px; border-left: 4px solid #3b82f6;"> | |
| "A leprechaun, with green hat and traditional Irish attire, standing in a lush forest filled with vib..." | |
| </p> | |
| </div> | |
| <table style="width: 100%; border-collapse: collapse; margin: 20px 0;"> | |
| <tr> | |
| <th style="text-align: center; padding: 12px; background: #f1f5f9; border: 1px solid #e2e8f0; font-weight: 600;">Self-Forcing-1.3B-BF16</th> | |
| <th style="text-align: center; padding: 12px; background: #f1f5f9; border: 1px solid #e2e8f0; font-weight: 600;">Self-Forcing-1.3B-NVFP4</th> | |
| </tr> | |
| <tr> | |
| <td style="text-align: center; padding: 12px; border: 1px solid #e2e8f0;"> | |
| <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> | |
| </td> | |
| <td style="text-align: center; padding: 12px; border: 1px solid #e2e8f0;"> | |
| <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> | |
| </td> | |
| </tr> | |
| </table> | |
| <div style="background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin: 16px 0;"> | |
| <p style="font-style: italic; color: #475569; margin: 0; padding: 12px; background: white; border-radius: 6px; border-left: 4px solid #10b981;"> | |
| "A mystical and spiritual scene filled with loving energy emanating from the heavens. The sky is bath..." | |
| </p> | |
| </div> | |
| | Self-Forcing-1.3B-BF16 | Self-Forcing-1.3B-NVFP4 | | |
| | --- | --- | | |
| | <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> | | |
| ## β οΈ Notes | |
| ### System Requirements | |
| - **Required Hardware**: NVIDIA RTX 50-series GPUs (RTX 5090/5080/5070/5060) or other Blackwell architecture GPUs | |
| ### Dependencies | |
| - Prepare T5 / CLIP / VAE components yourself (same as Self-Forcing structure) | |
| ### Performance Tips | |
| - Use Blackwell + NVFP4 for best performance | |
| - Enable CPU offload for GPUs with limited memory | |
| ## π€ Community | |
| - **π Issues**: [GitHub Issues](https://github.com/ModelTC/LightX2V/issues) | |
| - **π€ Models**: [HuggingFace Hub](https://huggingface.co/lightx2v/) | |
| - **π Documentation**: [LightX2V Docs](https://github.com/ModelTC/LightX2V) | |
| --- | |
| <div align="center"> | |
| **If you find this project helpful, please give us a β on [GitHub](https://github.com/ModelTC/LightX2V)** | |
| </div> |