TopGit
GitHub Repo Review

Real-ESRGAN: image super-resolution for real photos

xinntao/Real-ESRGAN
RTopGit review image for xinntao/Real-ESRGAN
Review by Topgit.dev for xinntao/Real-ESRGAN, with GitHub repository stats and README context.
Quick verdict

Real-ESRGAN is a practical pick for real photos, scans, or anime frames carrying real noise and JPEG compression, not the clean synthetic benchmarks most super-resolution models chase. It beats plain ESRGAN here because its training data mimics real degradation instead of a tidy downscale. The catch: fiddly Python setup or a portable ncnn build with fewer options โ€” neither ships a one-click GUI.

Stars
โ˜… 37.7k
Forks
โ‘‚ 4.6k
Contributors
๐Ÿ‘ฅ 11
Language
Python
License
BSD-3-Clause
Topic
AI Tools
Updated
Aug 2024
Homepage
โ€”

Why real-world images are hard to upscale

Most super-resolution models are trained on images that were cleanly downscaled with a known kernel, so they only learn to reverse one predictable blur. Real photos, scanned pictures, and re-encoded anime frames go through JPEG compression, sensor noise, and repeated resizing before anyone tries to upscale them, and a model trained only on synthetic bicubic downscaling falls apart on that mess. Real-ESRGAN's whole premise is synthetic data training on degradation pipelines designed to mimic that mess instead of one clean downscale โ€” the specific bet the repo makes over the original ESRGAN.

What is Real-ESRGAN

Real-ESRGAN is a PyTorch GAN for real-world image and video restoration from Tencent ARC Lab, extending ESRGAN into what its own paper calls blind super-resolution: trained on purely synthetic degraded data instead of hand-paired real/fake examples. It ships pretrained models for general photos, anime illustrations, and anime video, plus a portable ncnn/Vulkan build that runs without installing CUDA or PyTorch at all.

Key features and model options

  • โœ“Multiple pretrained models: realesrgan-x4plus for general photos, realesrnet-x4plus, realesrgan-x4plus-anime, RealESRGAN_x4plus_anime_6B, and the animation-tuned realesr-animevideov3.
  • โœ“The tiny realesr-general-x4v3 model adds a -dn flag to dial denoising strength up or down instead of baking in one fixed noise level.
  • โœ“Face enhancement via a built-in GFPGAN integration, toggled with --face_enhance.
  • โœ“Arbitrary output scale through --outscale, which runs the x4 model then does a cheap LANCZOS4 resize to hit the exact ratio you asked for.
  • โœ“Tile-based inference to process large images in chunks instead of running out of VRAM in one pass.
  • โœ“Handles alpha-channel, grayscale, and 16-bit images directly in the Python inference script, not just standard 8-bit RGB.
  • โœ“A separate ncnn-vulkan portable build runs on Intel, AMD, and Nvidia GPUs with no PyTorch or CUDA install required.
How this repository's GitHub stars have grown over time. Source: star-history.com.View the star history โ†—

What you can use Real-ESRGAN for

  • โ€ขUpscaling old or low-res personal photos where you also want faces sharpened, using --face_enhance.
  • โ€ขWorking as an anime image upscaler via the dedicated RealESRGAN_x4plus_anime_6B or realesrgan-x4plus-anime models.
  • โ€ขBatch-upscaling anime video frame-by-frame with the realesr-animevideov3 model line.
  • โ€ขJPEG artifact removal on images pulled from the web before printing or further editing, since the training data specifically models compression artifacts.
  • โ€ขRunning inference on a machine without a CUDA GPU or PyTorch installed, via the portable ncnn-vulkan executable.

Installing Real-ESRGAN

Real-ESRGAN requires Python 3.7 or newer and PyTorch 1.7 or newer (the README recommends Anaconda or Miniconda for managing that). Clone the repo with `git clone https://github.com/xinntao/Real-ESRGAN.git` and `cd Real-ESRGAN`, then install what it depends on: `pip install basicsr` (used for both training and inference), `pip install facexlib` and `pip install gfpgan` (needed only for face enhancement), `pip install -r requirements.txt`, and finally `python setup.py develop`. If you'd rather skip Python entirely, the portable ncnn-vulkan executables for Windows, Linux, and macOS bundle the binaries and models and need no CUDA or PyTorch setup at all.

Running Real-ESRGAN on your images

Download a pretrained model first, e.g. `wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P weights`, then run `python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs --face_enhance` โ€” output lands in the `results` folder. A fuller example from the README: `python inference_realesrgan.py -n RealESRGAN_x4plus -i infile --outscale 3.5 --face_enhance` combines a custom scale factor with face restoration in one call. For anime images, swap in `RealESRGAN_x4plus_anime_6B` after downloading its weights the same way. The `-t`/`--tile` flag splits large images into tiles if you run low on VRAM, and `--fp32` switches off the default half-precision inference.

