Nodes/Image Misc/Face Composite (frame by frame)
ComfyUI Node

Face Composite (frame by frame)

Paste a processed face back into every frame of a video

By set-soft·Created about a year ago·Updated 8 months ago· 2
Face Composite (frame by frame)
  • animated
  • reference
  • bboxes
  • images

The simpler cousin of the pack's Face Composite node, built for video instead of stills. Where the base node handles the M-references-to-M×N-frames relationship, this one assumes a plain 1-to-1 sequence: you have N reference frames of a video and N processed frames of the same video - a restored, upscaled, or reanimated face - and you want each processed frame pasted back into its matching reference frame at the same location. That's your face-restoration, stylization, or lip-sync video pipeline, minus all the manual assembly.

How it works, and the one simplification

The loop is dead simple: for each frame i, take reference i, paste animated i onto it, move on. The node resizes each animated frame to fit the target region (Lanczos resampling) and pastes onto a copy of the reference, exactly like the sibling node - but it needs its own copy of the logic because the batch semantics are different.

The key simplification is the bounding box: only the first bbox in the list is used, and it's applied to every frame. The node will even warn you if you pass more than one. That's a deliberate trade. For face-video work the face region usually stays put across the sequence - a static crop location is the common case, and it means you only have to detect the face once. If your video has a face that moves or the camera tracks, a single static box is wrong, and this node is the wrong tool; you'd want per-frame boxes, which means the other node or a different approach entirely.

The inputs

  • animated - N processed frames.
  • reference - N original frames. Batch sizes must match exactly, or it raises.
  • bboxes - a BBOX list; only the first (x, y, w, h) is used for all frames.

Output is images, the N composited frames ready to feed a video-assembly node (VHS or whatever you use to turn a batch into a video file).

Installing it

Part of Image Misc, so it comes with the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/set-soft/ComfyUI-ImageMisc
cd ComfyUI-ImageMisc && pip install -r requirements.txt

or ComfyUI Manager → "Image Misc". Restart, then find it under image/manipulation.

Honest caveats

This is a rectangular hard paste with no alpha blending - if your processed face is a tight crop, its edges sit exactly on the boundary, and you may see seams against the original frame. The pack's AFFCE foreground-estimation nodes are the natural companion for cleaning that up. And note the static-bbox limitation isn't a bug, it's the feature: if you need per-frame coordinates, reach for the base Face Composite node instead. For the common "restore the face in every frame of a talking-head clip" job, this is the one that just works - the validation is strict about batch sizes so it fails loudly and helpfully rather than pasting misaligned frames.

Categoryimage/manipulation

Inputs (3)

NameTypeDefaultDescription
animatedIMAGE
referenceIMAGE
bboxesBBOX

Outputs (1)

NameTypeDescription
imagesIMAGE