explaingit

xinntao/real-esrgan

35,454PythonAudience · developerComplexity · 2/5StaleLicenseSetup · hard

TLDR

Python tool that upscales and restores blurry, compressed, or low-resolution images and videos using deep learning, handling real-world photo degradation.

Mindmap

mindmap
  root((Real-ESRGAN))
    What it does
      Upscales images
      Restores degraded photos
      Enhances video frames
      Removes compression artifacts
    Key features
      General photo model
      Anime-optimized model
      Face enhancement option
      Adjustable denoising
    Use cases
      Old photo restoration
      Document scanning
      Anime upscaling
      Video quality improvement
    Tech stack
      Python
      PyTorch
      NCNN-Vulkan
      GPU acceleration
    How to use
      Command line
      Python API
      Portable executables

Things people build with this

USE CASE 1

Restore old family photos or scanned documents to higher quality and clarity.

USE CASE 2

Upscale anime images or video frames for printing or higher-resolution display.

USE CASE 3

Enhance low-resolution security camera or compressed video footage.

USE CASE 4

Remove JPEG compression artifacts and blur from degraded digital images.

Tech stack

PythonPyTorchNCNN-VulkanCUDA

Getting it running

Difficulty · hard Time to first run · 1h+

Requires CUDA/GPU setup, PyTorch compilation, and NCNN-Vulkan backend configuration; multiple system dependencies.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice and license text.

In plain English

Real-ESRGAN is a Python tool for upscaling and restoring low-quality images and videos using deep learning. Upscaling means taking a small or degraded image and producing a larger, sharper, more detailed version, a process formally called super-resolution. The "ESRGAN" part stands for Enhanced Super-Resolution Generative Adversarial Network, a type of neural network designed specifically for this task. The "Real" prefix indicates that this version is specifically trained to handle the kinds of degradations that appear in real-world photos and scans, not just simple artificial downsampling. The problem Real-ESRGAN solves is that real-world images suffer from complex combinations of degradation: blurriness, JPEG compression artifacts, noise, and low resolution all at once. Earlier super-resolution tools were trained only on cleanly downsampled images and performed poorly on genuinely degraded inputs. Real-ESRGAN addresses this by training entirely on synthetic data that mimics realistic degradation patterns, producing a model that generalizes well to actual old photos, scanned documents, and compressed video frames. Key features include a general-purpose model for photographs, a specialized model optimized for anime images and video (using a much smaller, faster neural network), optional face enhancement by integrating a companion face restoration model called GFPGAN, and adjustable denoising strength to prevent over-smoothing. It supports processing images with alpha channels (transparency), gray images, and 16-bit images. You would use Real-ESRGAN when enhancing old or low-resolution photographs, restoring scanned artwork or documents, upscaling anime images for print, or improving video quality. It can be run via command line, Python API, or portable executables that require no Python installation. The tech stack is Python using PyTorch for neural network inference. Portable GPU-accelerated executables (via NCNN-Vulkan) are also available for Windows, Linux, and macOS.

Copy-paste prompts

Prompt 1
How do I use Real-ESRGAN to upscale a batch of old photos from the command line?
Prompt 2
Show me how to integrate Real-ESRGAN into a Python script to process images with face enhancement enabled.
Prompt 3
What's the difference between Real-ESRGAN's general model and the anime model, and when should I use each?
Prompt 4
How do I adjust the denoising strength in Real-ESRGAN to avoid over-smoothing my images?
Prompt 5
Can I use Real-ESRGAN on a Windows machine without installing Python?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.