Nodes/ComfyUI_FaceAlignPaste/Face Align Double @ CHAOS
ComfyUI Node

Face Align Double @ CHAOS

The dialogue-scene graft

By CHAOSEA·Created about a year ago·Updated about a year ago· 24
Face Align Double @ CHAOS
  • target
  • image_L
  • mask_L
  • image_R
  • mask_R
  • image
  • mask_L
  • mask_R
  • mask_combined
  • unfeathered_mask_combined
feather_L0
size_L1.00
move_x_L0
move_y_L0
feather_R0
size_R1.00
move_x_R0
move_y_R0

Face Align Double is the two-person version of the pack's alignment node: instead of grafting one face onto a target, it aligns two source faces and pastes both onto one image. It's built for the cases where a single graft isn't enough - a dialogue scene where two characters should be facing each other with matching geometry, or a group composition where both heads need to sit at the right size and tilt relative to a shared target. If Face Align Single is the scalpel, this is the pair of scissors: the same idea, applied twice, with the bookkeeping to keep both grafts straight.

How it works

Mechanically it's the single-face path run twice. Each source face gets its landmarks extracted - via the optional face-alignment library if installed, otherwise MediaPipe or dlib's bundled 68-point predictor (shape_predictor_68_face_landmarks.dat, shipped inside the pack) - and is aligned to the corresponding position on the target image before compositing. Each side has fully independent controls, so you can feather one graft harder than the other, scale them differently, and nudge them in separate directions. The node tracks the two alphas separately and hands them back to you in every useful combination.

Inputs and outputs that matter

Required inputs are target (the base image) plus the left/right pairs image_L/mask_L and image_R/mask_R. Each side then gets its own feather (0–100), size (0.5–2×), and move_x/move_y (−20..20) controls - the _L and _R suffixes tell you which person you're adjusting. In practice the two controls you'll fiddle with most are feather_L/feather_R (seam quality) and size_L/size_R (keeping the two heads proportionate).

Outputs are where the node shows its work:

  • image - the composite with both faces pasted.
  • mask_L and mask_R - each face's feathered alpha.
  • mask_combined - both alphas merged into one mask.
  • unfeathered_mask_combined - the combined mask before feathering, for when you want the hard silhouette to build your own blend.

The combined masks are the ones you want for the standard finishing move: take image + mask_combined into a masked inpaint at low denoise so the generator redraws the boundaries and makes two pasted faces look like they belong in the frame together.

Installing it

Same pack install as always. ComfyUI Manager → search ComfyUI_FaceAlignPaste, or:

cd ComfyUI/custom_nodes
git clone https://github.com/CHAOSEA/ComfyUI_FaceAlignPaste

Restart. The dependency story is unchanged from the single variant: insightface, dlib, mediapipe, opencv-python, with the dlib model bundled in the repo. This node, like its single sibling, quietly prefers the optional face-alignment library for better landmarks (pip install face-alignment), falling back to MediaPipe/dlib if it's absent. dlib compiles from source (CMake + MSVC on Windows), and insightface's weights are non-commercial.

Gotchas

  • L and R are your contract. image_L is the face bound to the left graft - the node doesn't guess which person is which. If your source order is wrong, you'll graft the wrong faces onto the wrong sides.
  • Seams scale with two. Two pasted faces means two potential cut lines; without feathering and an inpaint pass you'll see both.
  • Same caveats as the single node. It's a pixel graft, not an identity swap; clean masks matter; and if the bundled .dat is missing you'll see the dlib download warning in the console.
Categoryimage/face

Inputs (13)

NameTypeDefaultDescription
targetIMAGE
image_LoptIMAGE
mask_LoptMASK
feather_LoptINT00–100
size_LoptFLOAT1.000.5–2
move_x_LoptINT0-20–20
move_y_LoptINT0-20–20
image_RoptIMAGE
mask_RoptMASK
feather_RoptINT00–100
size_RoptFLOAT1.000.5–2
move_x_RoptINT0-20–20
move_y_RoptINT0-20–20

Outputs (5)

NameTypeDescription
imageIMAGE
mask_LMASK
mask_RMASK
mask_combinedMASK
unfeathered_mask_combinedMASK