Strengths of Real-ESRGAN

  • โœ“Ships multiple purpose-built models instead of one general checkpoint, so you pick anime vs. photo vs. video without retraining.
  • โœ“Face enhancement is a single flag away (--face_enhance) rather than a separate pipeline to wire up yourself.
  • โœ“The ncnn-vulkan portable build removes the PyTorch/CUDA install entirely for anyone who just wants a working binary.
  • โœ“Training code is released too, so finetuning on your own paired data is documented, not just inference.
  • โœ“BSD-3-Clause licensing is permissive enough to drop into a commercial pipeline without a copyleft obligation.

Limitations and known issues

  • โ–ณThe portable ncnn-vulkan executable doesn't support every option the Python script does โ€” outscale among them โ€” so you lose flexibility for the convenience of skipping the PyTorch install.
  • โ–ณTiled inference in the ncnn build can introduce visible block inconsistency at tile borders, and results differ slightly from the PyTorch implementation of the same model.
  • โ–ณThe README doesn't document a general-purpose video-upscaling workflow outside the anime-specific AnimeVideo-v3 model; there's no video command shown for photorealistic footage.
  • โ–ณGPU requirements for the Python path aren't clearly documented โ€” you're left inferring VRAM needs from the --tile option rather than reading a stated minimum.
View on GitHub โ†—

Real-ESRGAN alternatives

waifu2x โ€” the README's own point of comparison for anime upscaling; a longstanding project many still use specifically for anime frames.ESRGAN โ€” the original GAN Real-ESRGAN extends. Real-ESRGAN vs ESRGAN comes down to synthetic real-world degradation training versus a single clean downscale, so plain ESRGAN is still worth trying if your inputs really are clean synthetic downscales.

Frequently asked questions

Is Real-ESRGAN free for commercial use?

Real-ESRGAN's code is released under the BSD-3-Clause license, a permissive open-source license that allows commercial use, modification, and redistribution as long as the copyright notice stays intact.

What GPU do I need to run Real-ESRGAN?

Real-ESRGAN's README doesn't state a minimum GPU or VRAM requirement. The Python inference path uses PyTorch and offers a --tile option to process images in chunks when memory is tight, while the separate ncnn-vulkan portable build runs on Intel, AMD, or Nvidia GPUs without needing CUDA or PyTorch installed.

How does Real-ESRGAN compare to waifu2x for anime upscaling?

Real-ESRGAN's README points to its anime_model.md doc for a detailed comparison between the RealESRGAN_x4plus_anime_6B model and waifu2x rather than stating results inline. What the README does say is that RealESRGAN_x4plus_anime_6B was built specifically for anime images with a much smaller model size than the general x4plus model.

Can Real-ESRGAN upscale videos?

Real-ESRGAN handles video mainly through its anime-specific line, the RealESRGAN AnimeVideo-v3 model, documented separately in anime_video_model.md with its own demo and comparisons. The core Python script, inference_realesrgan.py, is built around still images, so a general-purpose video workflow isn't documented in the base repo.

What Python version and dependencies does Real-ESRGAN require?

Real-ESRGAN needs Python 3.7 or newer and PyTorch 1.7 or newer, plus basicsr for training and inference, and facexlib and gfpgan specifically for the face-enhancement feature. All of it installs via pip alongside the repo's own requirements.txt.

Does Real-ESRGAN support face enhancement?

Real-ESRGAN supports face enhancement by integrating GFPGAN โ€” pass the --face_enhance flag to inference_realesrgan.py and it restores and sharpens detected faces alongside the general upscaling pass.

Who should try it โ€” and who should skip

Try Real-ESRGAN if you want an image upscaling tool for real photos, scans, or anime frames that already carry noise and compression artifacts, and you're comfortable in a Python environment (or fine with the ncnn-vulkan binary) โ€” that's the exact problem its synthetic training data targets. Skip it if you need a polished one-click desktop app out of the box; the repo hands you a script and pretrained weights, not a GUI, and building a smooth end-user experience is left to third-party wrappers like the ones the README links to.

Related repositories

Source & attribution

Facts sourced from the xinntao/Real-ESRGAN GitHub repository (github.com/xinntao/Real-ESRGAN), including its README and linked docs.

GitHub data ยท last synced Aug 15, 2026Reviewed by Henry
โ† Back to TopGit

Want a second opinion on Real-ESRGAN?

Ask an AI that can read this page โ€” one click and you get its take on Real-ESRGAN.

GitHub