Video-to-Video
Diffusers
Safetensors
H-oliday commited on
Commit
6526a8d
Β·
verified Β·
1 Parent(s): 40de76f

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +65 -55
README.md CHANGED
@@ -1,7 +1,16 @@
 
 
 
 
 
1
  <h1 align="center">SwiftVR: Real-Time One-Step Generative Video Restoration</h1>
2
 
 
 
3
  <p align="center"><img src="assets/teaser.avif" width="100%" alt="SwiftVR teaser"></p>
4
 
 
 
5
  > **SwiftVR** is the first generative video restoration model to reach **real-time 1080p streaming on a consumer-grade GPU** (β‰ˆ26 FPS on a single RTX 5090), sustains **31 FPS at QHD (2560Γ—1440)** and **14 FPS at 4K (3840Γ—2160)** on a single H100, and streams at resolutions where every compared diffusion-based VR baseline runs out of memory.
6
 
7
  <p>
@@ -9,24 +18,31 @@
9
  <a href="https://github.com/H-oliday/SwiftVR/"><img src="https://img.shields.io/badge/Project-Page-1f8acb.svg?style=flat-square" alt="Project Page"></a>
10
  <a href="https://huggingface.co/H-oliday/SwiftVR"><img src="https://img.shields.io/badge/%F0%9F%A4%97%20HuggingFace-Model-ffce00.svg?style=flat-square" alt="HuggingFace"></a>
11
  <a href="https://github.com/H-oliday/SwiftVR/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-green.svg?style=flat-square" alt="License"></a>
 
12
  </p>
13
 
 
 
14
  ## Updates
 
 
 
 
 
15
 
16
- * [2026/06] Release the inference code and pretrained weights πŸŽ‰
17
 
18
  ## ✨ Highlights
 
19
 
20
- * **Mask-free shifted-window self-attention (MFSWA).** Each spatial window is **pre-gathered into a dense tensor**, so every attention call reduces to a single standard scaled-dot-product (SDPA) call β€” *no attention mask, cyclic shift, or padding ever enters the graph*. This gives a **1.62Γ— throughput gain over its full-attention teacher** at essentially identical quality, with **no dedicated sparse kernel**.
21
- * **Restoration-aware Autoencoder (ReAE).** A lightweight encoder–decoder jointly fine-tuned with the DiT in pixel space removes the heavy-3D-VAE / tiled-decoding bottleneck.
22
- * **Causal chunk-wise streaming.** A minimal causal protocol (no rolling KV cache, no overlapped DiT inference) bounds the temporal axis, confining the residual (\mathcal{O}(N^2)) cost to the spatial axes.
23
 
24
 
25
  ## πŸ“Š Results
 
26
 
27
- ### Efficiency at 2560Γ—1440
28
-
29
- Single H100, causal streaming, 24 frames.
30
 
31
  | Metric | DOVE (tile) | SeedVR2-3B (tile)| FlashVSR-Tiny | **SwiftVR (Ours)** |
32
  |---|:---:|:---:|:---:|:---:|
@@ -38,12 +54,15 @@ Single H100, causal streaming, 24 frames.
38
 
39
  ### Qualitative comparison
40
 
41
- <img src="assets/qualitative.png" width="100%" alt="SwiftVR qualitative comparison">
 
 
42
 
43
  ## πŸ›  Installation
 
44
 
45
  ```bash
46
- git clone https://github.com/H-oliday/SwiftVR.git
47
  cd SwiftVR
48
 
49
  conda create -n swiftvr python=3.10 -y
@@ -59,35 +78,37 @@ pip install -e .
59
  <details>
60
  <summary><b>Hardware notes</b></summary>
61
 
62
- * **Server:** single H100-80G reproduces the QHD/4K numbers above.
63
- * **Consumer:** single RTX 5090 reaches β‰ˆ26 FPS at 1080p with the *same checkpoint* (default PyTorch SDPA path, bfloat16, causal chunk protocol).
64
- * No hardware-specific retraining or kernel rewrite is required on any platform.
65
-
66
  </details>
67
 
68
- ## πŸ—‚ Model Zoo
69
 
70
- | Model Name | Date | Backbone | Link |
71
- | ---------- | ------- | -------------- | ----------------------------------------------------- |
72
- | SwiftVR | 2026.06 | Wan2.2-TI2V-5B | [πŸ€— HuggingFace](https://huggingface.co/H-oliday/SwiftVR) |
 
 
 
73
 
74
  ```bash
