DOGMA v52 Non-Overlapping Scene Inventory
The VLM prompt that makes SAM find the tiny stuff
- instruction
A text-prompted segmenter can only find what you name. Name it badly and it fails in a way that looks like a model problem but isn't: you ask for "cars" on a street photo, and the row of little cars parked in the distance - forty pixels wide each, half in shadow - comes back missing, because small repeated things read as texture. This node is the prompt that fixes that.
It's a string builder. project_context in, one instruction out, and that instruction goes to your VLM. It loads nothing and needs nothing wired to it beyond a text source.
What it makes the VLM do
The instruction asks for an inventory of clearly visible content, in a fixed format:
GROUP|category|kind
Up to six families, kind being OBJECT, STRUCTURE, or SURFACE, drawn from a broad list - vehicles, people, buildings, vegetation, road, water, animals, furniture, machinery, products, clothing, food. The rest of the prompt is a block of recall rules that exist because the model would otherwise do the wrong, tidy thing:
- All cars, buses, trucks, vans, motorcycles and bicycles are ONE
vehiclesgroup. - Vehicles must be included even when tiny, partially occluded, touching, distorted or only partly visible.
- If several small repeated instances are visible anywhere, include the family - don't wait for a clean isolated example.
- All grass, lawn, trees, bushes, foliage are ONE
vegetationgroup. - Don't split a family into multiple groups.
- Don't use sky, haze, fog, text, logos, signs, brands, windows or defects.
- Never invent a category because the project context suggests it.
That "don't split" rule is the whole reason this node exists separately from the v50 one. A VLM asked to inventory freely will happily return cars, trucks, bus, vans as four groups and eat your six slots with one semantic idea.
Non-overlapping means what, exactly
Not pixels. The families are non-overlapping semantically, so you get six clean categories instead of five ways of saying "vehicle". Masks will absolutely overlap in pixel space - a vehicle mask sits on top of a road mask by definition - and that's handled later, by DOGMAV52MaskDeoverlap, which uses the kind labels this node asks for. OBJECT masks win; STRUCTURE and SURFACE masks get carved around them. So the kind field isn't decoration, it's the instruction that decides who gets priority in the carve.
Don't expect signage repair from this, either. Text, logos and brands are explicitly excluded - OCR is off the table by design.
Wiring it up
project_context is a forceInput string, so it takes a PrimitiveString node, not typing in the box. The instruction output goes into your VLM's prompt input; the VLM's reply goes into DOGMAV52ScenePlan.inventory_text, which is what actually parses the GROUP| lines into segmentation jobs.
Keep the context short and concrete. The model is told to use it as a qualifier, not as evidence - but a long rambling context is still the thing it's most likely to hallucinate from.
Install
Manager → search DOGMA Nodes. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
Restart ComfyUI, then search the node menu for "scene inventory" or "non-overlapping". The pack has no third-party dependencies - requirements.txt contains a single comment saying so.
Fair warning on finding it: the node is called v52 and lives in category DOGMA/v53. The author's version tags move independently of the display names, and the file backing all of this is numbered 56.4.1. Search by name, not by version.
When the VLM ignores you
It will, sometimes. Models add explanation lines, invent a sky group (which the plan node then discards), or split vehicles anyway - the plan node's synonym table merges them back into one vehicles category as a safety net, so a mildly disobedient reply usually still works.
What you should not treat as a failure is a slot coming back empty. The prompt tells the model never to invent a category, and if a family genuinely isn't in the image, you get a placeholder prompt that matches nothing and an empty mask. That's the design working: no mask is better than a mask of the wrong thing.
If your VLM needs a nudge, keep the context one line and lower the temperature if your node exposes it. Reciting the format back at the model in a follow-up rarely helps; re-running the same instruction usually does.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| project_context | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| instruction | STRING | — |