FaceEnhancement
The one-input face fixer that quietly 2x-upscales your whole portrait
- images
- images
FaceEnhancement is a single node from the ComfyUI-GPEN pack, and despite the name it isn't a face-swap or a "restore faces" toggle. It's a thin wrapper around ModelScope's GPEN portrait-enhancement pipeline, which means it takes one image, fixes the face(s), and hands you back a 2x upscaled version of the whole portrait. The name undersells it, and that surprise is the first thing to know before you wire it in.
GPEN is short for GAN Prior Embedded Network - a face-restoration model that embeds a pretrained StyleGAN2 generator as the decoder and fine-tunes it, so the "new" face it invents is anchored in what a real face looks like rather than pure upsampling. It sits in the same family as GFPGAN and CodeFormer, the classic blind face-restoration trio from the A1111 days. It's a real, honest workhorse: ModelScope's copy has nearly four million downloads. But it's not what the current ComfyUI crowd reaches for first - ADetailer or Impact Pack's FaceDetailer handles the same job with more control, and the reddit signal for GPEN has been slowly fading since 2024. You'd pick this node when you want one no-questions-asked pass over an old, low-res, or slightly degraded portrait.
How it actually works
The node just calls the ModelScope pipeline per image in your batch, but the pipeline underneath is doing a lot. It runs a RealESRNet-x2 super-resolution pass over the entire image first - that's where the 2x comes from. Then RetinaFace finds faces, an EQFace quality model decides each face is good enough to bother with, and GPEN restores each detected face at 512x512. Before anything is pasted back, an identity check compares face embeddings: if the enhanced face drifts too far from the original, it's rejected outright. Finally the restored face is warped back with a soft mask and blended into the upscaled image.
The node itself is genuinely one input, one output:
- images (IMAGE) - a batch of images in standard ComfyUI tensor format. That's all it takes.
- images (IMAGE) out - the enhanced, 2x larger batch. Wire this into whatever comes next; it's the same batch order and count as you fed in.
Zero knobs. No strength, no denoise, no blend. You get the pipeline's defaults or nothing.
Installing it
The pack is tiny - one node, no requirements.txt - so ComfyUI Manager will clone it, but Manager won't know about its dependencies. You need modelscope, opencv-python, and scipy in the Python that runs ComfyUI before this node will import at all. If you're on the portable Windows build:
cd ComfyUI/custom_nodes
git clone https://github.com/xuhongming251/ComfyUI-GPEN
# then, into ComfyUI's own python
python -m pip install modelscope opencv-python scipy
Restart ComfyUI and the node appears under the GPEN category. The first time you actually run it, it downloads roughly a gigabyte of weights from ModelScope's hub (the GPEN generator, RetinaFace detector, RealESRNet, and the EQFace/ArcFace bits) and lazily loads them. That first run can look frozen for a long time - it isn't, it's just downloading and warming up. Every run after that is fast because the pipeline is cached in a module-level singleton.
Where it bites
Three real gotchas, in order of how often people hit them:
- The silent 2x upscale. If you drop this in the middle of a workflow expecting same-size output, everything downstream suddenly gets double resolution. That's fine at the end of a chain, genuinely annoying mid-chain. Plan for it.
- The identity guard skips bad faces. That quality/embedding check is there to stop GPEN from replacing a person with a stranger. The side effect: on a truly mangled or tiny face, the enhancement is silently skipped and you just get the super-res pass back. If a face "didn't get fixed," that's often this, not a bug.
- Missing deps on a fresh install. Because the pack declares no dependencies, a clean ComfyUI import will throw
ModuleNotFoundErroronscipyormodelscopebefore the node even shows up. Install them by hand as above.
One more honest note: with no controls and a fixed blend strength, this isn't the node for fine-tuned work - it's the "just make it look better" button. For a damaged old photo it's genuinely good. For a face you need to preserve identically, the KB's advice applies double: give the face its own controlled pass instead of an automatic restorer. But when you want one node that does the whole job in one click, this is a solid, free (Apache-2.0) choice.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |