xin1u commited on
Commit
e7d68a7
Β·
verified Β·
1 Parent(s): e66fecf

Polish model card: badges, efficiency table, architecture, checkpoint docs, args, news/TODO, contact

Browse files
Files changed (1) hide show
  1. README.md +209 -24
README.md CHANGED
@@ -1,53 +1,159 @@
1
  ---
2
  license: apache-2.0
3
  pipeline_tag: text-to-video
 
 
 
 
 
 
 
 
 
 
 
 
4
  ---
5
 
6
- # Ultra Flash ⚑
7
 
8
- **Ultra Flash** is a cascaded streaming framework capable of real-time high-resolution video generation. It achieves ~30 FPS at 1K resolution and ~18 FPS at 2K resolution on a single GPU.
9
 
10
- [**Paper**](https://huggingface.co/papers/2606.09150) | [**Project Page**](https://xin1u.github.io/UltraFlash/) | [**Code (GitHub)**](https://github.com/xin1u/UltraFlash)
11
 
12
- ## Overview
 
 
 
13
 
14
- While recent autoregressive video diffusion models achieve remarkable streaming quality, they remain confined to low resolutions. Ultra Flash bridges this gap by cascading three key components after a low-resolution streaming generator:
15
 
16
- 1. **Architecture-Preserving T2V-to-TV2V SR Training** with AIGC-oriented degradation.
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
- ## Architecture
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
- The framework follows a cascaded pipeline:
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
- ## Quick Start
29
 
30
- ### Installation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
  ```bash
33
  conda create -n ultraflash python=3.10 -y
34
  conda activate ultraflash
35
- cd inference
 
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
- pip install -e .
 
43
  ```
44
 
45
- ### Inference
46
 
47
- For custom inference at high resolution:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
- ## Citation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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** &nbsp;Β·&nbsp; **~18 FPS at 2K** &nbsp;Β·&nbsp; **Single GPU** &nbsp;Β·&nbsp; **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).