Blend Faces (dlib)
ComfyUI Node Guide
- original_image
- face_count
- enhanced_cropped_faces
- face_landmarks
- images
This is the "put it back together" node - the last step of the face-repair chain, and the one that's easy to underrate because it doesn't do anything flashy. After Detect Faces has found the faces and Enhance Faces has sharpened them, you're left with a handful of enhanced face crops floating around disconnected from the photo they came from. This node takes them and pastes each one back into the original image at the right position, scale, and rotation.
That alignment is the whole trick, and it's why face_landmarks - the 68 dlib points captured way back at the detection step - has to travel all the way through the pipeline to this final node instead of getting discarded once the crop is made. Those landmarks tell this node exactly how each face was oriented in the source photo, so it can warp the enhanced crop to match before compositing it in, rather than just stamping a rectangle over the original and hoping the angles line up. It's the same detect-crop-fix-composite shape that tools like ADetailer use for face fixing in diffusion workflows, just running on 2020-era GAN tech instead of inpainting.
Required inputs, all four of them: original_image, face_count, enhanced_cropped_faces, face_landmarks. There's no optional input and no config to tune - the node's entire job is making these four pieces of information agree with each other. Output: images.
The thing to get right here isn't any parameter, it's making sure everything actually comes from the same photo. original_image should be the exact image you ran through Detect Faces - not the pre-restoration source, not a different photo entirely. face_count and face_landmarks come straight from Detect Faces, and enhanced_cropped_faces comes from Enhance Faces or Enhance Faces (Advanced). Swap in a different original_image than the one the landmarks were computed against and the blend will misalign - faces landing in slightly the wrong place, or at the wrong scale.
No dedicated model to install for this node - it's pure compositing logic, no checkpoint of its own. What it does need is the rest of the pack working correctly upstream: dlib installed and functioning (the usual friction point on this pack, especially getting the right prebuilt wheel for your Python version on Windows, or CMake set up to build it from source), plus the face detection and enhancement models loaded via their respective loader nodes.
If the output looks unchanged, check face_count from upstream before assuming this node is broken. The README documents that Detect Faces silently returns the original image untouched when it doesn't find a face - so if nothing was detected, there's genuinely nothing new for Blend Faces to place, and the "bug" is actually further back in the chain. And as with every image node in this pack, original_image needs dimensions that are clean multiples of 8 or 16 pixels; if you're feeding in scans of odd sizes, pad or round them first rather than debugging the blend itself.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| original_image | IMAGE | — | |
| face_count | FACE_COUNT | — | |
| enhanced_cropped_faces | IMAGE | — | |
| face_landmarks | FACE_LANDMARKS | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |