Nodes/Akatz Custom Nodes/Blob Track | Akatz
ComfyUI Node

Blob Track | Akatz

Blob-track your footage with plain OpenCV, no ML model needed

By akatz-ai·Created 2 years ago·Updated 9 months ago· 32
Blob Track | Akatz
  • image
  • IMAGE
  • MASK
cache_frames1
diff_threshold30
min_threshold50
max_threshold220
threshold_step10
filter_by_areatrue
min_area25.00
max_area100000.00
detect_bright_blobsfalse
max_blobs10
blob_outline_thickness2
blob_outline_color#ff0000
blob_outline_alpha1.00
line_thickness2
line_color#00ff00
line_alpha1.00

Blob Track is Akatz's lightweight motion tracker: it finds the moving regions in a frame batch and hands you both an annotated composite image and a mask of where they were. No YOLO, no SAM, no model download - it's frame differencing plus OpenCV's SimpleBlobDetector, which makes it fast and free to run, and also means you should set expectations accordingly.

The honest use case is "I need a rough region of interest that follows movement, and I don't need pixel-perfect object identity." Think driving an effect region from something crossing the frame, generating a tracking mask for a follow effect, or detecting a dancer's motion to drive mask animation. If you need to track a specific named object or keep identity through occlusions, reach for a real tracker or segmentation instead - this is the cheap, coarse layer.

How it works

Each frame is compared against a reference built from the previous cache_frames frames (averaged). The absolute difference becomes a grayscale motion map, thresholded by diff_threshold, and that threshold image is fed to OpenCV's SimpleBlobDetector. Detected blobs get drawn as alpha-blended boxes on the composite, and as filled white rectangles on the mask output. With line_alpha above zero it also connects blob centers with lines, which read as crude "paths" across a clip.

Inputs that matter

There are a lot of knobs here, but you'll actually set a handful:

  • image - your IMAGE batch (it accepts a live video stream too, hence defaultInput).
  • cache_frames - how many previous frames to average as the motion reference. Default 1 = compare against the last frame.
  • diff_threshold - how much a pixel must change to count as motion. This is your main sensitivity dial; too low and noise becomes blobs, too high and slow movement disappears.
  • filter_by_area with min_area/max_area - throw away tiny specks and giant background fills.
  • max_blobs - cap how many it tracks (default 10).
  • The rest (min_threshold, max_threshold, threshold_step) are SimpleBlobDetector's binarization ladder; you can usually leave them alone.

Outputs are IMAGE (frames with colored outlines and lines) and MASK (white boxes on black). The mask is the useful one - wire it into a dilation or inpaint region.

Installing it

Part of the akatz-ai/ComfyUI-AKatz-Nodes pack. Install via Manager (search "AKatz") or:

cd ComfyUI/custom_nodes
git clone https://github.com/akatz-ai/ComfyUI-AKatz-Nodes
cd ComfyUI-AKatz-Nodes
pip install -r requirements.txt

Then restart ComfyUI. Requirements are numpy, torch, opencv-python and pydub - no models to download.

Common issues

Nothing detected is the classic failure, and it's almost always diff_threshold or min_area: lower the threshold, and if your blobs are small, drop min_area. The other trap is expecting it to work on a static camera - it's purely motion-based, so if nothing moves, nothing gets tracked. If the composite looks fine but the mask is empty, check line_alpha - lines are only drawn into the mask when it's above zero.

Category💜Akatz Nodes/Tracking

Inputs (17)

NameTypeDefaultDescription
imageIMAGE
cache_framesINT11–120
diff_thresholdFLOAT300–255
min_thresholdINT500–255
max_thresholdINT2201–255
threshold_stepINT101–50
filter_by_areaCOMBOtrue2 options: false, true
min_areaFLOAT25.000–1000000
max_areaFLOAT100000.001–100000000
detect_bright_blobsCOMBOfalse2 options: false, true
max_blobsINT101–100
blob_outline_thicknessINT21–20
blob_outline_colorSTRING#ff0000
blob_outline_alphaFLOAT1.000–1
line_thicknessINT21–20
line_colorSTRING#00ff00
line_alphaFLOAT1.000–1

Outputs (2)

NameTypeDescription
IMAGEIMAGE
MASKMASK