Real-ESRGAN: image super-resolution for real photos
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.
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.
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.
Real-ESRGAN alternatives
Frequently asked questions
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.
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.
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.
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.
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.
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
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.
