Real-ESRGAN

On this page 6

Real-ESRGAN is an open-source blind super-resolution model that enlarges low-resolution images, typically by a factor of two or four, while removing the blur, noise and compression artifacts found in real-world pictures. In generative media it serves as one of the most widely used AI upscaling engines, built into image generators, video tools and restoration workflows.

The model was published in 2021 by researchers associated with Tencent ARC Lab as an extension of ESRGAN, the Enhanced Super-Resolution Generative Adversarial Network. Its key contribution is not a new network shape but a realistic degradation pipeline for training, which teaches the network to repair images whose damage is unknown and mixed, rather than images that were merely shrunk.

How Real-ESRGAN restores detail

Real-ESRGAN restores detail by training a generator network to map damaged low-resolution inputs to sharp high-resolution outputs, while a discriminator network judges whether the results look like real photographs. This adversarial setup pushes the generator toward plausible textures instead of the smooth, blurry averages produced by pixel-wise loss alone.

The generator uses the RRDB architecture (residual-in-residual dense blocks) inherited from ESRGAN. The discriminator is a U-Net with spectral normalization, which gives feedback for every pixel instead of a single verdict per image and stabilizes training against strong artifacts. Training combines L1 pixel loss, perceptual loss computed on VGG features and adversarial loss.

The decisive ingredient is the second-order degradation model. Clean training images are degraded twice in random order with blur, resizing, noise and JPEG compression, and then passed through a sinc filter that imitates ringing and overshoot. Because the network sees this wide variety of damage, it generalizes to scanned prints, old web images and compressed video far better than models trained on bicubic downscaling.

The table below summarizes the main components of the pipeline and what each contributes.

ComponentWhat it doesEffect on output
RRDB generatorUpscales and reconstructs the imageProduces sharp edges and textures
U-Net discriminatorJudges realism per pixelReduces local artifacts
Second-order degradationSimulates mixed real-world damageImproves robustness on real inputs
Sinc filterImitates ringing and overshootRemoves halo artifacts
Perceptual and adversarial lossRewards natural appearanceAvoids waxy, over-smoothed results
Main components of the Real-ESRGAN pipeline

Model variants and typical settings

Real-ESRGAN is distributed as several pretrained models tuned for different content, and choosing the right one matters more than any other setting. General photographic models differ noticeably from those trained for illustration and anime.

ModelScaleBest suited for
RealESRGAN_x4plus4xGeneral photographs
RealESRGAN_x2plus2xModerate enlargement of photos
RealESRGAN_x4plus_anime_6B4xAnime and flat illustrations
realesr-animevideov32x to 4xAnimated video frames
realesr-general-x4v34xFast general use with adjustable denoise
Common pretrained Real-ESRGAN models

Practical settings include the output scale, which can be set lower than the native factor, a tile size that splits large images to fit GPU memory, and half-precision inference for speed. The lighter general model exposes a denoise strength parameter that trades texture retention against noise removal. A face enhancement option routes detected faces through GFPGAN, a separate face restoration network.

Hardware requirements are modest by current standards. A graphics card with 4 to 8 GB of video memory handles most still images at 4x when tiling is enabled, and a portable NCNN Vulkan build runs on AMD, Intel and Apple GPUs without a Python environment. Processing time grows roughly with output pixel count, so a 4x enlargement costs about four times as much as a 2x pass on the same input.

For video, frames are extracted, upscaled one by one and reassembled, usually with FFmpeg. Since the model has no temporal awareness, editors often apply mild denoising before upscaling and a light temporal filter afterward to keep motion smooth.

Real-ESRGAN compared with other upscalers

Real-ESRGAN occupies the middle ground between classical interpolation and diffusion-based upscalers. It is much sharper than bicubic resizing, yet it does not invent large structures the way generative creative upscalers do.

ApproachFidelity to sourceSpeedTypical artifact
Bicubic or Lanczos interpolationHigh but blurryInstantSoftness and jagged edges
Real-ESRGANModerate to highFast on a GPUOil-painting smoothing
SwinIR and transformer modelsHighSlowerOccasional over-smoothing
Diffusion upscalersLower, adds invented detailSlowHallucinated content
Commercial video upscalersVariableModerateTemporal flicker if misconfigured
Upscaling approaches compared

Because it is free, fast and permissively licensed under BSD-3-Clause, Real-ESRGAN became a default upscaler in AUTOMATIC1111, ComfyUI, InvokeAI and many desktop tools. Users of Stable Diffusion workflows often apply it in a hires fix step after generation.

Limitations and failure modes

Real-ESRGAN cannot recover information that was never captured; it predicts plausible detail from patterns learned during training. Results can look convincing while being factually wrong, which makes the model unsuitable for evidence, medical imaging or measurement.

  • Texture flattening: skin, foliage and fabric can turn into smooth, painterly surfaces.
  • Text distortion: small letters and numbers are often reshaped into illegible glyphs.
  • Temporal flicker: frame-by-frame video processing lacks consistency across frames.
  • Overprocessing: running the model repeatedly amplifies artifacts rather than adding detail.
  • Domain mismatch: satellite, microscopy and document scans differ from training data and degrade unpredictably.

The following decision table helps match common situations to an appropriate configuration.

SituationRecommended choiceReason
Old family photo with facesx4plus with face enhancementFaces need dedicated restoration
Anime screenshotAnime 6B modelPreserves flat colors and line art
Already sharp image2x model or interpolationAvoids needless smoothing
Large print on limited GPUSmaller tile sizePrevents out-of-memory errors
Choosing a configuration

The short version

Real-ESRGAN is a program that makes small, fuzzy pictures bigger and cleaner. It learned by studying many pairs of damaged and clean images. Now it can guess what the missing detail should look like.

Think of a skilled restorer filling in a faded painting. The result often looks great. However, the restorer is making an educated guess, not revealing hidden truth. That is why it suits photos and art, but not evidence.

Where it makes a difference

A small online shop has hundreds of product photos taken years ago at 800 by 600 pixels. The new storefront theme needs images at least 1,600 pixels wide, and reshooting every item would take weeks.

The shop’s designer runs the archive through the RealESRGAN_x2plus model on a consumer graphics card, processing each image in a few seconds. Product shapes, edges and labels come out crisp enough for the new layout, and the designer manually checks every photo with small printed text for distortion.

The outcome is a complete catalog refresh in two days instead of a costly photo shoot. About a dozen images with fine lettering still need a reshoot, which shows where the model reaches its limits.