Filter VLM Detections
Your detector shouts. This node whispers.
- detections
- detections
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_modeofcontainsorexact- 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_areaof 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.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| detections | VLM_DETECTIONS | — | |
| label | STRING | — | |
| label_mode | COMBO | 2 options: contains, exact | |
| minimum_score | FLOAT | 0.000–1 | — |
| minimum_area | FLOAT | 0 | — |
| maximum_area | FLOAT | 0 | Zero disables the maximum-area filter. |
| track_id | INT | -1 | — |
| frame_index | INT | -1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| detections | VLM_DETECTIONS | — |