Polish model card: badges, efficiency table, architecture, checkpoint docs, args, news/TODO, contact
Browse files
README.md
CHANGED
|
@@ -1,53 +1,159 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
pipeline_tag: text-to-video
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
|
| 7 |
|
| 8 |
-
|
| 9 |
|
| 10 |
-
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
|
| 17 |
-
2. **Causal Streaming Latent Upsampler** (~2M params, <5% overhead) for spatiotemporal coherence.
|
| 18 |
-
3. **Cascaded Streaming Optimization** (sparse distillation, DPO, and dynamic cache management).
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
-
- **Self-Forcing Generator**: Based on Wan2.1-1.3B, producing 480P streaming latents.
|
| 24 |
-
- **Causal Latent Upsampler**: Performs 2x or 3x spatial upsampling in the latent space.
|
| 25 |
-
- **Sparse SR DiT**: Refines high-resolution latents using single-step denoising and block-sparse attention.
|
| 26 |
-
- **Tiny Decoder**: A causal memory network for efficient latent-to-pixel decoding at 1K/2K.
|
| 27 |
|
| 28 |
-
##
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
```bash
|
| 33 |
conda create -n ultraflash python=3.10 -y
|
| 34 |
conda activate ultraflash
|
| 35 |
-
|
|
|
|
| 36 |
pip install -r requirements.txt
|
| 37 |
pip install flash-attn --no-build-isolation
|
| 38 |
|
| 39 |
# Block Sparse Attention (CUDA kernel, required for SR DiT)
|
| 40 |
git clone https://github.com/mit-han-lab/Block-Sparse-Attention.git
|
| 41 |
-
cd Block-Sparse-Attention
|
| 42 |
-
|
|
|
|
| 43 |
```
|
| 44 |
|
| 45 |
-
|
| 46 |
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
```bash
|
| 50 |
-
cd inference
|
| 51 |
python inference.py \
|
| 52 |
--config_path configs/self_forcing_dmd_4step.yaml \
|
| 53 |
--checkpoint_path checkpoints/self_forcing_dmd.pt \
|
|
@@ -59,7 +165,80 @@ python inference.py \
|
|
| 59 |
--compile_sr_dit
|
| 60 |
```
|
| 61 |
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
```bibtex
|
| 65 |
@inproceedings{luxury2026ultraflash,
|
|
@@ -68,4 +247,10 @@ python inference.py \
|
|
| 68 |
booktitle={arXiv preprint},
|
| 69 |
year={2026}
|
| 70 |
}
|
| 71 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
pipeline_tag: text-to-video
|
| 4 |
+
tags:
|
| 5 |
+
- text-to-video
|
| 6 |
+
- video-generation
|
| 7 |
+
- streaming
|
| 8 |
+
- real-time
|
| 9 |
+
- video-super-resolution
|
| 10 |
+
- autoregressive
|
| 11 |
+
- diffusion
|
| 12 |
+
- sparse-attention
|
| 13 |
+
language:
|
| 14 |
+
- en
|
| 15 |
+
base_model: Wan-AI/Wan2.1-T2V-1.3B
|
| 16 |
---
|
| 17 |
|
| 18 |
+
<div align="center">
|
| 19 |
|
| 20 |
+
# β‘ Ultra Flash
|
| 21 |
|
| 22 |
+
### Scaling Real-Time Streaming Video Generation to High Resolutions
|
| 23 |
|
| 24 |
+
<a href="https://huggingface.co/papers/2606.09150"><img src="https://img.shields.io/badge/Paper-arXiv-B31B1B?style=for-the-badge&logo=arxiv" alt="Paper"></a>
|
| 25 |
+
<a href="https://xin1u.github.io/UltraFlash/"><img src="https://img.shields.io/badge/Project-Page-2563EB?style=for-the-badge" alt="Project Page"></a>
|
| 26 |
+
<a href="https://github.com/xin1u/UltraFlash"><img src="https://img.shields.io/badge/Code-GitHub-181717?style=for-the-badge&logo=github" alt="Code"></a>
|
| 27 |
+
<a href="https://huggingface.co/xin1u/UltraFlash"><img src="https://img.shields.io/badge/%F0%9F%A4%97%20Models-UltraFlash-FFD21E?style=for-the-badge" alt="Models"></a>
|
| 28 |
|
| 29 |
+
**~30 FPS at 1K** Β· **~18 FPS at 2K** Β· **Single GPU** Β· **4 Steps**
|
| 30 |
|
| 31 |
+
</div>
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
---
|
| 34 |
+
|
| 35 |
+
## π Overview
|
| 36 |
+
|
| 37 |
+
While recent autoregressive video diffusion models achieve remarkable streaming quality, they remain **confined to low resolutions** (e.g. 480P), leaving efficient, scalable, real-time high-resolution video generation a fundamental open challenge.
|
| 38 |
+
|
| 39 |
+
**Ultra Flash** is the first framework to achieve **real-time high-resolution streaming video generation**, producing **1K video at ~30 FPS** and **2K video at ~18 FPS** on a single GPU. It cascades three key components after a low-resolution streaming generator:
|
| 40 |
+
|
| 41 |
+
| | Contribution | What it does |
|
| 42 |
+
|---|---|---|
|
| 43 |
+
| **1** | **Architecture-Preserving T2V-to-TV2V SR Training** | Converts any pre-trained T2V model into a generative super-resolution model without architectural modification, paired with an AIGC-oriented degradation pipeline that preserves the base model's generative capability. |
|
| 44 |
+
| **2** | **Causal Streaming Latent Upsampler** | Ultralight causal memory network (~2M params) that upsamples latents with spatiotemporal coherence, adding **<5%** pipeline overhead. |
|
| 45 |
+
| **3** | **Cascaded Streaming Optimization** | Hybrid-reward-enhanced sparse causalization + single-step distillation, then cascaded streaming self-forcing preference optimization (DPO) with dynamic cache management. |
|
| 46 |
+
|
| 47 |
+
---
|
| 48 |
+
|
| 49 |
+
## π Efficiency
|
| 50 |
+
|
| 51 |
+
| Method | Resolution | Steps | FPS β | Latency (ms) β | Streaming |
|
| 52 |
+
|---|---|---|---|---|---|
|
| 53 |
+
| Wan2.1 | 480Γ832 | 50 | 0.78 | 103,000 | β |
|
| 54 |
+
| CausVid | 480Γ832 | 4 | 29.4 | 34 | β |
|
| 55 |
+
| Self Forcing | 480Γ832 | 4 | 32.0 | 31 | β |
|
| 56 |
+
| Causal Forcing | 480Γ832 | 4 | 31.2 | 32 | β |
|
| 57 |
+
| DummyForcing | 480Γ832 | 4 | 28.0 | 36 | β |
|
| 58 |
+
| Self Forcing + FlashVSR | 768Γ1408 | 5 | 15.0 | 67 | β |
|
| 59 |
+
| **Ultra Flash (Ours)** | **960Γ1664 (1K)** | 4 | **30.0** | **40** | β |
|
| 60 |
+
| **Ultra Flash (Ours)** | **1440Γ2496 (2K)** | 4 | 18.0 | 56 | β |
|
| 61 |
|
| 62 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
+
## ποΈ Architecture
|
| 65 |
|
| 66 |
+
```
|
| 67 |
+
Text Prompt
|
| 68 |
+
β
|
| 69 |
+
βΌ
|
| 70 |
+
ββββββββββββββββββββββββββββ
|
| 71 |
+
β Self-Forcing Generator β 480P, 4 denoising steps, streaming
|
| 72 |
+
β (Wan2.1-1.3B causal) β
|
| 73 |
+
βββββββββββββ¬βββββββββββββββ
|
| 74 |
+
β LR latents (16Γ60Γ104)
|
| 75 |
+
βΌ
|
| 76 |
+
ββββββββββββββββββββββββββββ
|
| 77 |
+
β Causal Latent Upsampler β 2Γ or 3Γ spatial upsampling in latent space
|
| 78 |
+
β (~2M params, Conv2D) β Causal memory for temporal coherence
|
| 79 |
+
βββββββββββββ¬βββββββββββββββ
|
| 80 |
+
β HR latents (16Γ120Γ208)
|
| 81 |
+
βΌ
|
| 82 |
+
ββββββββββββββββββββββββββββ
|
| 83 |
+
β Sparse SR DiT β Single-step denoising, block-sparse attention
|
| 84 |
+
β (1.3B, causal) β Adaptive top-k with local window
|
| 85 |
+
βββββββββββββ¬βββββββββββββββ
|
| 86 |
+
β Refined HR latents
|
| 87 |
+
βΌ
|
| 88 |
+
ββββββββββββββββββββββββββββ
|
| 89 |
+
β Tiny / Ultra Decoder β Latent β Pixel (960Γ1664 or 1440Γ2496)
|
| 90 |
+
β (Causal Memory Network) β Sequential streaming mode
|
| 91 |
+
βββββββββββββ¬βββββββββββββββ
|
| 92 |
+
βΌ
|
| 93 |
+
2K Video Output (~18 FPS)
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
---
|
| 97 |
+
|
| 98 |
+
## π¦ Checkpoints in This Repository
|
| 99 |
+
|
| 100 |
+
| File | Role |
|
| 101 |
+
|---|---|
|
| 102 |
+
| `1K-Causal-Sparse-SR-Dit-fidelity-step_12800.pth` | **1K sparse causal SR DiT** β single-step, block-sparse attention (main 1K model) |
|
| 103 |
+
| `2K-Causal-Sparse-SR-Dit-fidelity-step_12800.pth` | **2K sparse causal SR DiT** β single-step, block-sparse attention (main 2K model) |
|
| 104 |
+
| `1K-ultraLatentUpsampler-step_19900.pth` | Causal streaming latent upsampler for 1K |
|
| 105 |
+
| `2K-ultraLatentUpsampler-step_28100.pth` | Causal streaming latent upsampler for 2K |
|
| 106 |
+
| `ultra-decoder-v3-ema_decoder.pth` | Ultra Decoder V3 β high-resolution decoder with improved texture fidelity |
|
| 107 |
+
| `v1.1-ultra-decoder-v3-ema_decoder.pth` | Ultra Decoder V3 (v1.1 revision) |
|
| 108 |
+
| `1K-Bi-Dense-SR-Dit-fidelity-step_12800.pth` | Bidirectional dense SR DiT β **ablation / reference** (non-causal) |
|
| 109 |
+
| `1K-teacher-NFE50-Dense-SR-Dit-fidelity-step_14700.pth` | NFE-50 dense teacher used for distillation β **research reference** |
|
| 110 |
+
|
| 111 |
+
> The base **Wan2.1-T2V-1.3B** generator is not redistributed here β download it from [`Wan-AI/Wan2.1-T2V-1.3B`](https://huggingface.co/Wan-AI/Wan2.1-T2V-1.3B).
|
| 112 |
+
|
| 113 |
+
---
|
| 114 |
+
|
| 115 |
+
## π Quick Start
|
| 116 |
+
|
| 117 |
+
### 1οΈβ£ Install
|
| 118 |
|
| 119 |
```bash
|
| 120 |
conda create -n ultraflash python=3.10 -y
|
| 121 |
conda activate ultraflash
|
| 122 |
+
|
| 123 |
+
git clone https://github.com/xin1u/UltraFlash.git && cd UltraFlash/inference
|
| 124 |
pip install -r requirements.txt
|
| 125 |
pip install flash-attn --no-build-isolation
|
| 126 |
|
| 127 |
# Block Sparse Attention (CUDA kernel, required for SR DiT)
|
| 128 |
git clone https://github.com/mit-han-lab/Block-Sparse-Attention.git
|
| 129 |
+
cd Block-Sparse-Attention && pip install -e . && cd ..
|
| 130 |
+
|
| 131 |
+
python setup.py develop
|
| 132 |
```
|
| 133 |
|
| 134 |
+
**Requirements:** NVIDIA GPU with 24+ GB memory (RTX 4090 / H200 / B200 tested) Β· Linux Β· 64 GB RAM Β· Python 3.10+
|
| 135 |
|
| 136 |
+
### 2οΈβ£ Download Checkpoints
|
| 137 |
+
|
| 138 |
+
```bash
|
| 139 |
+
# Base streaming generator
|
| 140 |
+
huggingface-cli download Wan-AI/Wan2.1-T2V-1.3B --local-dir inference/wan_models/Wan2.1-T2V-1.3B
|
| 141 |
+
|
| 142 |
+
# Ultra Flash checkpoints
|
| 143 |
+
huggingface-cli download xin1u/UltraFlash --local-dir inference/checkpoints
|
| 144 |
+
```
|
| 145 |
+
|
| 146 |
+
### 3οΈβ£ Generate
|
| 147 |
+
|
| 148 |
+
One-click inference (2K or 1K):
|
| 149 |
+
|
| 150 |
+
```bash
|
| 151 |
+
cd inference && bash inference.sh
|
| 152 |
+
```
|
| 153 |
+
|
| 154 |
+
Custom inference:
|
| 155 |
|
| 156 |
```bash
|
|
|
|
| 157 |
python inference.py \
|
| 158 |
--config_path configs/self_forcing_dmd_4step.yaml \
|
| 159 |
--checkpoint_path checkpoints/self_forcing_dmd.pt \
|
|
|
|
| 165 |
--compile_sr_dit
|
| 166 |
```
|
| 167 |
|
| 168 |
+
LR-only mode (480P, for comparison): add `--lr_only` and drop the SR flags.
|
| 169 |
+
|
| 170 |
+
---
|
| 171 |
+
|
| 172 |
+
## βοΈ Key Arguments
|
| 173 |
+
|
| 174 |
+
| Argument | Default | Description |
|
| 175 |
+
|---|---|---|
|
| 176 |
+
| `--use_ema` | False | Load EMA weights (**recommended**) |
|
| 177 |
+
| `--num_output_frames` | 21 | Number of latent frames (~5s video at 21 frames) |
|
| 178 |
+
| `--torch_compile` | False | Compile SF DiT (~1.5Γ speedup) |
|
| 179 |
+
| `--compile_sr_dit` | False | Compile SR DiT |
|
| 180 |
+
| `--fp8` | False | FP8 quantization for SF DiT |
|
| 181 |
+
| `--tiny_decoder` | True | Fast HR decoding (faster than Wan VAE) |
|
| 182 |
+
| `--ultra_decoder_v3` | False | Use Ultra Decoder V3 (better texture, replaces Tiny Decoder) |
|
| 183 |
+
| `--sr_kv_len` | 3 | SR DiT KV cache window length |
|
| 184 |
+
| `--lr_only` | False | Only generate LR video (skip SR cascade) |
|
| 185 |
+
| `--dcm_adaptive_refresh` | False | Enable IQA-based adaptive cache refresh |
|
| 186 |
+
| `--no_dcm` | False | Disable all DCM optimizations |
|
| 187 |
+
|
| 188 |
+
### Dynamic Cache Management (DCM)
|
| 189 |
+
|
| 190 |
+
Three inference-time optimizations, all essentially free in quality:
|
| 191 |
+
|
| 192 |
+
| Optimization | Effect | Quality Impact |
|
| 193 |
+
|---|---|---|
|
| 194 |
+
| **(i) LR Step Reduction** | Saves 1 forward pass per chunk | Negligible |
|
| 195 |
+
| **(ii) Adaptive Cache Refresh** | Skips context rerun when quality suffices | Negligible |
|
| 196 |
+
| **(iii) SR Cache Adaptation** | Reduces SR KV cache memory over time | Minimal |
|
| 197 |
+
|
| 198 |
+
---
|
| 199 |
+
|
| 200 |
+
## π¬ Long Video Generation
|
| 201 |
+
|
| 202 |
+
The `inference_long/` directory supports ~10-second videos (120 latent frames) using **LongLive** with LoRA adapters and the same SR cascade:
|
| 203 |
+
|
| 204 |
+
```bash
|
| 205 |
+
cd inference_long
|
| 206 |
+
python inference_sr.py \
|
| 207 |
+
--config_path configs/longlive_inference_sr.yaml \
|
| 208 |
+
--use_sparse_sr --tiny_decoder --torch_compile --compile_sr_dit
|
| 209 |
+
```
|
| 210 |
+
|
| 211 |
+
---
|
| 212 |
+
|
| 213 |
+
## π° News
|
| 214 |
+
|
| 215 |
+
- **Aug 2026** β Inference code and checkpoints released on [GitHub](https://github.com/xin1u/UltraFlash) and Hugging Face. π
|
| 216 |
+
|
| 217 |
+
## π TODO
|
| 218 |
+
|
| 219 |
+
- β
Release inference code and checkpoints (short + long video)
|
| 220 |
+
- β¬ Release training code and configs
|
| 221 |
+
|
| 222 |
+
---
|
| 223 |
+
|
| 224 |
+
## π Acknowledgements
|
| 225 |
+
|
| 226 |
+
This work builds upon these excellent open-source projects:
|
| 227 |
+
|
| 228 |
+
- [**FlashVSR**](https://github.com/OpenImagingLab/FlashVSR) β block-sparse attention for streaming video super-resolution
|
| 229 |
+
- [**Self-Forcing**](https://github.com/guandeh17/Self-Forcing) β real-time autoregressive video generation with self-rollout training
|
| 230 |
+
- [**TAEHV**](https://github.com/madebyollin/taehv) β tiny autoencoder for high-resolution video decoding
|
| 231 |
+
- [**Wan2.1**](https://github.com/Wan-Video/Wan2.1) β video DiT foundation model
|
| 232 |
+
|
| 233 |
+
---
|
| 234 |
+
|
| 235 |
+
## π Contact
|
| 236 |
+
|
| 237 |
+
Please feel free to contact us if there is any question (luxion@mail.ustc.edu.cn).
|
| 238 |
+
|
| 239 |
+
---
|
| 240 |
+
|
| 241 |
+
## π Citation
|
| 242 |
|
| 243 |
```bibtex
|
| 244 |
@inproceedings{luxury2026ultraflash,
|
|
|
|
| 247 |
booktitle={arXiv preprint},
|
| 248 |
year={2026}
|
| 249 |
}
|
| 250 |
+
```
|
| 251 |
+
|
| 252 |
+
---
|
| 253 |
+
|
| 254 |
+
## π License
|
| 255 |
+
|
| 256 |
+
Released under the [Apache 2.0 License](https://github.com/xin1u/UltraFlash/blob/main/inference/LICENSE).
|