Restore Face π ReActor
Standalone face restoration for ComfyUI
- image
- IMAGE
You did a face swap and it came out soft, plasticky, low-res - like a slightly melted sticker glued onto an otherwise sharp image. ReActor Restore Face (class ReActorRestoreFace) is the fix. It takes an image, finds the face, and runs it through a dedicated face-restoration model (CodeFormer, GFPGAN, or GPEN) that sharpens pores, eyes, teeth and edges back into existence. The whole pack has this restoration built into the main swap node, but ReActor split it out as its own node back in 0.4.1 so you could run it wherever you want - after a swap, on an old photo, on a small distant face from any generation, whatever. It doesn't care where the image came from.
Here's why you actually need it. ReActor swaps faces using InsightFace's inswapper_128 model, and that model is stuck at 128Γ128 resolution and has been frozen for years. Every InsightFace-based swapper shares that ceiling. So the raw swap is inherently soft on anything bigger than a thumbnail, and restoration is the step that rescues it. This isn't optional polish; it's load-bearing.
How it works
The node detects the face with your chosen facedetection model, crops it, runs the restoration model on that crop, then blends the enhanced face back over the original. Restoration models are generative in a narrow sense - they hallucinate plausible skin and feature detail that the low-res crop never had. That's the point, and also the caveat: on a face the model doesn't recognize, it invents detail rather than recovering it, so a heavy restore can subtly drift the likeness. Usually that's a fine trade because a swap you can't sell as "sharp" is worse than one that's 3% off.
The inputs and outputs that matter
Five inputs, and only a couple you'll fuss over:
model- the restorer.nonedoes nothing; the real choices arecodeformer-v0.1.0.pth,GFPGANv1.3.pth/GFPGANv1.4.pth, and the ONNXGPEN-BFR-512/1024/2048. GFPGAN 1.4 is the safe, natural default. CodeFormer is stronger on badly degraded faces. GPEN's higher-res variants (1024/2048) are the newest and best if your face is large in frame and you've downloaded them.codeformer_weight- only matters whenmodelis CodeFormer. It's the fidelity dial: lower leans on the model to invent cleaner detail (prettier, less faithful), higher stays truer to the input face.0.5is a sensible middle.visibility- how hard the restoration blends in, 0 to 1. At1(default) you get the full effect; dial it back toward 0.7β0.8 if the result looks over-smoothed or too "AI."
facedetection picks the face finder (retinaface_resnet50 is the reliable default; the YOLOv5 options are faster). The single output is IMAGE - wire it straight to Save Image, or into an upscaler for a final pass.
How to install it
It ships inside the ReActor pack, so installing ReActor installs this. ComfyUI Manager: Install Custom Nodes, search ReActor, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Gourieff/comfyui-reactor-node
then run install.bat (Windows) or install.py, and restart. The one thing to know: the restoration models don't auto-download. Grab codeformer, GFPGANv1.4, and/or the GPEN models from the ReActor HF dataset and drop them into ComfyUI/models/facerestore_models. If the dropdown only shows none, that folder is empty - that's the fix.
Common issues & troubleshooting
The whole node/menu won't load. That's the pack's InsightFace dependency failing to build, not this node. InsightFace is notorious as one of the ugliest installs in ComfyUI - for years it needed a C++ toolchain (Visual Studio Build Tools on Windows) to compile, and "I have Visual Studio installed and it still won't find insightface" is one of the most-repeated help posts about this pack. The reliable fix is Gourieff's prebuilt Insightface wheel for your exact Python version (the README links 3.10/3.11/3.12); pip install it into ComfyUI's Python and restart.
The result is over-smoothed or looks less like the person. Drop visibility toward 0.7, and if you're on CodeFormer nudge codeformer_weight up so it stays truer to the source. Restoration always trades a little identity for a lot of sharpness.
Restore then upscale, not the other way around. Fix the face at its native size first; upscaling a soft face just bakes the mush in bigger. If you want more resolution after, hand the restored image to a proper upscaler as a separate pass.
Selling it? Don't. The InsightFace weights this pack runs on are non-commercial research only, and that carries through everything built on them. Personal and portfolio work is fine.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| facedetection | COMBO | 4 options: retinaface_resnet50, retinaface_mobile0.25, YOLOv5l, YOLOv5n | |
| model | COMBO | 7 options: none, codeformer-v0.1.0.pth, GFPGANv1.3.pth, GFPGANv1.4.pth, GPEN-BFR-1024.onnx, GPEN-BFR-2048.onnx, +1 | |
| visibility | FLOAT | 1.000β1 | β |
| codeformer_weight | FLOAT | 0.500β1 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |