Nodes/TrentNodes/Points To Masks
ComfyUI Node

Points To Masks

Turning Tracked Points Into Masks, So Your Compositor Stops Jittering

By TrentHunter82·Created 9 months ago·Updated 4 days ago· 36
Points To Masks
  • points
  • masks
height512
width512
radius5

Point tracking gives you a single coordinate per frame, which is precise but also a little fragile - one bad frame, one jump, and your mouth teleports across the character's face. This node converts your tracked points into soft Gaussian masks, so downstream mask-based compositing (like the Mouth Shape Compositor Tracked in mask mode) gets a smooth, forgiving target instead of a single hard pixel.

What it does

Take a points sequence - the per-frame (x,y) list from Point Tracker, wired in directly - plus a target height and width, and it renders a Gaussian blob at each point's location. The radius control (default 5, up to 50) sets how wide that blob spreads. Each frame's mask is just a soft gradient centered on the tracked point, white at the center falling off to black.

That softness is the whole point. A mask with a soft falloff means the centroid the compositor calculates is a weighted average of the blob, so small per-frame jitter in the raw tracking point gets averaged out instead of turning into visible mouth tremble. It also means you get a proper alpha for masking operations, not a hard-edged dot.

When to use it

This is the bridge between the pack's two tracking philosophies: points mode (from optical flow) and masks mode (from per-frame region masks). If your tracking point is stable, you don't need this node - wire point_sequence straight into the compositor's points mode. If the point wanders or jumps frame to frame, convert to masks here and feed the compositor's tracking_masks instead; the Gaussian gives the compositor a center that's robust to small errors.

One matching detail: height and width should be the dimensions of your video frames. Set them to the output of a GetImageSize-style node rather than typing them, or the mask will be placed on a differently-sized canvas and the centroid math still works but the mask won't line up with the frames.

Installing it

Part of TrentNodes; one install serves the whole pack:

cd ComfyUI/custom_nodes
git clone https://github.com/TrentHunter82/TrentNodes.git
cd TrentNodes
pip install -r requirements.txt

ComfyUI Manager works too ("Trent Nodes"), with the standing caveat that the author's day-one repo rename left a duplicate registry entry that makes Manager occasionally flag the pack as "unsafe" - clone manually if you hit that. No models, no downloads; this is a pure math node.

The honest take

It's a niche utility, and you'll know within one render whether you needed it. If your tracked mouth looks glued to the face, skip it and stay in points mode. If it shivers, this is the cheapest fix in the pack - one node, one wire, done.

CategoryTrent/LipSync

Inputs (4)

NameTypeDefaultDescription
pointsPOINT_SEQUENCEPoint sequence from tracker
heightINT5121–8192Output mask height
widthINT5121–8192Output mask width
radiusoptINT51–50Gaussian mask radius

Outputs (1)

NameTypeDescription
masksMASK