75
  huggingface-cli download H-oliday/SwiftVR --local-dir checkpoints/
76
  ```
77
 
78
- Expected checkpoint layout, where `checkpoints/` is the directory passed to `from_pretrained`:
79
 
80
- ```text
81
  checkpoints/
82
- β”œβ”€β”€ reae.safetensors # Restoration-aware Autoencoder weights
83
- β”œβ”€β”€ prompt_embedding.safetensors # precomputed empty-prompt text embedding, key: "prompt_emb"
84
- └── transformer/ # diffusers-format DiT
85
  β”œβ”€β”€ config.json
86
  └── diffusion_pytorch_model.safetensors
87
  ```
88
 
89
- ## πŸš€ Quick Start
90
 
 
 
91
  ### Python API
92
 
93
  ```python
@@ -108,7 +129,8 @@ Tunable knobs include:
108
  * `quality`: 0–100, mapped to x265 CRF
109
  * `queue_size`: pipeline queue size
110
 
111
- ### Streaming
 
112
 
113
  Causal, chunk-by-chunk restoration without future frames.
114
 
@@ -116,11 +138,11 @@ Causal, chunk-by-chunk restoration without future frames.
116
  session = pipe.stream(clip_len=24, resolution=(1920, 1080))
117
 
118
  for lq_chunk in read_chunks("low_quality.mp4", n=24): # lq_chunk: [T, H, W, 3] uint8
119
- hq = session.step(lq_chunk) # [1, T', 3, H', W'] in [0, 1], or None if buffered
120
  if hq is not None:
121
  write(hq)
122
 
123
- tail = session.flush() # flush the final buffered frames
124
  ```
125
 
126
  ### Command line
@@ -132,40 +154,31 @@ python scripts/inference.py \
132
  --checkpoint checkpoints/ \
133
  --upscale 4 \
134
  --clip-len 24 \
135
- --dtype bfloat16
136
  ```
137
 
138
  Use `--png` to write a PNG sequence.
139
 
140
- ## πŸ“ Repository Structure
141
-
142
- ```text
143
- SwiftVR/
144
- β”œβ”€β”€ README.md
145
- β”œβ”€β”€ LICENSE
146
- β”œβ”€β”€ requirements.txt
147
- β”œβ”€β”€ setup.py
148
- β”œβ”€β”€ scripts/
149
- β”‚ └── inference.py # CLI entry point, thin wrapper over SwiftVRPipeline
150
- └── swiftvr/
151
- β”œβ”€β”€ __init__.py # exports SwiftVRPipeline
152
- β”œβ”€β”€ pipeline.py # SwiftVRPipeline: from_pretrained / to / restore_video / stream
153
- β”œβ”€β”€ runner.py # four-stage pipelined runner: reader β†’ H2D β†’ GPU β†’ writer
154
- β”œβ”€β”€ io.py # frame reading, GPU preprocessing, mp4 / PNG writing
155
- β”œβ”€β”€ models/
156
- β”‚ β”œβ”€β”€ reae.py # Restoration-aware Autoencoder
157
- β”‚ └── transformer.py # DiT + mask-free shifted-window self-attention
158
- └── streaming/
159
- β”œβ”€β”€ chunk.py # fixed-size causal chunk protocol
160
- β”œβ”€β”€ tae.py # streaming autoencoder with causal boundary state
161
- └── dit.py # one-step streaming DiT with fixed timestep and RoPE offsets
162
- ```
163
 
164
  ## πŸ™ Acknowledgements
 
 
165
 
