Skip to main content

Overview

RRDBNet (Residual in Residual Dense Block Network) is the primary architecture used in Real-ESRGAN models. It’s based on ESRGAN and features a deep network with residual connections and dense blocks for high-quality image super-resolution. This architecture is imported from BasicSR and used in the flagship Real-ESRGAN models.
RRDBNet is defined in basicsr.archs.rrdbnet_arch and is part of the BasicSR library, which Real-ESRGAN depends on.

Class Definition

Parameters

int
default:"3"
Number of input channels. Typically 3 for RGB images.
int
default:"3"
Number of output channels. Typically 3 for RGB images.
int
default:"64"
Number of base feature channels. This determines the width of the network.
int
default:"23"
Number of RRDB (Residual in Residual Dense Block) blocks. More blocks increase model capacity and quality but also computational cost.Common configurations:
  • 23 blocks: Standard models (RealESRGAN_x4plus, RealESRGAN_x2plus)
  • 6 blocks: Lightweight anime model (RealESRGAN_x4plus_anime_6B)
int
default:"32"
Number of growth channels in dense blocks. Controls the feature growth rate within each dense block.
int
default:"4"
Upsampling scale factor. Real-ESRGAN models commonly use 2 or 4.

Architecture Details

RRDBNet consists of:
  1. Shallow feature extraction: Initial convolution layer
  2. Deep feature extraction: Stack of RRDB blocks with residual scaling
  3. Upsampling module: Convolution + PixelShuffle layers
  4. Reconstruction: Final convolution to output RGB image
Each RRDB block contains:
  • Multiple dense blocks with residual connections
  • Beta residual scaling for training stability
  • Feature reuse through dense connections
The “Residual in Residual” design allows for very deep networks (23+ blocks) while maintaining stable training through multiple levels of skip connections.

Model Configurations

RealESRGAN_x4plus (Standard)

The flagship Real-ESRGAN model for general image super-resolution at 4× scale.

RealESRNet_x4plus (No GAN)

Same architecture as RealESRGAN_x4plus but trained without adversarial loss, producing smoother results.

RealESRGAN_x4plus_anime_6B (Anime)

Lightweight model optimized for anime images with only 6 RRDB blocks.

RealESRGAN_x2plus (2× Scale)

For 2× super-resolution with the full 23-block architecture.

Usage Example

Integration with RealESRGANer

Comparison with SRVGGNetCompact

Choose RRDBNet for maximum quality on photos and general images. Use SRVGGNetCompact for faster processing, video upscaling, or when computational resources are limited.

Source

Defined in basicsr.archs.rrdbnet_arch (BasicSR library) Used in inference_realesrgan.py for model initialization