ComfyUI-GPENO

ComfyUI-GPENO
★ 67

人脸修复GPEN高速自动下载模型
在ComfyUI中对输入图像执行GPEN人脸修复,首次运行自动下载依赖,较其它实现显著加速,适合高效后处理。
💡 用于图像后处理流水线的高速人脸修复。
🍴 5 Forks💻 Python🔄 2025-04-15
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/a9fb3a59e10c
📦 requirements.txt
ninja
torch
torchvision
opencv-python
numpy
scikit-image
scipy
pillow
tqdm
workflow_gpeno
📄 README

ComfyUI-GPENO

A node for ComfyUI that performs GPEN face restoration on the input image(s). The “O” in “GPENO” stands for “Optimized,” as I have implemented various performance improvements that significantly boost speed.

Installation

Simply drag the image above into ComfyUI and use ComfyUI Manager » Install Missing Custom Nodes.

[!NOTE]

ComfyUI-GPENO will download GPEN dependencies upon first use. The destinations are comfyui/models/facerestore_models and comfyui/models/facedetection.

Performance Evaluation

Face restoration is commonly applied as a post-processing step in faceswap workflows. I ran a few tests against the popular ReActor node, which includes both face restoration and GPEN features:

  • ReActor end-to-end time using the GPEN-BFR-512 model for face restoration is about 1.4 seconds on my GeForce 3090.
  • ReActor followed by this GPENO node with the same model takes about 0.7 seconds – almost exactly 2x speedup for no loss of quality.
  • Applying the GPENO node directly to my test images took about 0.5 seconds.
  • Note that your inference time will depend on a number of factors, including input resolution, the number of faces in the image and so on. But you can probably expect 2-3x speedup compared to other implementations of GPEN.

    Advantages

    Apart from the speed, here are some other reasons why you might want to use GPENO in your projects:

  • It is not coupled with other functions such as faceswap, making it easy to apply to an image without additional processing
  • It uses a global cache, which helps you save VRAM if you have multiple instances of GPENO in your workflow
  • It exposes more controls for interfacing with GPEN than you would typically find in an all-in-one node
  • Inputs

  • image: Image or a list of batch images for processing with GPEN
  • use_global_cache: If enabled, the model will be loaded once and shared across all instances of this node. This saves VRAM if you are using multiple instances of GPENO in your flow, but the settings must remain the same for all instances.
  • unload: If enabled, the model will be freed from the cache at the start of this node’s execution (if applicable), and it will not be cached again.
  • Please refer to the GPEN repository for more information on remaining controls

  • This node was adapted from the [restore_faces] shortcode of Unprompted, my Automatic1111 extension.