Real-ESRGAN x4plus
This repository hosts the RealESRGAN_x4plus.pth pre-trained generator weights from the xinntao/Real-ESRGAN project. The file is a 1:1 mirror of the asset originally released by Xintao Wang on July 22, 2021 as part of Real-ESRGAN v0.1.0. Per the v0.1.0 release notes, "This release is mainly for storing pre-trained models and executable files."
Real-ESRGAN extends ESRGAN to a practical blind super-resolution setting by training with a high-order degradation model and pure synthetic data (Wang et al., 2021). This particular checkpoint is the general-purpose 4Γ image super-resolution model and is the default model selected by inference_realesrgan.py in the upstream repository.
π Model Details
| Field | Value |
|---|---|
| Original release | v0.1.0, 22 Jul 2021 |
| Authors | Xintao Wang, Liangbin Xie, Chao Dong, Ying Shan β Tencent ARC Lab; Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences (paper) |
| Architecture | RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32, scale=4) (source) |
| Upscale factor | 4Γ |
| Weight file | RealESRGAN_x4plus.pth (~67 MB) |
| Paper | Wang et al., 2021 β Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data (ICCVW 2021) |
| License | BSD 3-Clause, Copyright (c) 2021 Xintao Wang |
| Source repository | github.com/xinntao/Real-ESRGAN |
| Original asset URL | github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth |
β‘ Intended Use
x4plus is a general-purpose super-resolution model β it works well across a broad range of natural images and is the default model recommended by the upstream Real-ESRGAN README for everyday use. For anime / illustration content, the smaller amd/realesrgan-x4plus-anime-6b checkpoint (6-block variant, ~18 MB) is a better fit.
π οΈ How to Use
The canonical entry point is the upstream Real-ESRGAN repository. The workflow below mirrors the Quick Inference section of the upstream README:
# 1. Clone Real-ESRGAN
git clone https://github.com/xinntao/Real-ESRGAN.git
cd Real-ESRGAN
# 2. Install dependencies
pip install basicsr facexlib gfpgan
pip install -r requirements.txt
python setup.py develop
# 3. Download the weights from this Hugging Face repo
huggingface-cli download amd/realesrgan-x4plus RealESRGAN_x4plus.pth --local-dir weights
# 4. Run inference
python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs --face_enhance
See the upstream README.md for the full set of CLI options (--outscale, --tile, --fp32, etc.). A portable NCNN executable variant is also available via the realesrgan-x4plus model name in Real-ESRGAN-ncnn-vulkan.
π Training Data
Per the Real-ESRGAN paper (Wang et al., 2021, Β§5), the original Real-ESRGAN models were trained on three image datasets:
- DIV2K β 800 2K-resolution images for image restoration tasks.
- Flickr2K β 2,650 2K-resolution images.
- OutdoorSceneTraining (OST) β 10,324 1K- to 2K-resolution images of outdoor scenes.
Training inputs are synthetically degraded via the high-order blur / downsample / noise / JPEG pipeline described in the paper.
β οΈ Caveats and Recommendations
Wang et al. (2021) note that Real-ESRGAN can introduce aliasing, unpleasant artifacts, and may fail to remove complicated degradations. Results vary by content type β use amd/realesrgan-x4plus-anime-6b for anime/illustration imagery rather than this checkpoint.
π Citation
If you use this model, please cite the original Real-ESRGAN paper:
@InProceedings{wang2021realesrgan,
author = {Xintao Wang and Liangbin Xie and Chao Dong and Ying Shan},
title = {Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data},
booktitle = {International Conference on Computer Vision Workshops (ICCVW)},
date = {2021}
}
π License
These weights are distributed under the BSD 3-Clause License, Copyright (c) 2021 Xintao Wang (upstream LICENSE). This repository re-hosts the original artifact unchanged; please attribute the original authors when using or redistributing the weights.
π€ Acknowledgments
All credit for the model architecture, training methodology, and weights goes to Xintao Wang and the Real-ESRGAN authors at Tencent ARC Lab and the Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences. This Hugging Face repository exists only as a convenient mirror of the pre-trained weight file alongside its license and citation context.