Nodes/MTB Nodes/Load Face Enhance Model (mtb)
ComfyUI Node Runs on cloud

Load Face Enhance Model (mtb)

Load GFPGAN to restore faces

By melMass·Created 3 years ago·Updated about a month ago· 721
Load Face Enhance Model (mtb)
  • bg_upsampler
  • model
model_nameNone
upscale1

Faces are the thing viewers notice first and forgive least, and diffusion models love to mangle them - smeared eyes, mushy teeth, that slightly-melted look, especially on smaller or further-away faces. This node loads a face restoration model to fix exactly that. It's the loader half of MTB's face-enhance path: it reads a GFPGAN or RestoreFormer model off disk and hands it to the node that runs the restoration.

The most common place this earns its keep is right after a face swap. MTB's face swapper (like ReActor and Roop) uses InsightFace's inswapper, which outputs at a low 128×128 - so the swapped face comes out soft. Running a face enhancer afterward cleans it up and brings back detail. Restore-then-swap-then-enhance is the standard chain, and this is the "enhance" loader.

How it works

GFPGAN (from Tencent ARC) is a GAN-based face restorer: it takes a degraded face and reconstructs a plausible, sharp version, trained specifically on faces so it knows what eyes and teeth are supposed to look like. RestoreFormer is a transformer-based alternative in the same job. This node just loads the chosen model; a separate apply node does the actual restoring.

The inputs that matter

  • model_name - a dropdown of the restoration models you've placed on disk. Like the other MTB face loaders, this is empty until you add a model file - MTB doesn't bundle the weights. Drop in something like GFPGANv1.4.pth and it appears here.
  • upscale (default 1) - how much to scale the output up as it restores. Set it to 2 and you get a restored and enlarged face in one step, handy for pushing a small face up to usable resolution.
  • bg_upsampler (optional, UPSCALE_MODEL) - GFPGAN restores the face; the rest of the image isn't its job. Wire a general upscale model (RealESRGAN and friends) here and it upsamples the background too, so the whole frame scales together instead of a sharp face on a soft body.

The single output is model (FACEENHANCE_MODEL), which feeds MTB's face-enhance apply node.

How to install it

ComfyUI Manager: search MTB Nodes (comfy_mtb), install, restart. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/melMass/comfy_mtb, then restart. The face-enhance path needs its supporting libraries (the gfpgan/facexlib stack) - optional dependencies for MTB. If the node doesn't load, the pack points you at http://127.0.0.1:8188/mtb to install what's missing.

Common issues

Empty dropdown again isn't a bug - there's no model file yet. Download GFPGANv1.4.pth (or a RestoreFormer checkpoint) into the face-restore model folder and restart; it'll show up.

Set expectations on what restoration is: GFPGAN invents a clean, believable face, and on a very degraded input that "invented" face can drift slightly from the person's actual likeness - it's making a plausible face, not recovering the exact original. That's usually fine as a cleanup pass and occasionally noticeable on a distinctive face. If you're chaining after a swap, restore lightly; over-enhancing can scrub away the very identity the swap was trying to preserve. And use bg_upsampler when you're scaling up, or you'll get a crisp face pasted onto a blurry background.

Categorymtb/facetools

Inputs (3)

NameTypeDefaultDescription
model_nameCOMBONone0 options:
upscaleINT1
bg_upsampleroptUPSCALE_MODEL

Outputs (1)

NameTypeDescription
modelFACEENHANCE_MODEL