Nodes/facetaggg/FaceTag Paste Back
ComfyUI Node

FaceTag Paste Back

Paste the inpainted crop back, seams and all

By adbrasi·Created 30 days ago·Updated 27 days ago· 0
FaceTag Paste Back
  • paste_data
  • image
  • mask
  • background
  • image
blend_mode
feather12
mask_expand0
opacity1.00
color_match
color_match_strength1.00
interpolation
invert_maskfalse

FaceTag Crop (YOLO) finds the face and crops it out of every frame; this node is what puts the fixed face back. You hand it the inpainted crop plus the paste_data token from the crop node, and you get the full-resolution source frames back with the face composited in - no seams, no color shift, and critically, no frame-to-frame jitter.

How the paste works

The jitter thing is the detail worth knowing, because it's the thing that makes naive crop-and-paste video workflows look wrong even when every individual frame looks fine. The paste_data produced by FaceTagCrop stores each crop's placement as a fractional origin - the crop was sampled at sub-pixel positions, and this node warps the patch back to that exact fractional coordinate with warpAffine. It's the precise inverse of the crop's sampling, so there's no round-to-integer drift between frames. That's why a 200-frame sequence doesn't shimmer.

Mechanically it's straightforward. It resizes your inpainted patch back to the crop's original source size (Lanczos by default; cubic, linear, and area are available), optionally applies a mask region, then blends. Three blend modes: normal (plain alpha composite), seamless (Poisson blending via cv2.seamlessClone), and seamless_mixed (the mixed-clone variant that keeps texture and gradients from the patch). Poisson is picky near borders, so if it throws, the node silently falls back to a normal composite rather than killing your run.

The inputs that matter

The inputs you'll actually set: paste_data (from FaceTagCrop's fourth output - this is a custom FACETAG_PASTE type, so no other crop node will plug in), image (the inpainted crop), blend_mode, feather (soft mask edge in source pixels; default 12 is a fine starting point), and opacity. The color-correction inputs are the hidden gem: color_match set to mean_std or histogram nudges the patch's colors toward the exact pixels it covers, and color_match_strength controls how far it goes. Inpainters love to shift hue or exposure on the crop, and this quietly fixes it at composite time instead of forcing you to chase it in the sampler.

The optional inputs are for edge cases: mask is a region aligned to the crop (omit it to paste the whole crop), invert_mask flips that region, and background supplies a longer or extended timeline to paste onto - if your inpainted sequence has more frames than the original capture, the last background frame is held for the extras. That's how you extend a clip past its last detected face without the composite collapsing.

Outputs

Output is a single image: the full frames at source resolution, ready to feed a video encoder or VAE.

Install

Same pack, same steps - ComfyUI Manager, search "facetaggg", or:

cd ComfyUI/custom_nodes
git clone https://github.com/adbrasi/facetaggg.git
# restart ComfyUI

It needs no YOLO model of its own; the pack's shared requirements.txt (ultralytics, opencv-python) covers everything, and opencv is what does the warping and Poisson blending.

Gotchas

If nothing connects, you forgot the paste_data wire - it only accepts the token from FaceTagCrop, and a mismatched crop node will refuse to connect. Seamless blending is noticeably slower over hundreds of frames; try normal with a decent feather first and escalate to Poisson only for stubborn seams. And if the pasted region's colors look off, that's the color_match input doing nothing because it's set to none - switch to mean_std at full strength and the mismatch usually disappears. Together with FaceTag Crop this is a genuinely complete video face-fix loop: detect, crop, inpaint, paste back, no manual masking anywhere.

Categoryimage/facetag

Inputs (12)

NameTypeDefaultDescription
paste_dataFACETAG_PASTE
imageIMAGEThe (inpainted) crop to paste back
blend_modeCOMBOseamless uses Poisson blending (cv2.seamlessClone)
featherINT120–512Soft mask edge, in source pixels
mask_expandINT0-256–256Grow (+) or shrink (-) the paste region before feathering
opacityFLOAT1.000–1
color_matchCOMBOMatch the pasted colors to what they cover
color_match_strengthFLOAT1.000–1
interpolationCOMBO4 options: lanczos, cubic, linear, area
maskoptMASKRegion to paste (aligned to the crop). If omitted, the whole crop is pasted.
invert_maskoptBOOLEANfalse
backgroundoptIMAGEOptional base frames to paste onto (same resolution as the source). Use this to supply a longer/extended timeline; if omitted, the original frames are used and the last one is held for any extra inpainted frames.

Outputs (1)

NameTypeDescription
imageIMAGE