Vapoursynth RealESRGAN

From wiki.selur.net
Revision as of 09:51, 16 November 2026 by Selur (talk | contribs) (New filter page (via create-page on MediaWiki MCP Server))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

RealESRGAN runs the non-upscaling community models of the vs-realesrgan package: line refinement, denoising of MPEG-2 HDTV and LD/DVD anime, and cleanup of modern anime rips. It runs on an NVIDIA GPU through PyTorch; the upscaling models are in Vapoursynth RealESRGAN Resize.

Filtering → Vapoursynth → Other

RealESRGAN controls in Hybrid
RealESRGAN controls in Hybrid

What it does

Every frame is cleaned by a small Real-ESRGAN-style (compact) network trained on synthetic degradations. All models keep the frame size except DeNoise LDVD, which doubles it.

Requirements

  • Windows, Hybrid's torch add-on and an NVIDIA GPU with CUDA.
  • Tensor RT additionally needs Torch-TensorRT from the add-on; it cannot be combined with TensorRT in vs-mlrt filters in the same script.

Settings

Control Parameter Range / values Hybrid default Meaning
Model model AniScale2 refiner, DeNoise Hi, DeNoise LDVD, Fix HD AniScale2 refiner AniScale2 refiner: light sharpening and line fixing/thinning. DeNoise Hi: MPEG-2 artifacts of Japanese HDTV. DeNoise LDVD: dot crawl, rainbows, halos and ringing of LD/DVD anime (2× output). Fix HD: light cleanup and sharpening of modern anime.
GPU ID device_index 0 – 4 0 CUDA device.
Tile (x/y) tile 32 – 8192 off, 256 / 256 Splits the frame into tiles to save GPU memory.
Tile pad tile_pad 0 – 64 10 Overlap of the tiles; only with tiling.
Streams num_streams 1 – 64 1 Number of CUDA streams.
Batches batch_size 1 – 64 1 Frames processed together.
Tensor RT trt on/off off Uses TensorRT; the engine is built on the first run and cached.
FP16 – on/off off Half precision (16-bit float clip), with and without Tensor RT.
max WSS trt_workspace_size 0 – 1073741824 0 With Tensor RT: workspace size; 0 = not set.

Example

Default settings on a 10-bit YUV 4:2:0 source (640x356):

# adjusting color space from YUV420P10 to RGBS for vsRealESRGANFilter
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_in_s="limited", range_s="full")
# using RealESRGANFilter
clip = RealESRGAN(clip, model=201, device_index=0)

How Hybrid calls it

  • The clip is converted to 32-bit float RGB (16-bit float with FP16) and padded to mod 4.
  • Model and GPU ID are always written, and so is the tile pad while tiling is on; streams, batches and max WSS only when they differ from the defaults.
  • With DeNoise LDVD Hybrid continues with the doubled frame size.
  • With Tensor RT the engines are cached in the engine path from Hybrid's path settings (or the temp folder); one engine per resolution.
  • RealESRGAN also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

Real-ESRGAN

Real-ESRGAN (Wang et al., ICCV workshops 2021) extends ESRGAN with a high-order degradation model, so it is trained on synthetic data that resembles real-world blur, noise and compression. The models offered here are community models built on its compact architecture.

vs-realesrgan

HolyWu's vs-realesrgan runs Real-ESRGAN and community models in VapourSynth with PyTorch, optionally with TensorRT. A 16-bit float clip runs the network in half precision, a 32-bit float clip in full precision.

Sources