Nodes/ComfyUI-Portrait-Maker/PortraitEnhancement PM
ComfyUI Node

PortraitEnhancement PM

Fix a mushy face at the end of the pipeline — PortraitEnhancement PM

By THtianhao·Created 3 years ago·Updated 2 years ago· 201
PortraitEnhancement PM
  • image
  • IMAGE
model

Face-swaps and inpainting are great until you zoom in and the face looks like it melted. That's the exact moment this node exists for. PortraitEnhancement PM is the cleanup pass at the tail of the ComfyUI-Portrait-Maker pipeline - you've generated, merged, and pasted a face back, and now you run the whole thing through one of two restoration models to make it look like a photo instead of a Photoshop accident.

It's from the ComfyUI-Portrait-Maker pack, which is a port of Alibaba's EasyPhoto workflow broken into individual nodes. In the shipped easyphoto workflow this node sits right after the skin-retouching step, polishing the final face crop before you save. You'll usually want it there too: last step in the chain, after all the geometry is right.

How it works

Two models behind one dropdown, both loaded on demand through ModelScope (the Alibaba model hub) and cached after the first run:

  • pgen - runs the GPEN face-restoration model (damo/cv_gpen_image-portrait-enhancement). GPEN is the classic "fix the face" network: it restores and upscales a degraded face using a GAN prior, smoothing out the artifacts and blur that low-res face crops pick up. This is the one you want when the face itself is ugly.
  • real_gan - runs a 2x super-resolution model (bubbliiiing/cv_rrdb_image-super-resolution_x2), an RRDB-style upscaler. The v1.1.0 changelog spells out the difference: this SR model does not do the face-specific highlight that the GPEN path does. It just makes everything bigger and sharper.

Worth knowing: the dropdown literally reads "pgen". The README calls this model gpen, but the code's choice string is a typo that survived into the shipped pack. Don't go hunting for a "gpen" option that isn't there.

Inputs and output

Only two things to set:

  • image (IMAGE) - the face crop (or full portrait) you want cleaned up.
  • model (enum) - pgen or real_gan, as above.

Output is a single IMAGE with the same content, restored or upscaled. One gotcha: real_gan comes back at 2x the input resolution, so it'll change the dimensions of whatever you feed downstream. Either account for that in your layout, or follow it with a resize node.

Installing the pack

ComfyUI Manager is the easy route - search "ComfyUI-Portrait-Maker" and hit Install. Or clone manually:

cd ComfyUI/custom_nodes
git clone https://github.com/THtianhao/ComfyUI-Portrait-Maker.git

Then restart ComfyUI. The first launch downloads the whole EasyPhoto model set (controlnet pths, a LoRA, a VAE, face_skin.pth, inswapper_128.onnx, and the makeup files) with no hash verification - if you interrupt it, delete the half-written files and start over. The dependencies are heavy too: modelscope, onnxruntime, both tensorflow and tensorflow-cpu in requirements.txt, insightface, and a diffusers pinned to 0.18.2 that can fight other packs.

Common issues

The restoration weights aren't in the startup batch - they download from ModelScope the first time you actually run the node, so the first run can look frozen on "Downloading" for a while, and ModelScope is notoriously slow outside China. On CPU, GPEN is genuinely slow; this node is the main reason to make sure the pack's run on a CUDA box. If output looks worse than input, double-check you didn't pick real_gan for a face-fix job - it's the upscaler, not the restorer.

Categoryprotrait/model

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
modelCOMBO2 options: pgen, real_gan

Outputs (1)

NameTypeDescription
IMAGEIMAGE