Nodes/PlateTrack/Track to Mask
ComfyUI Node

Track to Mask

Carry a reference mask through the whole shot, free

By edgarciavfx·Created 2 months ago·Updated 2 months ago· 1
Track to Mask
  • track_data
  • mask
  • masks

Here's a problem you'll hit the moment you start inpainting video: you mask a region on frame one, and then the shot moves. Now what - re-paint the mask on all 300 frames? No. Track to Mask takes a mask you drew once, at the reference frame, and warps it to every frame using the track you already have. One matrix per frame, effectively free, zero learning involved.

How it works

It's the simplest node in the pack. The reference mask is warped through the shot by the inverse of the stored per-frame homography - the exact transform Planar Track computed. Hand it a batch of masks and it uses the entry at the track's reference frame. Output is a masks batch, one per frame, matching the plate size.

Inputs and outputs

  • track_data - any TRACK_DATA: planar, points, or face.
  • mask - your reference-frame mask.

Output: masks.

When to reach for it (and when not to)

Use it when the thing you masked is a rigid plane - a poster, a wall, a screen. It's mathematically exact for those, and it costs almost nothing.

Don't use it for a human or anything that deforms. Warping a face-shaped mask with a homography assumes the surface is flat, and a face isn't. For subjects that bend, use Mask Propagate in grid mode (it tracks a lattice so the mask follows the surface), or Mask Propagate (Cutie) for the hard occlusion cases.

Installing it

Same pack, same one-time install: PlateTrack in Manager, or clone + pip install -r requirements.txt. OpenCV only, no models.

Where people get burned

Only one real trap: expecting the mask to bend. A homography can't represent a face turning in 3D, so the propagated mask will lag or smear exactly where the surface deforms. That's not a bug - it's the difference between planar propagation and the other two propagation nodes in this pack. Pick your node by whether your subject is flat.

If your subject is a flat plane and your mask is good, this is the cheapest, most reliable way to get an inpainting mask that moves with the shot. Draw once, track, done.

CategoryPlateTrack

Inputs (2)

NameTypeDefaultDescription
track_dataPLATETRACK_DATA
maskMASK

Outputs (1)

NameTypeDescription
masksMASK