Nodes/comfyui-lite-tracker/LiteTracker: Track
ComfyUI Node

LiteTracker: Track

Following Points Through Video, One Frame at a Time

By fuselayer·Created 10 months ago·Updated 10 months ago· 0
LiteTracker: Track
  • tracker
  • image
  • points_tensor
  • segm_mask
  • tracker
  • coords
  • visibility
  • preview
  • video_path
resetfalse
use_gridtrue
grid_size10
grid_query_frame0
points_text
batch_is_sequencetrue
preview_modevisualizer
vis_also_save_filefalse
vis_save_dir/tmp/ComfyUI/custom_nodes/comfyui-lite-tracker/results
vis_filename
vis_fps24.00
vis_moderainbow
vis_linewidth2
vis_show_first_frame0
vis_tracks_leave_trace0
vis_pad_value0
vis_grayscalefalse
vis_opacity1.00
vis_query_frame0
vis_compensate_for_camera_motionfalse

This is the node you came for. LiteTracker: Load Model gets the weights; LiteTracker: Track does the work. It takes a video's frames and a set of query points, then follows those points forward through time, frame by frame. It's the mechanism behind a surprising amount of modern video tooling: motion transfer (driving a still image with a reference video, the Wan-Move style trick), point-controlled generation, and keeping a specific object consistent across a clip. The community calls these CoTracker-class point trackers, and this pack is a LiteTracker implementation of exactly that idea.

The core mental model: in ComfyUI, video isn't a file - it's an IMAGE tensor whose batch dimension is time ([T, H, W, C] frames). So you feed this node the image from a video loader like VHS_LoadVideo, not a path. Feed it the tracker from LiteTracker: Load Model, and it returns, for every frame, where each query point moved to.

How it works is the whole pitch. LiteTracker is built for low-latency, online processing: it walks the frames one at a time, keeping a sliding temporal window (the window_len you set at load time, default 16) and using only past frames to predict the current one. No looking ahead, no re-processing the whole clip. That temporal causality is why a model built for real-time surgical tracking slots into video workflows so cleanly - it's fast, and it can emit results before the clip is even finished. On CUDA it runs bf16 under autocast; on Apple Silicon it falls back through MPS.

The inputs that matter:

  • tracker and image are required. image = your frames.
  • reset - default false. Query points are built on the first run and reused after that. Swap in a different video or change the points and it keeps tracking the old setup unless you set this true. This is the classic "why is it tracking my other video" gotcha.
  • use_grid (true) with grid_size (default 10) - the easiest mode: a 10×10 grid, 100 points across the whole frame. grid_query_frame (default 0) is the frame those points are defined on.
  • points_text - hand-typed points as "x,y;x,y;..." or newline-separated. Loses to points_tensor if both are connected.
  • points_tensor - where you plug the [N,2] tensor from RectEditor (the Grid Editor node). This is the "track just the face / hand / product" path.
  • segm_mask - an optional binary segmentation mask (IMAGE) that constrains tracking to a region, and it's also required for vis_compensate_for_camera_motion to do anything.
  • batch_is_sequence - true means treat the batch dimension as the timeline, which is what you want with a video. Leave it true.
  • preview_mode - simple draws green dots, visualizer renders the pretty CoTracker-style rainbow tracks, none skips drawing for speed.

The outputs, and where they go:

  • tracker - the bundle passed back through, so you can chain another Track call or keep state.
  • coords - a TENSOR of shape [T, N, 2]: the (x, y) position of each of your N points on each of the T frames. This is the data you actually want for motion transfer or driving a downstream model.
  • visibility - a [T, N] TENSOR of per-point, per-frame visibility confidence. Occluded points go near zero. Filter on this before trusting a coordinate.
  • preview - the IMAGE with tracks drawn, ready for a PreviewImage or VHS_VideoCombine.
  • video_path - a STRING path to a saved .mp4, but only when vis_also_save_file is true. It's false by default; the visualizer previews on screen without writing files.

Install is the pack's shared story: ComfyUI Manager (search "comfyui-lite-tracker") or the clone-plus-pip in the README - requirements are just opencv-python, requests and torchvision, and the ~100 MB checkpoint downloads on the Load Model node's first run. The repo's example workflow is a sane template to steal: VHS_LoadVideo feeds frames, SAM2 supplies the mask, RectEditor defines the points, and VHS_VideoCombine writes the result.

Where people get burned: forgetting reset after changing inputs; expecting points_text to win over points_tensor (it won't); and enabling vis_compensate_for_camera_motion without a segm_mask - the node just prints a warning and silently disables it. And remember the preview is a diagnostic, not a finished render. If you want a clean tracked video, save the raw frames and draw your own overlay later.

CategoryLiteTracker

Inputs (24)

NameTypeDefaultDescription
trackerLITETRACKER
imageIMAGE
resetoptBOOLEANfalse
use_gridoptBOOLEANtrue
grid_sizeoptINT101–256
grid_query_frameoptINT00–99999
points_textoptSTRING
points_tensoroptTENSOR
segm_maskoptIMAGE
batch_is_sequenceoptBOOLEANtrue
preview_modeoptCOMBOvisualizer3 options: simple, visualizer, none
vis_also_save_fileoptBOOLEANfalse
vis_save_diroptSTRING/tmp/ComfyUI/custom_nodes/comfyui-lite-tracker/results
vis_filenameoptSTRING
vis_fpsoptFLOAT24.001–240
vis_modeoptCOMBOrainbow3 options: rainbow, cool, optical_flow
vis_linewidthoptINT21–12
vis_show_first_frameoptINT00–100
vis_tracks_leave_traceoptINT0-1–200
vis_pad_valueoptINT00–64
vis_grayscaleoptBOOLEANfalse
vis_opacityoptFLOAT1.000–1
vis_query_frameoptINT00–99999
vis_compensate_for_camera_motionoptBOOLEANfalse

Outputs (5)

NameTypeDescription
trackerLITETRACKER
coordsTENSOR
visibilityTENSOR
previewIMAGE
video_pathSTRING