How to restore faces with GFPGAN on a cloud GPU
Rent a GPU on Deploy, then open a terminal in JupyterLab or over SSH. Install GFPGAN from the official TencentARC/GFPGAN repository, download the weight the README’s wget line names, and run inference_gfpgan.py. Copy the results folder off the instance before you destroy it, because destroying the instance deletes its disk.
Another face-restoration install, whose README prints no GB figure, is How to restore faces with CodeFormer on a cloud GPU. The background upsampler this script loads is How to upscale images and video with Real-ESRGAN on a cloud GPU. A different upscaler, whose README comment prints 12G and 16G, is How to upscale images with SUPIR on a cloud GPU. How published FLUX and SDXL weight sizes are read: How much VRAM do I need for FLUX and SDXL. If the process runs out of memory: How to fix CUDA out of memory on a cloud GPU.
Use a photo you have the right to restore. The README says GFPGAN is released under Apache License Version 2.0. The LICENSE file says GFPGAN is licensed under the Apache License Version 2.0 except for the third-party components listed below. Its copyright line is Copyright © 2021 THL A29 Limited, a Tencent company. The GitHub license field on 2026-11-13 was NOASSERTION. The same file includes a section titled “Terms of the Nvidia License” for the StyleGAN2 component. Section 3.3 says the work and any derivative works thereof only may be used or intended for use non-commercially, and it defines non-commercially as for research or evaluation purposes only. The same file lists DFDNet under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 and facexlib under the MIT license, copyright © 2020 Xintao Wang. Read the file before you redistribute the program.
The commands below are copied from the upstream files named in each step. They were not run on a CloudGPU instance for this page. Anything this page adds around them is marked.
What the README says about memory
The README, requirements.txt, and inference_gfpgan.py print no GB figure (read 2026-11-13). The dependencies list says Python >= 3.7, PyTorch >= 1.7, and that an NVIDIA GPU plus CUDA is optional.
GET /v1/public/compute-capabilities does not list GPUs. It returns feature flags. The memory column is vram_gb from gpu-prices.json, updated_at 2026-11-13T09:12:35.958Z. GET /v1/public/gpu-catalog the same day (generated_at 2026-11-13T09:12:36.283Z) listed the same names and the same vram_gb values, plus Ascend 910B at 64, which is not in gpu-prices.json and is not listed here. The catalog response also includes an availability field. This page does not copy it. Every prices row has gpu_count 1. The smallest vram_gb in that file is 8, on RTX 2080. There is no upstream GB cutoff to match these values against. This page did not run GFPGAN and does not mark a row as enough. Which listing you can start is on Deploy.
The catalog template list had no GFPGAN template. The catalog template named CodeFormer has id codeformer, recommended_gpu RTX 4090 48G, and min_vram_gb 16. Those are template fields for a different install.
| Catalog name | vram_gb |
|---|---|
| RTX 2080 | 8 |
| RTX 3080 | 10 |
| RTX 2080 Ti | 11 |
| RTX 3080 Ti | 12 |
| V100 16G | 16 |
| A30 | 24 |
| RTX 3090 | 24 |
| RTX 4090 | 24 |
| RTX 4090D | 24 |
| RTX 4080 SUPER 32G | 32 |
| RTX 5090 | 32 |
| RTX 5090D | 32 |
| V100 32G | 32 |
| A100 40G | 40 |
| A800 40G | 40 |
| A40 | 48 |
| RTX 4090 48G | 48 |
| RTX 4090D 48G | 48 |
| RTX A6000 | 48 |
| NVIDIA RTX PRO 5000 72G | 72 |
| RTX PRO 5000 72G | 72 |
| A100 80G | 80 |
| A800 80G | 80 |
| H800 | 80 |
| RTX 6000D | 83 |
| H20 96G | 96 |
| RTX PRO 6000 96G | 96 |
| RTX PRO 6000 Max-Q | 96 |
| H20-3e 141G | 141 |
Install
On Deploy, choose Raw GPU. The clean-install block, copied from the README:
git clone https://github.com/TencentARC/GFPGAN.git
cd GFPGAN
# Install basicsr - https://github.com/xinntao/BasicSR
# We use BasicSR for both training and inference
pip install basicsr
# Install facexlib - https://github.com/xinntao/facexlib
# We use face detection and face restoration helper in the facexlib package
pip install facexlib
pip install -r requirements.txt
python setup.py develop
# If you want to enhance the background (non-face) regions with Real-ESRGAN,
# you also need to install the realesrgan package
pip install realesrgan
requirements.txt lists basicsr>=1.4.2, facexlib>=0.2.5, torch>=1.7, and torchvision. It does not print a CUDA index URL. The commits API for the default branch master listed 7552a7791caad982045a7bbe5634bbf1cd5c8679, committed 2024-04-02T16:39:30Z. README.md and inference_gfpgan.py were bc5a5deb95a4a9653851177985d617af1b9bfa8b, committed 2022-09-16T11:31:20Z. requirements.txt was 3e27784b1b4eb008d06c04dbbaf6bdde34c4da84, committed 2022-08-31T09:36:25Z.
The RTX 5090 guide says that card is compute capability 12.0 (sm_120) and that PyTorch 2.7 and later, on a build for CUDA 12.8 or newer, is the line that announced support. requirements.txt pins torch>=1.7, which is below that line. This page did not re-test GFPGAN on an RTX 5090. Catalog RTX 5090 and RTX 5090D are 32. That is the catalog number only.
Weights and inference
The README’s v1.3 download and the command it prints:
wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -P experiments/pretrained_models
python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.3 -s 2
The usage text in the README says the version options are 1, 1.2, or 1.3, default 1.3. Upscale default is 2. Background upsampler default is realesrgan. bg_tile default is 400, and the help text says 0 means no tile during testing. Other flags in that usage text are -suffix, -only_center_face, -aligned, and -ext with options auto, jpg, or png. The model-zoo table lists V1.3 GFPGANv1.3.pth, V1.2 GFPGANCleanv1-NoCE-C2.pth, and V1 GFPGANv1.pth. It says V1.3 is not always better than V1.2.
The script accepts two versions that usage text does not list. args.version == '1.4' uses GFPGANv1.4.pth from https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth. args.version == 'RestoreFormer' uses RestoreFormer.pth from https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/RestoreFormer.pth. The updates section links the same V1.4 file and says it produces slightly more details and better identity than V1.3. That sentence is the updates line. This page did not remeasure it. The updates section also says RestoreFormer inference codes were added. The model-zoo table does not list V1.4 or RestoreFormer.
The script looks for experiments/pretrained_models/<name>.pth, then gfpgan/weights/<name>.pth. If neither file is present, it sets the model path to the URL above. The -w / --weight flag defaults to 0.5. That flag is not in the README usage text.
When --bg_upsampler equals realesrgan and CUDA is available, the script constructs RealESRGANer with model_path https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.1/RealESRGAN_x2plus.pth, tile from --bg_tile, and half=True. Any other value of --bg_upsampler sets the upsampler to none. If CUDA is not available, the script warns and also sets the upsampler to none. The warning string says the unoptimized RealESRGAN is slow on CPU.
For each input image the script writes cropped_faces, restored_faces, and cmp under the output folder, and, when a restored image is returned, restored_imgs. The output folder defaults to results. The script then prints that results are in that folder. This page did not run the command.
PaperModel.md is the install for the original paper model. Its clone line is git clone https://github.com/xinntao/GFPGAN.git, which is not the TencentARC URL in the README. Its wget line downloads GFPGANv1.pth into experiments/pretrained_models. Option 1 prefixes the inference command with BASICSR_JIT=True. Option 2’s install comment states a compile duration. This page does not copy that comment or that command. The option 1 inference lines, copied:
BASICSR_JIT=True python inference_gfpgan.py --input inputs/whole_imgs --output results --version 1
# for aligned images
BASICSR_JIT=True python inference_gfpgan.py --input inputs/whole_imgs --output results --version 1 --aligned
PaperModel.md was commit 24b1f24ef561b2d20e3bbb607c2ce1f43f872e7b, committed 2022-02-14T03:21:03Z. These commands were not run.
Web UI and ComfyUI
The updates section links a hosted Gradio demo. This repository has no Gradio launch script. This page does not add an SSH port forward for a UI the repository does not ship. The README does not document a ComfyUI install. The ComfyUI examples top-level directory list on 2026-11-13 had no directory named for this project. Examples HEAD was f9431bb000ce792094ff345446e22cac1ea6cef3, committed 2025-11-26T20:33:58Z. Installing ComfyUI itself is How to install ComfyUI and ComfyUI-Manager on a cloud GPU. This page does not add a ComfyUI install.
When it fails
CUDA out of memory. The files this page read do not print a low-memory flag for that error. --bg_tile is the tile size for the background sampler, and the help text says 0 means no tile. If the process raises that error, use how to fix CUDA out of memory on a cloud GPU.
“CUDA error: no kernel image is available for execution on the device” on an RTX 5090. See the install section. This page did not re-test the package on that card.
Version text and the script disagree. The README usage text lists versions 1, 1.2, and 1.3. The script also accepts 1.4 and RestoreFormer. The model-zoo table lists V1, V1.2, and V1.3.
Save the images, then destroy
Copy results/restored_imgs, results/restored_faces, results/cropped_faces, and results/cmp before you destroy the instance. The default -o value is results. Save your work before you destroy a cloud GPU is the checklist. The terms say data on local instance storage is permanently deleted when the instance is destroyed.
The pricing page FAQ states the billing rule in these words:
Per-minute options have a 1-minute minimum; unused prepaid minutes are refunded when you destroy the instance. Some configurations use whole-hour billing with a 1-hour minimum; unused time within a charged hour is not refunded on voluntary stop. The billing period, minimum charge and initial prepayment are shown before confirmation. No subscription.
Frequently asked questions
What memory figure does the GFPGAN README print?
The README, requirements.txt, and inference_gfpgan.py print no GB figure. GET /v1/public/compute-capabilities does not list GPUs. vram_gb in gpu-prices.json (updated_at 2026-11-13T09:12:35.958Z) matches GET /v1/public/gpu-catalog (generated_at 2026-11-13T09:12:36.283Z), except Ascend 910B at 64, which is not in gpu-prices.json and is not listed on this page. The smallest vram_gb in that prices file is 8, on RTX 2080. There is no upstream GB cutoff to match these values against. The catalog template list had no GFPGAN template. The catalog template named CodeFormer has id codeformer, recommended_gpu RTX 4090 48G, and min_vram_gb 16. Those are template fields for a different install. This page did not run GFPGAN and does not mark a catalog row as enough. Which listing you can start is on https://cloudgpu.app/deploy.
Which command and flags does the README document, and where does the script save files?
The README command is python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.3 -s 2. Its usage text says version options are 1, 1.2, or 1.3, default 1.3, upscale default 2, and background upsampler default realesrgan, with bg_tile default 400. The script also accepts version 1.4 and RestoreFormer, which the usage text does not list. The updates section links GFPGANv1.4.pth and says it produces slightly more details and better identity than V1.3. The weight flag on the script, written as -w, defaults to 0.5 and is not in that usage text. When the bg_upsampler flag is realesrgan and CUDA is available, the script points RealESRGANer at https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.1/RealESRGAN_x2plus.pth. It writes cropped_faces, restored_faces, cmp, and restored_imgs under the output folder, which defaults to results, and prints that results are in that folder. This page did not run the command.
Does the GFPGAN repository ship a local Gradio app or a ComfyUI install?
The updates section links a hosted Gradio demo. This repository has no Gradio launch script, so this page does not add an SSH port forward for one. The README does not document a ComfyUI install. The ComfyUI examples top-level directory list on 2026-11-13 had no directory named for this project. Examples HEAD was f9431bb000ce792094ff345446e22cac1ea6cef3, committed 2025-11-26T20:33:58Z.
Which license covers the GFPGAN code?
The README says GFPGAN is released under Apache License Version 2.0. The LICENSE file says GFPGAN is licensed under the Apache License Version 2.0 except for the third-party components listed below, and its copyright line names THL A29 Limited, a Tencent company, for 2021. The GitHub license field on 2026-11-13 was NOASSERTION. The same file includes a section titled Terms of the Nvidia License for the StyleGAN2 component. Section 3.3 says the work and any derivative works thereof only may be used or intended for use non-commercially, and it defines non-commercially as for research or evaluation purposes only. It also lists DFDNet under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 and facexlib under the MIT license. Section 2 of the Apache terms in that file grants a no-charge, royalty-free copyright license. That wording is the upstream license, not a CloudGPU price and not a storage allowance. Read the file before you redistribute the program.
Sources (read 2026-11-13, Asia/Shanghai)
- GFPGAN README (clone
https://github.com/TencentARC/GFPGAN.git, pip install, wget forGFPGANv1.3.pth,python inference_gfpgan.py -i inputs/whole_imgs -o results -v 1.3 -s 2, usage flags, model zoo, V1.4 update line, Apache 2.0 sentence, hosted Gradio link): https://github.com/TencentARC/GFPGAN/blob/master/README.md commitbc5a5deb95a4a9653851177985d617af1b9bfa8b. Repository HEAD7552a7791caad982045a7bbe5634bbf1cd5c8679, committed 2024-04-02T16:39:30Z inference_gfpgan.py(versions 1, 1.2, 1.3, 1.4, RestoreFormer,--weightdefault 0.5, RealESRGAN_x2plus URL,cropped_faces,restored_faces,cmp,restored_imgs): commitbc5a5deb95a4a9653851177985d617af1b9bfa8brequirements.txt(torch>=1.7,basicsr>=1.4.2,facexlib>=0.2.5): commit3e27784b1b4eb008d06c04dbbaf6bdde34c4da84PaperModel.md(clone URLhttps://github.com/xinntao/GFPGAN.git,BASICSR_JIT=Trueinference, option 2 timing sentence not copied): commit24b1f24ef561b2d20e3bbb607c2ce1f43f872e7bLICENSE(Apache 2.0 except listed third-party components, copyright line, “Terms of the Nvidia License” section 3.3, DFDNet CC BY-NC-SA 4.0, facexlib MIT): commit7023b5cbdd86a4ad3d71776734894fe55b9e2f15. GitHub license field NOASSERTION- ComfyUI examples top-level directories (no GFPGAN directory): https://github.com/comfyanonymous/ComfyUI_examples commit
f9431bb000ce792094ff345446e22cac1ea6cef3 - Public GPU memory: https://cloudgpu.app/gpu-prices.json (
updated_at2026-11-13T09:12:35.958Z) and https://cloudgpu.app/v1/public/gpu-catalog (generated_at2026-11-13T09:12:36.283Z).GET /v1/public/compute-capabilitiesreturned feature flags and no GPU list. The catalog had no GFPGAN template. The catalog templatecodeformeris named CodeFormer
Cards you can start are on the Deploy page. Prices are on https://cloudgpu.app/pricing and are not repeated here.
Last updated: 2026-11-13 (Asia/Shanghai).