Skip to content

Upscaler Models

mold supports Real-ESRGAN super-resolution models for image upscaling. These models enhance image resolution by 2x or 4x using neural networks trained on image restoration tasks. Seven upscalers ship in the manifest: six RRDBNet builds and one SRVGGNetCompact build.

Before and After

bash
mold upscale sd15-castle.png --model real-esrgan-x4plus:fp16 \
  --output sd15-castle-4x.png

Model List

RRDBNet Architecture (High Quality)

The Residual-in-Residual Dense Block Network uses deep convolutional layers with dense connections for maximum quality.

ModelScaleParamsSizeDescription
real-esrgan-x4plus:fp164x16.7M32 MBGeneral-purpose, best quality
real-esrgan-x4plus:fp324x16.7M64 MBSame model, FP32 precision
real-esrgan-x2plus:fp162x16.7M32 MB2x upscale, best quality
real-esrgan-x2plus:fp322x16.7M64 MBSame model, FP32 precision
real-esrgan-x4plus-anime:fp164x4.5M8.5 MBAnime/illustration optimized (6 blocks)
real-esrgan-x4plus-anime:fp324x4.5M17 MBSame model, FP32 precision

SRVGGNetCompact Architecture (Fast)

A lightweight linear chain architecture optimized for speed. Uses significantly less compute than RRDBNet while maintaining good quality.

ModelScaleParamsSizeDescription
real-esrgan-anime-v3:fp324x0.6M2.4 MBFast anime/video upscaler

Architecture Details

RRDBNet

Input (3, H, W)
  ↓ Conv2d(3 → 64)
  ↓ [RRDB block × 23], each with 3 × ResidualDenseBlock (5 convs with dense connections)
  ↓ Conv2d(64 → 64)
  ↓ Upsample 2x (nearest) + Conv2d
  ↓ Upsample 2x (nearest) + Conv2d   ← only for 4x models
  ↓ Conv2d(64 → 64) + LeakyReLU
  ↓ Conv2d(64 → 3)
Output (3, H×scale, W×scale)

SRVGGNetCompact

Input (3, H, W)
  ↓ Conv2d(3 → 64)
  ↓ [PReLU + Conv2d(64 → 64)] × N
  ↓ PReLU
  ↓ Conv2d(64 → 3×scale²)
  ↓ PixelShuffle(scale)
Output (3, H×scale, W×scale)

Downloading

bash
# Pull the default high-quality upscaler
mold pull real-esrgan-x4plus:fp16

# Pull the fast compact upscaler
mold pull real-esrgan-anime-v3:fp32

# List all available models including upscalers
mold list

HuggingFace Sources

All upscaler models are sourced from trusted HuggingFace repositories:

Comparison

Use CaseRecommended ModelWhy
Photo upscalingreal-esrgan-x4plus:fp16Best detail preservation
Anime/mangareal-esrgan-x4plus-anime:fp16Trained on anime data
Batch processingreal-esrgan-anime-v3:fp325-10x faster
Video framesreal-esrgan-anime-v3:fp32Smallest, fastest
Subtle enhancementreal-esrgan-x2plus:fp162x is less aggressive

Framewise video upscale

mold video-upscale create clip.mp4 --wait creates a durable job from an existing Library video and publishes a new MP4. It decodes and processes one frame at a time with the same native Real-ESRGAN/Candle engine used for stills; it does not interpolate frames or perform temporal/generative restoration. Frame count, constant FPS, duration, and a codec-compatible primary audio track are verified before publication. Temporal flicker may remain.

The output is H.264 within level 5.2 so every phone, browser, and the Library thumbnailer can decode it. When the ×2 or ×4 frame would exceed that level (more than 36 864 macroblocks, more than 2 073 600 macroblocks per second at the source frame rate, or an edge over 4096 px), the encoder resamples it to the largest same-aspect frame that fits — a 960×960 clip ×4 publishes at 3072×3072 — and publication refuses anything larger. The Library marks the result Upscaled exactly as it marks an upscaled still.

The first contract accepts MP4, MOV, and WebM Library sources, but deliberately rejects VFR, HDR/high-bit-depth sources, subtitles, chapters, multiple audio tracks, and primary audio that cannot be copied safely into MP4. Use mold video-upscale status|pause|resume|cancel <job-id> to manage a job.