Nodes/VLM_nodes/Filter VLM Detections
ComfyUI Node Runs on cloud

Filter VLM Detections

Your detector shouts. This node whispers.

By gokayfem·Created 3 years ago·Updated 9 days ago· 583
Filter VLM Detections
  • detections
  • detections
label
label_mode
minimum_score0.00
minimum_area0
maximum_area0
track_id-1
frame_index-1

Open-vocabulary detection is generous to a fault. Give it "person, animal, vehicle" and it will hand you every person, every dog, every parked car - plus the sixteen false positives it was 30% sure about, all at once. Filter VLM Detections is the node that cuts the noise: keep only what you actually care about before the detections flow anywhere else.

It's the quiet utility in gokayfem's VLM_nodes pack that makes every downstream node better, because every downstream node inherits whatever garbage you feed it. Filter first, render, crop, count, or track second.

How it works

It takes a VLM_DETECTIONS sequence and applies your criteria, returning a new VLM_DETECTIONS sequence with only the survivors - same schema, same socket, so you can chain it anywhere in a detection pipeline. The filters are combinable: label, score, area, track, and frame all apply together.

What you can filter on:

  • label with label_mode of contains or exact - keep only detections whose label matches. Empty label means "don't filter on label."
  • minimum_score - confidence floor. This is the one you'll use constantly to kill the "person 0.24" junk.
  • minimum_area / maximum_area - drop tiny specks or giant false positives. Note maximum_area of 0 (the default) disables that filter, per the tooltip.
  • track_id - keep only one tracked object's detections.
  • frame_index - keep only detections from a specific frame (-1 = all).

Inputs and outputs

  • detections (VLM_DETECTIONS) - the input sequence.
  • detections (VLM_DETECTIONS) - the filtered output, same socket type. One in, one out.

Installing this pack

Same as the rest of the pack. ComfyUI Manager: search VLM_nodes. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/gokayfem/ComfyUI_VLM_nodes
cd ComfyUI_VLM_nodes
python -m pip install -r requirements.txt

Run pip with ComfyUI's Python. No model downloads for this node.

Common issues

A couple of judgment calls will trip you up. Score thresholds interact: a detector's box_threshold already cut low-confidence boxes, so a high minimum_score here can empty your sequence entirely - check what the detector already kept before layering on an aggressive floor. And label_mode matters more than it looks: "cat" with contains matches "cat," "cat_dog," and "wildcat" (and "concatenate" if a label were ever that weird); exact matches only "cat." If you're filtering a crowd scene down to one class, exact is usually the honest choice.

CategoryVLM Nodes/Vision/Utilities

Inputs (8)

NameTypeDefaultDescription
detectionsVLM_DETECTIONS
labelSTRING
label_modeCOMBO2 options: contains, exact
minimum_scoreFLOAT0.000–1
minimum_areaFLOAT0
maximum_areaFLOAT0Zero disables the maximum-area filter.
track_idINT-1
frame_indexINT-1

Outputs (1)

NameTypeDescription
detectionsVLM_DETECTIONS