Nodes/VLM_nodes/VLM Detection Centers
ComfyUI Node Runs on cloud

VLM Detection Centers

When all you need is the center of the thing

By gokayfem·Created 3 years ago·Updated 9 days ago· 583
VLM Detection Centers
  • detections
  • points
  • points_json

Some tasks don't need a box, a mask, or a label. They need a single point: where is the thing. That's the whole job of VLM Detection Centers - take every detection's bounding box and emit its center as a typed point, ready to feed point-hungry nodes downstream.

It's a tiny utility in gokayfem's VLM_nodes pack, and it exists because the pack has a first-class VLM_POINTS socket (schema comfyui-vlm/points, version 1) that SAM-style point prompting, robotics targeting, and overlay work all want. You detected objects; here's the center of each one, in source-image pixel coordinates.

How it works

For each detection record it computes the box center - ((x1+x2)/2, (y1+y2)/2), in the same pixel coordinate space as the detection - and packages them as a VLM_POINTS sequence with per-frame organization preserved. The second output, points_json, serializes the same points for logging or external use.

Where this shines: SAM/SAM2-style segmentation that takes a point prompt, pointing-based VLMs (the pack's Moondream point node speaks this exact socket), robotics observation builders that need "where is the object relative to the camera," or simply drawing a marker at each detection to sanity-check a busy scene.

Inputs and outputs

  • detections (VLM_DETECTIONS) - the only input.
  • points (VLM_POINTS) - the typed socket for point-consuming nodes.
  • points_json (STRING) - serialized points for anything that reads JSON.

Installing this pack

One pack, one install - this node isn't special. 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

The usual gotcha is the same coordinate-space trap as the other converters: the point is computed from the detection's coordinates, so if those came from a resized analysis copy, the point describes that copy. Use it against the image the detection actually described. Also note that a center point is derived from the box, not from the object's true centroid - for a person mid-stride the box center is slightly off from the actual body center. If you need true centroids, get masks first (via VLMDetectionsToMasks) and compute from those.

CategoryVLM Nodes/Vision/Utilities

Inputs (1)

NameTypeDefaultDescription
detectionsVLM_DETECTIONS

Outputs (2)

NameTypeDescription
pointsVLM_POINTS
points_jsonSTRING