DOGMA v38 Inventory Kinds
Turn a VLM's rambling into six labels
- kind_1
- kind_2
- kind_3
- kind_4
- kind_5
- kind_6
The DOGMA semantic pipeline starts with a vision-language model looking at your master image and listing what's actually in it. You can't use that text directly - it's prose, it has preamble, it drifts. So the plan is to make the VLM emit a rigid format instead:
GROUP|cars|OBJECT|1970s Italian cars on a road
Four fields, pipe-separated: the literal GROUP, a category, a kind, and a short description. Inventory Kinds v38 is the node that pulls the kind field out of each line and hands you six of them.
What it does, precisely
It parses inventory_text line by line, keeping only lines that start (case-insensitively) with GROUP|, splitting on the pipe and requiring at least four fields. It lowercases the category, strips markdown fences, uppercases the kind, and coerces anything that isn't OBJECT, STRUCTURE or SURFACE to OBJECT.
Then the filters, which are the interesting part:
- duplicate categories are dropped, first occurrence wins;
- categories containing
text,logo,sign,license,brandoradvertare skipped entirely; - categories matching
broken,damaged,malformed,wrong,missing,blurorblurryare skipped too; - an empty SAM prompt field falls back to the category name;
- it stops at six rows, and pads with
none/nonexistent_placeholder_object_xyz:1/OBJECTif it got fewer.
Outputs are kind_1 through kind_6 - plain strings, one per slot, in the same order as the rest of the pack's six-slot convention.
Why the filters matter more than the parse
Two design decisions here are worth stealing for your own prompts.
Text is excluded because OCR is a hallucination magnet. A restoration pass that retypes a shop sign will invent plausible-looking garbage lettering, and it's the most obvious tell in a restored photo. The pack handles this by never letting a text category become editable - see DOGMAScenePlanSlots, which reserves its first slot for signage purely to protect it.
Defect words are excluded so that "damaged wall" doesn't become a category. Categories describe what is there, not what's wrong with it. Get that backwards and your segmenter ends up masking the artifacts instead of the objects.
And the padding is deliberate sabotage, in a good way: nonexistent_placeholder_object_xyz is a concept no segmenter will ever match, so an unused slot produces an empty mask instead of, say, everything.
Inputs and outputs
inventory_text (multiline STRING) in; kind_1 … kind_6 out. Nothing to tune - the taxonomy is fixed by the parser.
Where does inventory_text come from? Whatever VLM you're running in-graph: a local Qwen3-VL through one of the llm-in-comfyui-style node packs, or the pack's own instruction builders (DOGMAV50SceneInstruction, DOGMAV52SceneInstruction) which emit the exact prompt that asks for GROUP| lines. The kind values then travel downstream to nodes that behave differently per kind - DOGMARegionStitchV543 picks its feather width from kind, for instance: 10px for STRUCTURE/SURFACE, 5px for objects.
Install
Manager → search DOGMA Nodes → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
No dependencies, no model files - this is a text parser. The models you need for it to be useful are elsewhere: a VLM to write the inventory, a segmenter to consume the resulting prompts. It lives under DOGMA/Semantic Detailer with the rest of the 1.0.4 semantic nodes.
The pack is axior's, from the studio side of a Milan production team doing commercial AI work through heavy ComfyUI inpainting. The rigid GROUP| format is the fingerprint of that world: a schema invented to make a VLM's output machine-readable, because a human re-reading inventory text between six passes is not a production process.
When you get nothing
If all six kinds come back OBJECT, your VLM didn't obey the format and the parser fell back - check the raw text before you debug anything else. If they come back all none, no line started with GROUP| at all (markdown code fences are stripped, but prose framing isn't). The comparison node worth keeping open while you tune is DOGMASceneInventoryPlanV38, which shows the same parse as categories and prompts plus a summary string, so you can see exactly what the parser saw.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| inventory_text | STRING | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| kind_1 | STRING | — |
| kind_2 | STRING | — |
| kind_3 | STRING | — |
| kind_4 | STRING | — |
| kind_5 | STRING | — |
| kind_6 | STRING | — |