Nodes/comfyui-lite-tracker/LiteTracker: Grid Editor
ComfyUI Node

LiteTracker: Grid Editor

Draw Boxes, Get Tracking Points

By fuselayer·Created 10 months ago·Updated 10 months ago· 0
LiteTracker: Grid Editor
  • image
  • points
  • preview_png
  • bbox
  • rect_json
  • bg_base64
density_per_100px5.0
rect_json
x100
y100
w400
h400
margin_px0
random_jitter_px0.0
seed0

If LiteTracker: Track is the workhorse, RectEditor is the node that doesn't look like a ComfyUI node at all - it opens a little editor window right in the browser. The use case is simple: you don't want a 10×10 grid across the whole frame, you want dense points inside one region - a face, a hand, a product on a conveyor, whatever you actually care about. Typing coordinates for that is misery. RectEditor lets you draw it.

Open the node and hit "Open Grid Editor": a modal appears over your frame. Click-drag draws a rectangle. Each rectangle has a rotation handle - the small circle at its top edge - so you can angle the region to match a tilted face or a rotated sign. Right-click deletes a rectangle, and there are undo and clear buttons. Close the editor and every rectangle you drew becomes a grid of tracking points, which is what flows into the tracker.

The mechanism is refreshingly simple. For each rectangle, the node lays down a point grid at a density you control, rotates the points with the rectangle, then combines everything into one tensor. density_per_100px (default 5) is the only required input besides the frame itself - it's points per 100 pixels of rectangle, so it scales with box size. Bump it for dense tracking, drop it when you want fewer, faster points.

Optional inputs worth knowing:

  • rect_json - the node's own output fed back in. The editor serializes your rectangles as JSON; paste it here to reproduce or hand-tweak a layout. When it's set, it wins over the manual coordinates.
  • x, y, w, h - the manual fallback rectangle, used when rect_json is empty. Handy when you'd rather type a region than draw it.
  • margin_px - insets the point grid from the rectangle's edges. Good when the border of your region is background you don't want tracked.
  • random_jitter_px with seed - scatters the grid points randomly inside the rectangle. Sounds like noise, but jittering dense tracking points is a real trick: it stops the tracker from glomming onto a regular pattern and can stabilize tracks on textured regions.

Outputs:

  • points (TENSOR, [N,2]) - the one that matters. Wire it into LiteTracker: Track's points_tensor input. That's the entire point of the node.
  • preview_png (IMAGE) - the overlay with rectangles and points drawn, so you can eyeball density before tracking.
  • bbox (BBOX) - the bounding box covering all generated points.
  • rect_json (STRING) - serialized rectangles; feed it back into the rect_json input to keep tweaking.
  • bg_base64 (STRING) - a base64 copy of the input frame that the editor UI draws on. Don't wire it to anything; it's not for you.

Install is the pack's shared story - ComfyUI Manager (search "comfyui-lite-tracker") or the clone-and-pip in the README; requirements are just opencv, requests, and torchvision. One thing to know: the editor is a web extension the pack ships under web/. If you install the pack and the "Open Grid Editor" button does nothing, the frontend is likely serving a cached page - hard-refresh ComfyUI in the browser (Ctrl/Cmd+Shift+R) before you blame the node.

Where people get tripped up: rect_json silently overriding your manual x/y/w/h (clear it if you want the fallback to apply), and forgetting that points are generated once - change the editor, then re-run the whole path so points updates. And don't over-densify. At density_per_100px 5, a few rectangles already produce hundreds of points, and every point is work for the tracker on every frame. Start dense-ish, look at the preview, back off.

CategoryLiteTracker

Inputs (10)

NameTypeDefaultDescription
imageIMAGE
density_per_100pxFLOAT5.00.1–100
rect_jsonoptSTRING
xoptINT1000–100000
yoptINT1000–100000
woptINT4001–100000
hoptINT4001–100000
margin_pxoptINT00–100000
random_jitter_pxoptFLOAT0.00–10000
seedoptINT00–2147483647

Outputs (5)

NameTypeDescription
pointsTENSOR
preview_pngIMAGE
bboxBBOX
rect_jsonSTRING
bg_base64STRING