Skip to main content

Overview

Real-ESRGAN provides several models optimized for general real-world images, including photos, screenshots, and natural scenes. This guide covers model selection and best practices for general image super-resolution.

RealESRGAN_x4plus (Primary)

The default and most versatile model for general images.
wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P weights
Specifications:
  • Upscale Factor: 4x
  • Architecture: RRDBNet (23 blocks)
  • Model Size: ~64MB
  • Best For: Photos, natural images, general scenes

realesr-general-x4v3 (Denoise Control)

A smaller, faster model with controllable denoising strength.
wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth -P weights
wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-wdn-x4v3.pth -P weights
Specifications:
  • Upscale Factor: 4x
  • Architecture: SRVGGNetCompact (32 conv layers)
  • Model Size: ~17MB (much smaller than x4plus)
  • Best For: Images where you want to control noise vs. detail trade-off
  • Denoise Strength: 0 (keep noise/texture) to 1 (strong denoise)
The realesr-general-x4v3 model requires both the base model and the denoise model (wdn) for the -dn option to work.

RealESRGAN_x2plus (2x Upscaling)

For moderate upscaling when 4x is too aggressive.
wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.1/RealESRGAN_x2plus.pth -P weights
Specifications:
  • Upscale Factor: 2x
  • Architecture: RRDBNet (23 blocks)
  • Best For: Images that need moderate enhancement

RealESRNet_x4plus (No GAN)

ESRGAN model without GAN training - produces smoother results.
wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.1/RealESRNet_x4plus.pth -P weights
Specifications:
  • Upscale Factor: 4x
  • Architecture: RRDBNet (23 blocks)
  • Best For: When you want smoother results without GAN artifacts

Model Comparison

Use CaseRecommended ModelNotes
General photosRealESRGAN_x4plusBest overall quality
Photos with facesRealESRGAN_x4plus + --face_enhanceCombines super-resolution with GFPGAN
Noisy imagesrealesr-general-x4v3 with high --denoise_strengthControl noise reduction
Textured imagesrealesr-general-x4v3 with low --denoise_strengthPreserve texture details
Quick processingrealesr-general-x4v3Smaller, faster model
Moderate upscalingRealESRGAN_x2plus2x instead of 4x
Smooth resultsRealESRNet_x4plusNo GAN artifacts

Common Usage Patterns

Standard Workflow

1

Prepare Images

Place your images in the inputs folder:
mkdir -p inputs
cp /path/to/your/images/* inputs/
2

Run Inference

Process with the appropriate model:
python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs -o results
3

Check Results

Enhanced images are saved in the results folder with the _out suffix.

Advanced Examples

# Upscale to exactly 3.5x
python inference_realesrgan.py -n RealESRGAN_x4plus -i input.jpg --outscale 3.5

Tips for Best Results

CUDA Out of MemoryFor high-resolution images, use the --tile option:
python inference_realesrgan.py -n RealESRGAN_x4plus -i large_image.jpg --tile 400
Smaller tile sizes use less memory but may introduce slight artifacts at tile boundaries.
Denoise Strength GuidelinesWhen using realesr-general-x4v3:
  • 0.0-0.3: Preserve original texture and noise (good for film grain)
  • 0.4-0.6: Balanced (default is 0.5)
  • 0.7-1.0: Strong noise reduction (good for compressed images)
Arbitrary Output ScaleUse --outscale for any target size:
# Exactly 1.5x
python inference_realesrgan.py -n RealESRGAN_x4plus -i input.jpg --outscale 1.5

# Exactly 10x
python inference_realesrgan.py -n RealESRGAN_x4plus -i input.jpg --outscale 10
The model upscales to its native scale (e.g., 4x), then resizes to your target using LANCZOS4.

Batch Processing

Process entire folders efficiently:
# Process all images in a folder
python inference_realesrgan.py -n RealESRGAN_x4plus -i input_folder -o output_folder

# With custom settings
python inference_realesrgan.py -n RealESRGAN_x4plus -i input_folder -o output_folder \
  --outscale 4 --tile 400 --ext png
The script automatically processes all supported images in the input folder.

Special Image Types

RGBA Images (With Transparency)

Real-ESRGAN automatically handles alpha channels:
python inference_realesrgan.py -n RealESRGAN_x4plus -i image_with_alpha.png
  • Alpha channels are upsampled using the method specified by --alpha_upsampler (default: realesrgan)
  • Output is always saved as PNG to preserve transparency

Grayscale Images

Grayscale images are supported natively:
python inference_realesrgan.py -n RealESRGAN_x4plus -i grayscale.jpg

16-bit Images

High bit-depth images are automatically handled:
python inference_realesrgan.py -n RealESRGAN_x4plus -i 16bit_image.png

Performance Optimization

Multi-GPU Usage

Specify GPU device:
# Use GPU 0
python inference_realesrgan.py -n RealESRGAN_x4plus -i input.jpg --gpu-id 0

# Use GPU 1
python inference_realesrgan.py -n RealESRGAN_x4plus -i input.jpg --gpu-id 1

Memory Management

# Use smaller tiles and general model
python inference_realesrgan.py -n realesr-general-x4v3 -i input.jpg --tile 256

Next Steps

Face Enhancement

Enhance faces in your photos with GFPGAN integration

Anime Images

Learn about specialized models for anime content

Build docs developers (and LLMs) love