ninja torch torchvision opencv-python numpy scikit-image scipy pillow tqdm

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.
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_modelsandcomfyui/models/facedetection.
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:
GPEN-BFR-512 model for face restoration is about 1.4 seconds on my GeForce 3090.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.
Apart from the speed, here are some other reasons why you might want to use GPENO in your projects:
image: Image or a list of batch images for processing with GPENuse_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.This node was adapted from the [restore_faces] shortcode of Unprompted, my Automatic1111 extension.