166
- SwiftVR builds on [Wan2.2-TI2V-5B](https://github.com/Wan-Video), the lightweight autoencoder [TAEHV](https://github.com/madebyollin/taehv), and the [RealBasicVSR](https://github.com/ckkelvinchan/RealBasicVSR) degradation pipeline.
167
 
168
- We thank the authors of [DOVE](https://github.com/zhengchen1999/DOVE), [SeedVR2](https://github.com/ByteDance-Seed/SeedVR), and [FlashVSR](https://github.com/OpenImagingLab/FlashVSR) for releasing strong baselines, and the [UltraVideo](https://huggingface.co/datasets/APRIL-AIGC/UltraVideo) team for the training corpus.
169
 
170
  ## πŸ“œ License
171
 
@@ -187,6 +200,3 @@ If you have any questions, feel free to reach out:
187
 
188
  * Email: [kakibluee@gmail.com](mailto:kakibluee@gmail.com)
189
 
190
- <div align="center">
191
- <sub>If SwiftVR is useful to your research or product, please consider giving it a ⭐.</sub>
192
- </div>
 
1
+ ---
2
+ license: apache-2.0
3
+
4
+ ---
5
+
6
  <h1 align="center">SwiftVR: Real-Time One-Step Generative Video Restoration</h1>
7
 
8
+
9
+
10
  <p align="center"><img src="assets/teaser.avif" width="100%" alt="SwiftVR teaser"></p>
11
 
12
+
13
+
14
  > **SwiftVR** is the first generative video restoration model to reach **real-time 1080p streaming on a consumer-grade GPU** (β‰ˆ26 FPS on a single RTX 5090), sustains **31 FPS at QHD (2560Γ—1440)** and **14 FPS at 4K (3840Γ—2160)** on a single H100, and streams at resolutions where every compared diffusion-based VR baseline runs out of memory.
15
 
16
  <p>
 
18
  <a href="https://github.com/H-oliday/SwiftVR/"><img src="https://img.shields.io/badge/Project-Page-1f8acb.svg?style=flat-square" alt="Project Page"></a>
19
  <a href="https://huggingface.co/H-oliday/SwiftVR"><img src="https://img.shields.io/badge/%F0%9F%A4%97%20HuggingFace-Model-ffce00.svg?style=flat-square" alt="HuggingFace"></a>
20
  <a href="https://github.com/H-oliday/SwiftVR/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-green.svg?style=flat-square" alt="License"></a>
21
+
22
  </p>
23
 
24
+
25
+
26
  ## Updates
27
+ ---
28
+ - [2026/06] Release the inference code and pretrained weights πŸŽ‰
29
+
30
+
31
+
32
 
 
33
 
34
  ## ✨ Highlights
35
+ ---
36
 
37
+ - **Mask-free shifted-window self-attention (MFSWA).** Each spatial window is **pre-gathered into a dense tensor**, so every attention call reduces to a single standard scaled-dot-product (SDPA) call β€” *no attention mask, cyclic shift, or padding ever enters the graph*. This gives a **1.62Γ— throughput gain over its full-attention teacher** at essentially identical quality, with **no dedicated sparse kernel**.
38
+ - **Restoration-aware Autoencoder (ReAE).** A lightweight encoder–decoder jointly fine-tuned with the DiT in pixel space removes the heavy-3D-VAE / tiled-decoding bottleneck.
39
+ - **Causal chunk-wise streaming.** A minimal causal protocol (no rolling KV cache, no overlapped DiT inference) bounds the temporal axis, confining the residual \(\mathcal{O}(N^2)\) cost to the spatial axes.
40
 
41
 
42
  ## πŸ“Š Results
43
+ ---
44
 
45
+ ### Efficiency at 2560Γ—1440 (single H100, causal streaming, 24 frames)
 
 
46
 
47
  | Metric | DOVE (tile) | SeedVR2-3B (tile)| FlashVSR-Tiny | **SwiftVR (Ours)** |
48
  |---|:---:|:---:|:---:|:---:|
 
54
 
55
  ### Qualitative comparison
56
 
57
+ <img src="assets/qualitative.png" width="100%" alt="SwiftVR teaser">
58
+
59
+
60
 
61
  ## πŸ›  Installation
62
+ ---
63
 
64
  ```bash
65
+ git clone https://github.com/Holiday/SwiftVR.git
66
  cd SwiftVR
67
 
68
  conda create -n swiftvr python=3.10 -y
 
78
  <details>
79
  <summary><b>Hardware notes</b></summary>
80
 
81
+ - **Server:** single H100-80G reproduces the QHD/4K numbers above.
82
+ - **Consumer:** single RTX 5090 reaches β‰ˆ26 FPS at 1080p with the *same checkpoint* (default PyTorch SDPA path, bfloat16, causal chunk protocol).
83
+ - No hardware-specific retraining or kernel rewrite is required on any platform.
 
84
  </details>
85
 
 
86
 
87
+
88
+ ## πŸ—‚ Model Zoo
89
+ ---
90
+ | Model Name | Date | Backbone | Link |
91
+ |---|---|---|---|
92
+ | SwiftVR | 2026.06 | Wan2.2-TI2V-5B | [πŸ€— HuggingFace](https://huggingface.co/H-oliday/SwiftVR) |
93
 
94
  ```bash
95
  huggingface-cli download H-oliday/SwiftVR --local-dir checkpoints/
96
  ```
97
 
98
+ Expected checkpoint layout (the directory passed to `from_pretrained`):
99
 
100
+ ```
101
  checkpoints/
102
+ β”œβ”€β”€ reae.safetensors # Restoration-aware Autoencoder weights
103
+ β”œβ”€β”€ prompt_embedding.safetensors# precomputed empty-prompt text embedding (key: "prompt_emb")
104
+ └── transformer/ # diffusers-format DiT
105
  β”œβ”€β”€ config.json
106
  └── diffusion_pytorch_model.safetensors
107
  ```
108
 
 
109
 
110
+ ## πŸš€ Quick Start
111
+ ---
112
  ### Python API
113
 
114
  ```python
 
129
  * `quality`: 0–100, mapped to x265 CRF
130
  * `queue_size`: pipeline queue size
131
 
132
+
133
+ ### Streaming (causal, chunk by chunk, no future frames)
134
 
135
  Causal, chunk-by-chunk restoration without future frames.
136
 
 
138
  session = pipe.stream(clip_len=24, resolution=(1920, 1080))
139
 
140
  for lq_chunk in read_chunks("low_quality.mp4", n=24): # lq_chunk: [T, H, W, 3] uint8
141
+ hq = session.step(lq_chunk) # [1, T', 3, H', W'] in [0, 1], or None if buffered
142
  if hq is not None:
143
  write(hq)
144
 
145
+ tail = session.flush() # flush the final buffered frames
146
  ```
147
 
148
  ### Command line
 
154
  --checkpoint checkpoints/ \
155
  --upscale 4 \
156
  --clip-len 24 \
157
+ --dtype bfloat16 \
158
  ```
159
 
160
  Use `--png` to write a PNG sequence.
161
 
162
+
163
+ ## 🎬 More Visual Results
164
+ ---
165
+ > Full-length restored clips (low-quality input β†’ SwiftVR, played back to back).
166
+
167
+
168
+ <video src="https://huggingface.co/H-oliday/SwiftVR/resolve/main/assets/demo_1.mp4" controls width="100%"></video>
169
+
170
+ <video src="https://huggingface.co/H-oliday/SwiftVR/resolve/main/assets/demo_2.mp4" controls width="100%"></video>
171
+
172
+ <video src="https://huggingface.co/H-oliday/SwiftVR/resolve/main/assets/demo_3.mp4" controls width="100%"></video>
173
+
174
+
175
+
 
 
 
 
 
 
 
 
 
176
 
177
  ## πŸ™ Acknowledgements
178
+ ---
179
+ SwiftVR builds on [Wan2.2-TI2V-5B](https://github.com/Wan-Video), the lightweight autoencoder [TAEHV](https://github.com/madebyollin/taehv), and the [RealBasicVSR](https://github.com/ckkelvinchan/RealBasicVSR) degradation pipeline. We thank the authors of [DOVE](https://github.com/zhengchen1999/DOVE), [SeedVR2](https://github.com/ByteDance-Seed/SeedVR), and [FlashVSR](https://github.com/OpenImagingLab/FlashVSR) for releasing strong baselines, and the [UltraVideo](https://github.com/Tele-AI/UltraVideo) team for the training corpus.
180
 
 
181
 
 
182
 
183
  ## πŸ“œ License
184
 
 
200
 
201
  * Email: [kakibluee@gmail.com](mailto:kakibluee@gmail.com)
202