Nodes/MTB Nodes/Restore Face (mtb)
ComfyUI Node Runs on cloud

Restore Face (mtb)

GFPGAN face restoration for ComfyUI outputs

By melMass·Created 3 years ago·Updated about a month ago· 721
Restore Face (mtb)
  • image
  • model
  • IMAGE
alignedfalse
only_center_facefalse
weight0.50
save_tmp_stepstrue
preserve_alphatrue

Small faces come out of diffusion models rough - melted eyes, mushy teeth, that waxy "AI face" look, especially when the face is only a few hundred pixels in a wider shot. Restore Face (mtb) runs those faces through GFPGAN, a dedicated face-restoration model, to clean them up: sharper eyes, believable skin, a face that reads as a face.

Worth being clear about what this is and isn't. GFPGAN is a generative restorer - it detects faces, aligns them, and reconstructs plausible detail. It does not preserve a specific person's identity the way a face-swap or an identity adapter does; it makes the face look better, not necessarily look like a particular someone. If your goal is likeness, this is the wrong tool. If your goal is "stop the background extras from looking like ghouls," it's exactly right. For hero faces most people now reach for a detailer pass (detect the face, re-diffuse it at high res) - GFPGAN restoration is the older, faster, lighter approach and still handy for cheap cleanup or a final polish.

It lives in the facetools corner of MTB Nodes (comfy_mtb) by melMass.

How it works

GFPGAN finds each face in the image, warps it to a canonical alignment, restores it with a GAN prior trained on faces, and pastes it back. Because it's model-backed, this node needs an actual model handed to it - that's the model input, which you supply from a companion "Load Face Enhance Model" node in the same pack rather than a checkpoint loader.

The inputs and outputs that matter

  • image - the picture with the face(s) to fix.
  • model (FACEENHANCE_MODEL) - the loaded GFPGAN model. Wire this from MTB's face-enhance-model loader; it's not a regular checkpoint.
  • weight (default 0.5) - the blend between the restored face and the original. Low keeps more of the original texture and identity; high leans harder into GFPGAN's reconstruction. 0.5 is a reasonable start - push up if faces are still rough, pull down if they've gone plasticky.
  • only_center_face (default off) - restore just the main/central face instead of every detected face. Turn on for a portrait where the background faces don't matter.
  • aligned (default off) - tells the node the input is already a cropped-and-aligned face, so it skips detection. Leave off for normal full images.
  • preserve_alpha (optional, default on) - keeps an alpha channel through the process if your image has one.
  • save_tmp_steps (default on) - writes intermediate step images, useful for debugging.

Output is a single IMAGE with the faces restored - feed it onward to a save node or further compositing.

How to install it

ComfyUI Manager: search MTB Nodes, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/melMass/comfy_mtb

then restart. Unlike the pure-Python MTB utilities, this one is model-backed and heavier - it pulls in the face-restoration stack (GFPGAN and its facexlib/ONNX dependencies) and needs the GFPGAN weights downloaded into your models folder. ComfyUI Manager's model downloader is the least painful way to fetch those; the loader node also handles the download on first use.

Common issues & troubleshooting

The face-restore nodes didn't load. On startup MTB may report "Some nodes could not be loaded" - the facetools are the usual suspects because they need the extra ML deps. Open http://127.0.0.1:8188/mtb after launch and it'll tell you exactly which node failed and why. The typical fixes are installing the missing packages and resolving an ONNX runtime version mismatch, which is a recurring cause of these nodes silently refusing to import.

"Model could not be found." Restoration needs the weights present in the right models subfolder. If they're missing, download them via ComfyUI Manager. And a genuinely sneaky one people hit: antivirus silently quarantining the downloaded model file - if it "downloaded" but the node still can't find it, check your AV quarantine.

Faces look plastic or over-smoothed. That's weight too high. GFPGAN loves to smooth skin into wax. Drop the weight, or restore only the center face and leave the rest.

It changed who the person looks like. Expected. GFPGAN restores generic face detail; it doesn't lock identity. If likeness matters, use a detailer re-diffusion or an identity adapter instead, and keep weight low here.

Categorymtb/facetools

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
modelFACEENHANCE_MODEL
alignedBOOLEANfalse
only_center_faceBOOLEANfalse
weightFLOAT0.50
save_tmp_stepsBOOLEANtrue
preserve_alphaoptBOOLEANtrue

Outputs (1)

NameTypeDescription
IMAGEIMAGE