Run this model with HF Jobs

Run moonbox-dev/SeedVR2-3B-TensorRT on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/moonbox-dev/SeedVR2-3B-TensorRT. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/moonbox-dev/SeedVR2-3B-TensorRT on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

SeedVR2 TensorRT

TensorRT engines of SeedVR2, made by Moonbox for NVIDIA RTX GPUs. Each precision is one folder holding the engine, trt_runner.py (a small numpy runner: TensorRT plus Polygraphy, no PyTorch) and a script that does the rest of the pipeline. What the engine takes and returns is under How to run.

Compatibility. The engines are built hardware compatible (Ampere and newer: RTX 30, 40 and 50 series) and version compatible (any TensorRT 10.x from 10.13 on, through its lean runtime). That costs a little speed against an engine built for one GPU, but no rebuild is needed. Install the runtime with pip install "tensorrt-cu12>=10.13,<11" "tensorrt-lean-cu12>=10.13,<11" polygraphy numpy.

Files

The last column is the benchmark (details under How to run).

Precision File Size sha256 Benchmark
fp16 fp16/LICENSE.txt 11.5 kB fa62fea050d2 PSNR vs the original: mean 40.0 / 32.4 dB, worst frame 39.7 / 32.0 dB (ONNX fp16 40.8 / 33.3, 40.5 / 32.9); 24-28 s per clip, of which ~6 s inference and the rest loading the engines (ONNX fp16 ~25 s); peak 10.7 GB of commit (ONNX fp16 decode near 15 GB)
fp16 fp16/device_chain.py 9.4 kB f34bec2d7d50 (the same build: numbers in its first row)
fp16 fp16/dit_0.engine 1.36 GB 4820ae913951 (the same build: numbers in its first row)
fp16 fp16/dit_1.engine 1.44 GB 4b3eb043fb75 (the same build: numbers in its first row)
fp16 fp16/dit_2.engine 1.18 GB 51020d22b5ed (the same build: numbers in its first row)
fp16 fp16/dit_3.engine 850.4 MB 25c60cfbf899 (the same build: numbers in its first row)
fp16 fp16/dit_4.engine 819.6 MB ba3223a36798 (the same build: numbers in its first row)
fp16 fp16/dit_5.engine 1.00 GB 21197c042308 (the same build: numbers in its first row)
fp16 fp16/dit_6.engine 851.0 MB cf893c46e24a (the same build: numbers in its first row)
fp16 fp16/dit_7.engine 407.2 MB 9a95f63aa33f (the same build: numbers in its first row)
fp16 fp16/dit_split.json 2.3 kB be5b8a969b1a (the same build: numbers in its first row)
fp16 fp16/pipeline.py 12.6 kB 41341ecf6d57 (the same build: numbers in its first row)
fp16 fp16/pipeline_trt.py 4.9 kB bb1af78655ef (the same build: numbers in its first row)
fp16 fp16/trt_runner.py 4.4 kB cbc9abb1f59c (the same build: numbers in its first row)
fp16 fp16/vae_dec_first.engine 437.7 MB de2582d87c20 (the same build: numbers in its first row)
fp16 fp16/vae_dec_next.engine 406.4 MB 9d5f5fce857d (the same build: numbers in its first row)
fp16 fp16/vae_enc_first.engine 308.3 MB 5d395a6d3eba (the same build: numbers in its first row)
fp16 fp16/vae_enc_next.engine 289.0 MB 7f35483b798c (the same build: numbers in its first row)

How to run

SeedVR2-3B (ByteDance Seed: one-step diffusion video restoration and super-resolution) as TensorRT engines built from this model's fp16 ONNX graphs, plus pipeline_trt.py. The pipeline is the ONNX build's pipeline.py, a numpy port of the repository's projects/inference_seedvr2_3b.py, with every graph run as engines. As in the original script:

  • one diffusion step at t = 1000, guidance 1;
  • the repository's positive text embedding, baked into the DiT;
  • no colour fix.
import sys
from PIL import Image
sys.path.insert(0, "fp16")
from pipeline_trt import SeedVR2Trt
p = SeedVR2Trt("fp16")
frames = [Image.open(f"in/{i:05d}.png").convert("RGB") for i in range(17)]   # already at the output size
out = p(frames, seed=666)                                                     # list of uint8 RGB frames

Or python fp16/pipeline_trt.py frames_dir out_dir --seed 666. Resize the low-quality frames to the output size first, as the script does. It needs numpy, Pillow, TensorRT 10.13 (tensorrt-cu12 or tensorrt-lean-cu12) and Polygraphy; no PyTorch and no ONNX Runtime. The engines are version-compatible and built for Ampere or newer GPUs (RTX 30-series and up).

Limits.

  • Frame sides: 256 to 512, multiples of 16; height and width each.
  • Length: up to 17 frames per clip (5 latent frames). Cut longer videos into clips.

The engines.

  • vae_enc_first.engine / vae_enc_next.engine: the VAE encoder in causal slices (5 frames, then 4 per slice).
    • inputs: x [1, 3, n, H, W] in [-1, 1], plus the causal convolutions' memories mem*;
    • outputs: moments [1, 32, t, H/8, W/8], plus the new memories new_mem*.
  • dit_0..7.engine: the NaDiT, in pieces (dit_split.json).
    • inputs: vid [T, H/8, W/8, 33] (noise, condition latent, 1), plus for each of the two window layouts the token indices, key mask, inverse indices and RoPE tables (pipeline.window_inputs);
    • output: v [T, H/8, W/8, 16].
  • vae_dec_first.engine / vae_dec_next.engine: the VAE decoder in causal slices (2 latents, then 1 per slice). Latents and memories go in; frames [1, 3, n, H, W] and the new memories come out.

Each phase's engines are loaded for it and released after it, as the ONNX build does with its sessions.

Changes from the ONNX graphs.

  • Attention: the DiT's window attention, exported as ONNX Runtime's com.microsoft MultiHeadAttention, is written as standard ops (MatMul, Softmax, MatMul), which TensorRT fuses into its own attention kernels.
  • Causal memories: the VAE's are fp16 instead of fp32. This is exact: each one was cast to fp16 on the way in and from fp16 on the way out. It halves them, to 1.2 GB per set for the decoder at 384 x 384.
  • DiT pieces: the DiT (6.7 GB of weights) is cut into 8 pieces of at most 1.4 GB, so that each engine builds within the build machine's memory. The tensors between pieces stay on the GPU.
  • Precision: everything else keeps the precision the ONNX graphs give it (fp16).
  • No int8: TensorRT's int8 needs calibrated activations, and the ONNX int8/ build is weight-only MatMulNBits, which TensorRT doesn't take.

Memory.

  • Causal memories: they stay on the GPU between slices, in two alternating sets.
  • Scratch: each engine's scratch is sized for the call's frame size, not for the engine's largest. At 512 x 512 the VAE decoder's needs 9-10 GB; at 384 x 384, 5.7 GB for the first slice and 6.7 GB for the rest.
  • Peak: for a 17-frame clip at 384 x 384, 10.7 GB of system memory on Windows, GPU memory included. The ONNX build's decoder alone peaks near 15 GB there.

Benchmark.

  • Clips: the ONNX build's, two of 17 frames from FlashVSR's example clips with the low-res frames resized (bicubic) to the output size: example0 384 x 384, example1 512 x 288.
  • Original: projects/inference_seedvr2_3b.py (GitHub ByteDance-Seed/SeedVR @ e4de8c2) on CUDA under bf16 autocast, seed 666, every random draw recorded and replayed here (draws=). See the ONNX build's card for how the reference was made.
  • Score: PSNR of every output frame against the original's.
  • Pass mark (set before the first run): per clip, the mean and the worst-frame PSNR each at most 1 dB below the ONNX fp16 build's.
PSNR mean (example0 / example1) worst frame seconds per clip
original (PyTorch bf16, CUDA) - - 6.1 / 5.4
ONNX fp16/ (ONNX Runtime CUDA) 40.8 / 33.3 dB 40.5 / 32.9 dB 25
TensorRT fp16/ 40.0 / 32.4 dB 39.7 / 32.0 dB 24-28

Timing is on an RTX 3080 Laptop GPU and includes loading every engine. Inference itself takes about 6 s per clip; the rest is loading the 9.4 GB of engines, which happens again for each clip. The ONNX times include starting its three phase processes and their sessions. The engines' frames are 0.8-0.9 dB further from the original's than the ONNX build's are.

License. SeedVR2 is Apache-2.0 (LICENSE.txt in the folder).

How these were made

From SeedVR2 at revision 37255ff8cc: each engine was built with TensorRT's builder from Moonbox's published ONNX graph of the same model and precision. The network is strongly typed: every tensor keeps the precision the ONNX graph gives it, so an fp16 engine computes what the fp16 ONNX build computes. Built on an RTX 3080 Laptop GPU, it was benchmarked against the original before upload, and the sha256 column above is what the files must hash to.

License

Apache-2.0. These files are a derivative of the original model and carry its license: it is copied in this repository, and it governs your use of these files. The original model card follows unchanged.


Original model card

SeedVR

SeedVR2: One-Step Video Restoration via Diffusion Adversarial Post-Training

Jianyi Wang, Shanchuan Lin, Zhijie Lin, Yuxi Ren, Meng Wei, Zongsheng Yue, Shangchen Zhou, Hao Chen, Yang Zhao, Ceyuan Yang, Xuefeng Xiao, Chen Change Loy, Lu Jiang

SeedVR Website SeedVR2 Paper on ArXiv Github SeedVR Models SeedVR2 Space SeedVR2 Video Demo on YouTube

Recent advances in diffusion-based video restoration (VR) demonstrate significant improvement in visual quality, yet yield a prohibitive computational cost during inference. While several distillation-based approaches have exhibited the potential of one-step image restoration, extending existing approaches to VR remains challenging and underexplored, due to the limited generation ability and poor temporal consistency, particularly when dealing with high-resolution video in real-world settings. In this work, we propose a one-step diffusion-based VR model, termed as SeedVR2, which performs adversarial VR training against real data. To handle the challenging high-resolution VR within a single step, we introduce several enhancements to both model architecture and training procedures. Specifically, an adaptive window attention mechanism is proposed, where the window size is dynamically adjusted to fit the output resolutions, avoiding window inconsistency observed under high-resolution VR using window attention with a predefined window size. To stabilize and improve the adversarial post-training towards VR, we further verify the effectiveness of a series of losses, including a proposed feature matching loss without significantly sacrificing training efficiency. Extensive experiments show that SeedVR2 can achieve comparable or even better performance compared with existing VR approaches in a single step.

๐Ÿ“ฎ Notice

Limitations: These are the prototype models and the performance may not be perfectly align with the paper. Our methods are sometimes not robust to heavy degradations and very large motions, and shares some failure cases with existing methods, e.g., fail to fully remove the degradation or simply generate unpleasing details. Moreover, due to the strong generation ability, Our methods tend to overly generate details on inputs with very light degradations, e.g., 720p AIGC videos, leading to oversharpened results occasionally.

โœ๏ธ Citation

@article{wang2025seedvr2,
      title={SeedVR2: One-Step Video Restoration via Diffusion Adversarial Post-Training},
      author={Wang, Jianyi and Lin, Shanchuan and Lin, Zhijie and Ren, Yuxi and Wei, Meng and Yue, Zongsheng and Zhou, Shangchen and Chen, Hao and Zhao, Yang and Yang, Ceyuan and Xiao, Xuefeng and Loy, Chen Change and Jiang, Lu},
      booktitle={arXiv preprint arXiv:2506.05301},
      year={2025}
   }

@inproceedings{wang2025seedvr,
      title={SeedVR: Seeding Infinity in Diffusion Transformer Towards Generic Video Restoration},
      author={Wang, Jianyi and Lin, Zhijie and Wei, Meng and Zhao, Yang and Yang, Ceyuan and Loy, Chen Change and Jiang, Lu},
      booktitle={CVPR},
      year={2025}
   }

๐Ÿ“œ License

SeedVR and SeedVR2 are licensed under the Apache 2.0.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for moonbox-dev/SeedVR2-3B-TensorRT

Quantized
(10)
this model

Paper for moonbox-dev/SeedVR2-3B-TensorRT