Production-ready FlashVSR implementation featuring Docker support, NVENC hardware acceleration, Low-VRAM tiling, and unified inference for real-time video super-resolution.
HTML
35
29 commits
updated Mar 2, 2026
π‘ Tip: If you find this repository's structure or content difficult to understand, visit deepwiki for a comprehensive detailed explanation.
FlashVSR-Pro is an enhanced, production-ready re-implementation of the real-time diffusion-based video super-resolution algorithm introduced in the paper "FlashVSR: Towards Real-Time Diffusion-Based Streaming Video Super-Resolution".
Original Paper: Zhuang, J., Guo, S., Cai, X., Li, X., Liu, Y., Yuan, C., & Xue, T. (2025). FlashVSR: Towards Real-Time Diffusion-Based Streaming Video Super-Resolution. arXiv preprint arXiv:2510.12747.
Paper Link: https://arxiv.org/abs/2510.12747
This project is not the official code release but an independent, refactored implementation focused on improved usability, additional features, and better compatibility for real-world deployment.
This project builds upon the core FlashVSR algorithm and introduces several key improvements:
infer.py script replaces multiple original scripts (full, tiny, tiny-long), simplifying the user interface.Scale Γ Input (e.g., 1280x740 β 2560x1480), using reflective padding instead of cropping to prevent pixel loss.| Mode | VAE Used | Description |
|---|---|---|
| full | wan2.1 | High Quality, High VRAM. Ideal for quality-critical tasks. |
| tiny | tcd | Balanced Quality, Lower VRAM. Ideal for efficient real-time processing. |
| tiny-long | tcd | Balanced Quality, Lower VRAM. Optimized for long videos. |
Required VAE models will be anticipated in ./models/FlashVSR-v1.1.
| VAE | File | Direct Download Link |
|---|---|---|
| Wan2.1 | models/FlashVSR-v1.1/Wan2.1_VAE.pth | Download |
| TCDecoder | models/FlashVSR-v1.1/TCDecoder.ckpt | Download |
Usage Examples:
# High quality (full mode)
python infer.py -i inputs/input.mp4 -o results/ --mode full
# Fast inference (tiny mode)
python infer.py -i inputs/input.mp4 -o results/ --mode tiny
# Long video processing (tiny-long mode)
python infer.py -i inputs/long_input.mp4 -o results/ --mode tiny-long
π For detailed installation instructions, see INSTALLATION.md
FlashVSR-Pro is primarily designed for Linux systems with NVIDIA GPUs. This is due to:
While FlashVSR-Pro is optimized for Linux, Windows users have the following options:
Docker Desktop (Recommended for Windows)
Windows Subsystem for Linux (WSL 2)
Native Windows Installation (Advanced)
Important: If you've been struggling with installation on Windows, we strongly recommend using Docker Desktop with WSL 2, as this provides the most reliable experience.
The easiest way to run FlashVSR-Pro is using the provided Docker container, which includes automated setup for the Block-Sparse-Attention backend. This is the recommended method for both Linux and Windows (via WSL 2) users.
git-lfs is installed on your host system to clone model weights.git-lfs is installed: sudo apt-get install git-lfs (in WSL Ubuntu terminal)git clone https://github.com/LujiaJin/FlashVSR-Pro.git
cd FlashVSR-Pro
docker build -t flashvsr-pro:latest .
Note: The Dockerfile automatically handles the compilation and installation of the optimized Block-Sparse-Attention backend, eliminating manual configuration.
Before running the container, download the required model weights.
# Download the FlashVSR model weights (version 1.1)
git lfs clone https://huggingface.co/JunhaoZhuang/FlashVSR-v1.1 ./models/FlashVSR-v1.1
The container is configured to automatically activate the flashvsr Conda environment upon startup. Make sure that the models/ directory of the host machine already contains the necessary model weight files, and provide the models when starting the container by mounting.
# Basic run with interactive shell
docker run --gpus all -it --rm \
-v $(pwd):/workspace/FlashVSR-Pro \
flashvsr-pro:latest
# You will be dropped into a shell with the `(flashvsr)` environment active.
# Verify by running: `which python`
--mode: Inference mode selection.
full: Uses WanModel + WanVideoVAE. Highest quality but requires significant VRAM (~14GB+ for 2s 720p without tiling).tiny: Uses WanModel + TCDecoder. Balanced speed and quality.tiny-long: Optimized streaming inference for long videos.--tile-dit: Enable tiling for the DiT model. Drastically reduces VRAM usage by processing the latent space in blocks. Essential for high-resolution inference on consumer GPUs.
--tile-size: Tile size in pixels (default: 256).--overlap: Overlap between tiles (default: 24).--tile-vae: Enable tiling for the VAE decoder. Allows decoding very large frames by splitting the latent representation before decoding.--fps INTEGER: Force a specific frame rate for the output video. By default, tries to match input video FPS or uses 30 for image sequences.--quality INTEGER: Output video quality (0-10). Default 10 (High). Maps to FFmpeg CRF values.--color-fix: Enable AdaIN/Wavelet-based post-processing color correction to match input color tones.--keep-audio: Transfer audio track from input to output video.--dtype: Precision format. Options: bf16 (default, recommended), fp16, fp32.--device: Processing device. Default: cuda.--scale: Upscaling factor. Default: 2.0.--sparse-ratio: Controls Attention sparsity. Default: 2.0. Lower (e.g. 1.5) is faster but potentially less stable.--kv-ratio: KV cache ratio. Default: 3.0.--local-range: Local attention window size. Default: 11.--seed: Random seed for reproducibility.| Argument | Description | Default |
|---|---|---|
-i, --input | Path to input video or image folder. | Required |
-o, --output | Output directory or file path. | ./results |
--mode | Inference mode: full (Wan VAE), tiny (TCD), tiny-long. | tiny |
--keep-audio | Preserve audio from input video (if exists). | False |
--tile-dit | Enable memory-efficient tiled DiT inference. | False |
--tile-vae | Enable tiled decoding for VAE (Full mode only). | False |
--tile-size | Size of each tile when using tiling. | 256 |
--overlap | Overlap between tiles to reduce seams. | 24 |
--scale | Super-resolution scale factor. | 2.0 |
--seed | Random seed for reproducible results. | 0 |
Note: The original FlashVSR is primarily designed and tested for 4x super-resolution. While other scales are supported, for optimal quality and stability, using --scale 4.0 is recommended.
For a full list of arguments, run python infer.py --help.
The main interface is the unified infer.py script.
# Basic upscaling (Tiny mode - balanced quality/speed)
python infer.py -i ./inputs/example0.mp4 -o ./results/ --mode tiny
# Full mode (Highest quality, requires more VRAM)
python infer.py -i ./inputs/example0.mp4 -o ./results/ --mode full
# Tiny-long mode for long videos
python infer.py -i ./inputs/example4.mp4 -o ./results/ --mode tiny-long
# Preserve the audio track from the input video
python infer.py -i inputs/input_with_audio.mp4 -o ./results/ --mode tiny --keep-audio
# Use tiled DiT inference to reduce VRAM usage (enables running on smaller GPUs)
python infer.py -i inputs/large_input.mp4 -o ./results/ --mode tiny --tile-dit --tile-size 256 --overlap 24
# Use tiled VAE for lower memory usage in full mode
python infer.py -i inputs/input.mp4 -o ./results/ --mode full --tile-vae
# Combine multiple enhancements
python infer.py -i inputs/large_input_with_audio.mp4 -o ./results/ --mode full --tile-vae --tile-dit --keep-audio
FlashVSR-Pro includes comprehensive performance enhancements designed for high-end GPUs (A100/H100/H200/RTX4090, etc) and high-throughput production environments.
torch.backends.cudnn.benchmark = True, allowing the driver to auto-tune convolution algorithms for the specific input resolution during the first pass.torch.cuda.synchronize() calls from the critical inference path.Symptom: Compilation errors, missing CUDA libraries, or general installation failures on Windows.
Solution:
nvidia-smi should work in WSL terminalSymptom: Docker commands fail with permission errors.
Solution:
sudo usermod -aG docker $USERsudo before docker commandsSymptom: nvidia-smi fails in WSL or Docker can't access GPU.
Solution:
nvidia-smi should show your GPUdocker run --rm --gpus all nvidia/cuda:12.0-base nvidia-smi--tile-dit and --tile-vae to enable tiled inference.--tile-size (e.g., from 256 to 128).--dtype fp16 to reduce memory usage.ffprobe -i input.mp4ffmpeg -codecs | grep h264git lfs pull./models/FlashVSR-v1.1/git lfs installnvidia-smi should show near 100% during processingA: Yes, but with specific requirements. Windows is not the primary development platform, but you can use FlashVSR-Pro on Windows through:
See the Platform Support section for detailed instructions.
A: The Block-Sparse-Attention dependency requires CUDA kernel compilation, which is primarily tested on Linux. The Docker/WSL 2 approach avoids these compilation issues by using a pre-configured Linux environment.
A: You need an NVIDIA GPU with compute capability 8.0 or higher (Ampere generation or newer). Recommended GPUs include:
A: No. FlashVSR-Pro requires NVIDIA GPUs with CUDA support due to the Block-Sparse-Attention kernels being written specifically for NVIDIA CUDA.
A:
--tile-dit --tile-vae)A: No. FlashVSR-Pro requires NVIDIA CUDA, which is not available on macOS. Apple Silicon (M1/M2/M3) uses different GPU architecture and is not compatible.
A: We recommend the Docker approach as it handles all dependencies automatically:
A: Yes! Cloud platforms with NVIDIA GPUs (Google Colab with T4/A100, AWS with GPU instances, etc.) work well. Use the Docker method or follow Linux installation instructions.
FlashVSR-Pro/
βββ .gitmodules # Git submodule configuration
βββ Block-Sparse-Attention/ # Git submodule: Sparse attention backend (with automated build)
βββ models/ # Model weights directory
β βββ FlashVSR-v1.1/ # Model weights V1.1
β βββ prompt_tensor/ # Pre-computed text prompt embeddings
βββ diffsynth/ # Core library (ModelManager, Pipelines)
βββ inputs/ # Default directory for input videos/images
βββ results/ # Default directory for output videos
βββ utils/ # Enhanced utilities module
β βββ __init__.py
β βββ utils.py # Core utilities (Causal_LQ4x_Proj, etc.)
β βββ TCDecoder.py # Tiny Conditional Decoder for 'tiny' mode
β βββ audio_utils.py # Audio preservation functions
β βββ tile_utils.py # Tiled inference for low VRAM
β βββ vae_manager.py # VAE Manager for multiple VAE support
βββ infer.py # Main unified inference script
βββ Dockerfile # Container definition with auto-activation
βββ entrypoint.sh # Container entry script
βββ requirements.txt # Python dependencies
βββ setup.py # Package setup for the `diffsynth` module
βββ LICENSE # Project license file
βββ README.md # This file
This project is released under the same license (Apache Software license) as the original FlashVSR implementation. Please see the LICENSE file in the original repository for details.
If you use the FlashVSR algorithm in your research, please cite the original FlashVSR paper:
@article{zhuang2025flashvsr,
title={FlashVSR: Towards Real-Time Diffusion-Based Streaming Video Super-Resolution},
author={Zhuang, Junhao and Guo, Shi and Cai, Xin and Li, Xiaohui and Liu, Yihao and Yuan, Chun and Xue, Tianfan},
journal={arXiv preprint arXiv:2510.12747},
year={2025}
}
If you use this implementation (FlashVSR-Pro) in your work, please cite:
Contributions, issues, and feature requests are welcome. Feel free to check the issues page if you want to contribute.
Happy Super-Resolution! π
HTML
64.4%
C++
18.5%
Cuda
11.2%
Python
5.4%
Production-ready FlashVSR implementation featuring Docker support, NVENC hardware acceleration, Low-VRAM tiling, and unified inference for real-time video super-resolution.
HTML
35
29 commits
updated Mar 2, 2026
π‘ Tip: If you find this repository's structure or content difficult to understand, visit deepwiki for a comprehensive detailed explanation.
FlashVSR-Pro is an enhanced, production-ready re-implementation of the real-time diffusion-based video super-resolution algorithm introduced in the paper "FlashVSR: Towards Real-Time Diffusion-Based Streaming Video Super-Resolution".
Original Paper: Zhuang, J., Guo, S., Cai, X., Li, X., Liu, Y., Yuan, C., & Xue, T. (2025). FlashVSR: Towards Real-Time Diffusion-Based Streaming Video Super-Resolution. arXiv preprint arXiv:2510.12747.
Paper Link: https://arxiv.org/abs/2510.12747
This project is not the official code release but an independent, refactored implementation focused on improved usability, additional features, and better compatibility for real-world deployment.
This project builds upon the core FlashVSR algorithm and introduces several key improvements:
infer.py script replaces multiple original scripts (full, tiny, tiny-long), simplifying the user interface.Scale Γ Input (e.g., 1280x740 β 2560x1480), using reflective padding instead of cropping to prevent pixel loss.| Mode | VAE Used | Description |
|---|---|---|
| full | wan2.1 | High Quality, High VRAM. Ideal for quality-critical tasks. |
| tiny | tcd | Balanced Quality, Lower VRAM. Ideal for efficient real-time processing. |
| tiny-long | tcd | Balanced Quality, Lower VRAM. Optimized for long videos. |
Required VAE models will be anticipated in ./models/FlashVSR-v1.1.
| VAE | File | Direct Download Link |
|---|---|---|
| Wan2.1 | models/FlashVSR-v1.1/Wan2.1_VAE.pth | Download |
| TCDecoder | models/FlashVSR-v1.1/TCDecoder.ckpt | Download |
Usage Examples:
# High quality (full mode)
python infer.py -i inputs/input.mp4 -o results/ --mode full
# Fast inference (tiny mode)
python infer.py -i inputs/input.mp4 -o results/ --mode tiny
# Long video processing (tiny-long mode)
python infer.py -i inputs/long_input.mp4 -o results/ --mode tiny-long
π For detailed installation instructions, see INSTALLATION.md
FlashVSR-Pro is primarily designed for Linux systems with NVIDIA GPUs. This is due to:
While FlashVSR-Pro is optimized for Linux, Windows users have the following options:
Docker Desktop (Recommended for Windows)
Windows Subsystem for Linux (WSL 2)
Native Windows Installation (Advanced)
Important: If you've been struggling with installation on Windows, we strongly recommend using Docker Desktop with WSL 2, as this provides the most reliable experience.
The easiest way to run FlashVSR-Pro is using the provided Docker container, which includes automated setup for the Block-Sparse-Attention backend. This is the recommended method for both Linux and Windows (via WSL 2) users.
git-lfs is installed on your host system to clone model weights.git-lfs is installed: sudo apt-get install git-lfs (in WSL Ubuntu terminal)git clone https://github.com/LujiaJin/FlashVSR-Pro.git
cd FlashVSR-Pro
docker build -t flashvsr-pro:latest .
Note: The Dockerfile automatically handles the compilation and installation of the optimized Block-Sparse-Attention backend, eliminating manual configuration.
Before running the container, download the required model weights.
# Download the FlashVSR model weights (version 1.1)
git lfs clone https://huggingface.co/JunhaoZhuang/FlashVSR-v1.1 ./models/FlashVSR-v1.1
The container is configured to automatically activate the flashvsr Conda environment upon startup. Make sure that the models/ directory of the host machine already contains the necessary model weight files, and provide the models when starting the container by mounting.
# Basic run with interactive shell
docker run --gpus all -it --rm \
-v $(pwd):/workspace/FlashVSR-Pro \
flashvsr-pro:latest
# You will be dropped into a shell with the `(flashvsr)` environment active.
# Verify by running: `which python`
--mode: Inference mode selection.
full: Uses WanModel + WanVideoVAE. Highest quality but requires significant VRAM (~14GB+ for 2s 720p without tiling).tiny: Uses WanModel + TCDecoder. Balanced speed and quality.tiny-long: Optimized streaming inference for long videos.--tile-dit: Enable tiling for the DiT model. Drastically reduces VRAM usage by processing the latent space in blocks. Essential for high-resolution inference on consumer GPUs.
--tile-size: Tile size in pixels (default: 256).--overlap: Overlap between tiles (default: 24).--tile-vae: Enable tiling for the VAE decoder. Allows decoding very large frames by splitting the latent representation before decoding.--fps INTEGER: Force a specific frame rate for the output video. By default, tries to match input video FPS or uses 30 for image sequences.--quality INTEGER: Output video quality (0-10). Default 10 (High). Maps to FFmpeg CRF values.--color-fix: Enable AdaIN/Wavelet-based post-processing color correction to match input color tones.--keep-audio: Transfer audio track from input to output video.--dtype: Precision format. Options: bf16 (default, recommended), fp16, fp32.--device: Processing device. Default: cuda.--scale: Upscaling factor. Default: 2.0.--sparse-ratio: Controls Attention sparsity. Default: 2.0. Lower (e.g. 1.5) is faster but potentially less stable.--kv-ratio: KV cache ratio. Default: 3.0.--local-range: Local attention window size. Default: 11.--seed: Random seed for reproducibility.| Argument | Description | Default |
|---|---|---|
-i, --input | Path to input video or image folder. | Required |
-o, --output | Output directory or file path. | ./results |
--mode | Inference mode: full (Wan VAE), tiny (TCD), tiny-long. | tiny |
--keep-audio | Preserve audio from input video (if exists). | False |
--tile-dit | Enable memory-efficient tiled DiT inference. | False |
--tile-vae | Enable tiled decoding for VAE (Full mode only). | False |
--tile-size | Size of each tile when using tiling. | 256 |
--overlap | Overlap between tiles to reduce seams. | 24 |
--scale | Super-resolution scale factor. | 2.0 |
--seed | Random seed for reproducible results. | 0 |
Note: The original FlashVSR is primarily designed and tested for 4x super-resolution. While other scales are supported, for optimal quality and stability, using --scale 4.0 is recommended.
For a full list of arguments, run python infer.py --help.
The main interface is the unified infer.py script.
# Basic upscaling (Tiny mode - balanced quality/speed)
python infer.py -i ./inputs/example0.mp4 -o ./results/ --mode tiny
# Full mode (Highest quality, requires more VRAM)
python infer.py -i ./inputs/example0.mp4 -o ./results/ --mode full
# Tiny-long mode for long videos
python infer.py -i ./inputs/example4.mp4 -o ./results/ --mode tiny-long
# Preserve the audio track from the input video
python infer.py -i inputs/input_with_audio.mp4 -o ./results/ --mode tiny --keep-audio
# Use tiled DiT inference to reduce VRAM usage (enables running on smaller GPUs)
python infer.py -i inputs/large_input.mp4 -o ./results/ --mode tiny --tile-dit --tile-size 256 --overlap 24
# Use tiled VAE for lower memory usage in full mode
python infer.py -i inputs/input.mp4 -o ./results/ --mode full --tile-vae
# Combine multiple enhancements
python infer.py -i inputs/large_input_with_audio.mp4 -o ./results/ --mode full --tile-vae --tile-dit --keep-audio
FlashVSR-Pro includes comprehensive performance enhancements designed for high-end GPUs (A100/H100/H200/RTX4090, etc) and high-throughput production environments.
torch.backends.cudnn.benchmark = True, allowing the driver to auto-tune convolution algorithms for the specific input resolution during the first pass.torch.cuda.synchronize() calls from the critical inference path.Symptom: Compilation errors, missing CUDA libraries, or general installation failures on Windows.
Solution:
nvidia-smi should work in WSL terminalSymptom: Docker commands fail with permission errors.
Solution:
sudo usermod -aG docker $USERsudo before docker commandsSymptom: nvidia-smi fails in WSL or Docker can't access GPU.
Solution:
nvidia-smi should show your GPUdocker run --rm --gpus all nvidia/cuda:12.0-base nvidia-smi--tile-dit and --tile-vae to enable tiled inference.--tile-size (e.g., from 256 to 128).--dtype fp16 to reduce memory usage.ffprobe -i input.mp4ffmpeg -codecs | grep h264git lfs pull./models/FlashVSR-v1.1/git lfs installnvidia-smi should show near 100% during processingA: Yes, but with specific requirements. Windows is not the primary development platform, but you can use FlashVSR-Pro on Windows through:
See the Platform Support section for detailed instructions.
A: The Block-Sparse-Attention dependency requires CUDA kernel compilation, which is primarily tested on Linux. The Docker/WSL 2 approach avoids these compilation issues by using a pre-configured Linux environment.
A: You need an NVIDIA GPU with compute capability 8.0 or higher (Ampere generation or newer). Recommended GPUs include:
A: No. FlashVSR-Pro requires NVIDIA GPUs with CUDA support due to the Block-Sparse-Attention kernels being written specifically for NVIDIA CUDA.
A:
--tile-dit --tile-vae)A: No. FlashVSR-Pro requires NVIDIA CUDA, which is not available on macOS. Apple Silicon (M1/M2/M3) uses different GPU architecture and is not compatible.
A: We recommend the Docker approach as it handles all dependencies automatically:
A: Yes! Cloud platforms with NVIDIA GPUs (Google Colab with T4/A100, AWS with GPU instances, etc.) work well. Use the Docker method or follow Linux installation instructions.
FlashVSR-Pro/
βββ .gitmodules # Git submodule configuration
βββ Block-Sparse-Attention/ # Git submodule: Sparse attention backend (with automated build)
βββ models/ # Model weights directory
β βββ FlashVSR-v1.1/ # Model weights V1.1
β βββ prompt_tensor/ # Pre-computed text prompt embeddings
βββ diffsynth/ # Core library (ModelManager, Pipelines)
βββ inputs/ # Default directory for input videos/images
βββ results/ # Default directory for output videos
βββ utils/ # Enhanced utilities module
β βββ __init__.py
β βββ utils.py # Core utilities (Causal_LQ4x_Proj, etc.)
β βββ TCDecoder.py # Tiny Conditional Decoder for 'tiny' mode
β βββ audio_utils.py # Audio preservation functions
β βββ tile_utils.py # Tiled inference for low VRAM
β βββ vae_manager.py # VAE Manager for multiple VAE support
βββ infer.py # Main unified inference script
βββ Dockerfile # Container definition with auto-activation
βββ entrypoint.sh # Container entry script
βββ requirements.txt # Python dependencies
βββ setup.py # Package setup for the `diffsynth` module
βββ LICENSE # Project license file
βββ README.md # This file
This project is released under the same license (Apache Software license) as the original FlashVSR implementation. Please see the LICENSE file in the original repository for details.
If you use the FlashVSR algorithm in your research, please cite the original FlashVSR paper:
@article{zhuang2025flashvsr,
title={FlashVSR: Towards Real-Time Diffusion-Based Streaming Video Super-Resolution},
author={Zhuang, Junhao and Guo, Shi and Cai, Xin and Li, Xiaohui and Liu, Yihao and Yuan, Chun and Xue, Tianfan},
journal={arXiv preprint arXiv:2510.12747},
year={2025}
}
If you use this implementation (FlashVSR-Pro) in your work, please cite:
Contributions, issues, and feature requests are welcome. Feel free to check the issues page if you want to contribute.
Happy Super-Resolution! π
HTML
64.4%
C++
18.5%
Cuda
11.2%
Python
5.4%