Nodes/VLM_nodes/VLM Detections to JSON
ComfyUI Node Runs on cloud

VLM Detections to JSON

Freeze your detections to text before they vanish

By gokayfem·Created 3 years ago·Updated 9 days ago· 583
VLM Detections to JSON
  • detections
  • json
prettytrue

The VLM_DETECTIONS socket is powerful and completely ephemeral - the moment the queue finishes, the data lives only inside ComfyUI's memory. If you want to keep it - save it alongside your images, hand it to a script, log what a detector found - you need to turn it into a string you can put anywhere. VLM Detections to JSON is that string-maker.

It's the forward half of the pack's persistence boundary, paired with VLMDetectionsFromJSON on the way back in. Nothing fancy, and that's the point: a deterministic serialization of your detections that another program - or another queue run - can read.

How it works

You feed it a VLM_DETECTIONS socket and it serializes the whole sequence: media dimensions, frame count, and every detection's box, label, score, and any polygon or quad data, in the versioned comfyui-vlm/detections schema. The pretty toggle (default on) decides whether the output is indented for humans or compact for machines. The output is a single STRING socket.

What it deliberately does not include: dense mask tensors. The pack keeps masks in-process and out of JSON so API results and saved files don't blow up by hundreds of megabytes. If you need masks, keep them in the graph.

Inputs and outputs

  • detections (VLM_DETECTIONS) - the only input.
  • json (STRING) - pretty or compact JSON, ready to save, log, or send somewhere.

It's one of those nodes that earns its place not by being clever but by being where the data becomes shareable. Pair it with VLMDetectionsFromJSON on the other side of a save/load cycle and your analysis survives restarts.

Installing this pack

Same as every node here - it's one pack, gokayfem's ComfyUI_VLM_nodes. 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

There's not much to break here, but two habits help. If you're storing results for later, keep pretty on for debugging and flip it off only when you actually need compact output for wire transfer. And remember the schema is versioned - data you serialize today with v1 will be read back by VLMDetectionsFromJSON's strict parser, which rejects documents it doesn't recognize. If you're building a durable pipeline, that strictness is doing you a favor: it fails loudly instead of silently misreading coordinates.

CategoryVLM Nodes/Vision/Utilities

Inputs (2)

NameTypeDefaultDescription
detectionsVLM_DETECTIONS
prettyBOOLEANtrue

Outputs (1)

NameTypeDescription
jsonSTRING