ComfyUI Node

Follow Matte

One matte per frame from SAM 3.1's track, safe for the composite. It follows the object's own region from the first-frame mask: objects SAM finds by itself elsewhere are left out; where the object is not seen, the last matte holds (with no mask, the first-frame mask); with the plate the shot was made over, the matte also takes what the shot changed near the object, so a generated element is never dropped.

By AInVFX·Created 5 days ago·Updated about 17 hours ago· 2
Follow Matte
  • masks
  • first
  • frames
  • base
  • element
  • mask
  • summary
◄zone0.063►
◄threshold0.10►
CategoryAInVFX/Paint a plate

Inputs (7)

NameTypeDefaultDescription
masksMASKSAM 3.1's masks, one per frame it tracked. It may return fewer, or none.
firstMASKThe area on the first frame that SAM was asked to follow.
framesIMAGEThe frames SAM tracked: their count sets the matte's length. For paint, the shot.
zoneFLOAT0.0630–0.5How far from the object's region SAM's mask may move and a change still joins, as a fraction of the width.
thresholdFLOAT0.100.01–1How much a pixel must change, from 0 to 1, to join the matte.
baseoptIMAGEThe plate the shot was made over, at the same size.
elementoptMASKWhere the edit changed the first frame: the object's region starts here instead of at first.

Outputs (2)

NameTypeDescription
maskMASK—
summarySTRING—