LiteTracker: Grid Editor
Draw Boxes, Get Tracking Points
- image
- points
- preview_png
- bbox
- rect_json
- bg_base64
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 whenrect_jsonis 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_pxwithseed- 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'spoints_tensorinput. 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 therect_jsoninput 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.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| density_per_100px | FLOAT | 5.00.1–100 | — |
| rect_jsonopt | STRING | — | |
| xopt | INT | 1000–100000 | — |
| yopt | INT | 1000–100000 | — |
| wopt | INT | 4001–100000 | — |
| hopt | INT | 4001–100000 | — |
| margin_pxopt | INT | 00–100000 | — |
| random_jitter_pxopt | FLOAT | 0.00–10000 | — |
| seedopt | INT | 00–2147483647 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| points | TENSOR | — |
| preview_png | IMAGE | — |
| bbox | BBOX | — |
| rect_json | STRING | — |
| bg_base64 | STRING | — |