Nodes/Comfyui CoTracker Node/Grid Point Generator
ComfyUI Node

Grid Point Generator

The boring node that keeps static backgrounds static

By s9roll7·Created about a year ago·Updated about a year ago· 29
Grid Point Generator
  • image
  • mask
  • grid_coordinates
grid_size10
frame_count121
existing_coordinates

Sometimes the hardest part of a motion-transfer workflow is keeping most of the frame still. This is the node that does that. Grid Point Generator builds a uniform grid of coordinates across your image and outputs them as ready-to-use tracking data - no CoTracker model involved, nothing downloads, it's pure math.

It ships in the same pack as CoTracker Point Tracking and speaks the same language: its single output, grid_coordinates, is a STRING in the exact format CoTrackerNode produces - JSON arrays of {"x": ..., "y": ...} per frame, one per point. That means you can feed it straight into the WanVideoWrapper ATI Tracks node, or into the other two utilities in this pack (the Perlin randomizer, the XY amplifier) before it goes anywhere.

Why use a grid instead of CoTracker's motion-ranked points? Control. CoTracker picks points it thinks are interesting. This node gives you exactly the points you asked for, evenly spread, which is what you want when you need a reference point cloud that pins the background down while a moving subject does its thing. It's also the fastest answer to "can I animate just this region?" - drop a mask in and only points inside the mask survive.

The inputs that matter: image just sets the dimensions (height and width are read from it), grid_size is the number of divisions along both axes (10 is the default; higher = denser), and frame_count tells it how many frames each point's track should span - set it to match your video length or your tracks come out shorter than the clip. existing_coordinates is the sneaky useful one: pass in a STRING of tracks you already have and they get merged into the output, so you can layer a hand-made grid on top of CoTracker output.

If you want precision placement: it divides the frame into grid_size + 1 cells and drops a point in the middle of each, deliberately avoiding the edges.

Install is the pack install - ComfyUI Manager → search "Comfyui CoTracker Node", or cd ComfyUI/custom_nodes && git clone https://github.com/s9roll7/comfyui_cotracker_node and restart. Because it never loads CoTracker, it works offline and costs almost nothing. The one gotcha is mistaking it for a visualization tool: it draws nothing, the output is a plain STRING. If you want to see the points, wire them through something with an image preview.

Honestly, as utility nodes go this one is as simple as it looks. That's the point - it's the "give me a starting point cloud" node so you can spend your effort on the parts that matter.

Categorytracking/utility

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
grid_sizeINT101–1000Number of divisions along both width and height to create a grid of tracking points.
frame_countINT1211–9999
maskoptMASKGenerate grid points only inside masked area
existing_coordinatesoptSTRING

Outputs (1)

NameTypeDescription
grid_coordinatesSTRING