Nodes/ComfyUI-MAINodes/H3 Motion Composite (subject regen, background baseline)
ComfyUI Node

H3 Motion Composite (subject regen, background baseline)

Keep the subject regenerated, hand the background back to the baseline

By matlowai·Created 17 days ago·Updated about 18 hours ago· 112
H3 Motion Composite (subject regen, background baseline)
  • regenerated
  • baseline
  • samples
  • mask
  • IMAGE
threshold0.35
grow32
feather48
invert_maskfalse
feather_profilelinear
feather_directioncentered
mask_is_softfalse

The de-rope has a side effect: inside dilated spans, the regeneration keeps steady background movers - birds, crowds, traffic - near their natural pace instead of full slow motion, so when the clip is compressed back to normal speed those background agents get overcranked. The author calls it "the birds" problem, and the first two automatic fixes failed their own playback bar. H3 Motion Composite is the fix that works: a pixel-space composite on the shared world clock that keeps regenerated frames where the subject is, and baseline frames everywhere else. The baseline's timing was correct all along; it just needed to win the composite.

Two ways to say where the subject is

  • Oracle mode. Wire samples (the BASELINE latent) and the node derives spatial jerk heat automatically; threshold (0.35) sets how much heat counts as subject. This is the deprecated-ish path - the README is blunt that automatic oracle-heat compositing pops at its boundary on moving background objects, because the oracle can't hide a seam.
  • Manual mode. Wire a mask and you decide. The honest advice from the pack: lasso generously along a real edge (a rooftop line, a horizon, the cloud deck) and let the feather blend there. A single mask is a static boundary and cannot pop by construction. invert_mask flips it, so you can lasso the birds/sky you want kept at baseline timing instead of lassoing the subject. mask = 1 keeps regenerated pixels, 0 keeps baseline.

The dials that make manual mode work: grow (32) dilates the mask to cover pose drift, feather (48) softens the seam, feather_profile (linear / smoothstep / gaussian) shapes the falloff, and feather_direction picks where the ramp lives - centered straddles the boundary, inward eats into the masked side, outward into the kept side. The author's specific tip: trace a rooftop tight, then feather outward into the sky.

If you're feeding it a mask from H3 Motion Editor, flip mask_is_soft on - the editor's mask arrives pre-feathered and envelope-scaled, and this node should skip its own threshold/grow/feather.

Inputs / outputs

Required: regenerated (IMAGE) and baseline (IMAGE), plus threshold, grow, feather. Optional: samples, mask, invert_mask, feather_profile, feather_direction, mask_is_soft. One IMAGE output - the composited clip.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/matlowai/ComfyUI-MAINodes

or ComfyUI Manager → ComfyUI-MAINodes, restart. Category image/minimax/motion.

Common gotchas

Mask batches work (per-frame on the world clock) but bring moving-boundary risk back - feather harder and judge in playback; a static single mask is the safe default. And the automatic oracle-heat mode is still there but deprecated for a reason: with a hand-drawn mask the seam goes where you hide it, along an edge nothing moves across. If your background and subject share lighting or contact, the pack suggests the V2V Init freeze route instead of this composite - pixel space and latent space differ exactly there.

Categoryimage/minimax/motion

Inputs (11)

NameTypeDefaultDescription
regeneratedIMAGE
baselineIMAGE
thresholdFLOAT0.350–1oracle mode: how much heat counts as subject; manual mode: binarization level for soft masks
growINT320–256pixels of mask dilation, covers pose drift
featherINT480–256
samplesoptLATENTBASELINE latent (oracle mode); optional when mask is wired
maskoptMASK(alpha) manual subject mask, overrides the oracle. 1 = keep regenerated, 0 = keep baseline. One mask = static boundary; a batch = per-frame
invert_maskoptBOOLEANfalseon: the mask marks the KEEP-BASELINE region instead (lasso the birds directly)
feather_profileoptCOMBOlinear3 options: linear, smoothstep, gaussian
feather_directionoptCOMBOcenteredwhere the ramp lives relative to the mask boundary
mask_is_softoptBOOLEANfalse(alpha) mask values are final alphas (e.g. from H3 Motion Editor): skip threshold/grow/feather

Outputs (1)

NameTypeDescription
IMAGEIMAGE