Nodes/DOGMA Nodes/DOGMA v42 Robust Scene Inventory
ComfyUI Node

DOGMA v42 Robust Scene Inventory

When your VLM ignores the format, this still plans

By axior·Created 4 months ago·Updated 3 days ago· 1
DOGMA v42 Robust Scene Inventory
    • preview
    • category_1
    • sam_prompt_1
    • kind_1
    • threshold_1
    • category_2
    • sam_prompt_2
    • kind_2
    • threshold_2
    • category_3
    • sam_prompt_3
    • kind_3
    • threshold_3
    • category_4
    • sam_prompt_4
    • kind_4
    • threshold_4
    • category_5
    • sam_prompt_5
    • kind_5
    • threshold_5
    • category_6
    • sam_prompt_6
    • kind_6
    • threshold_6
    inventory_text
    project_context

    Every planner in this pack assumes a vision-language model will emit tidy GROUP|category|prompt|kind lines. Every VLM, given half a chance, will instead write you a friendly paragraph about the photo. V42 is the version that shrugs and works anyway.

    Three passes over the text

    Give it the raw VLM response and it tries, in order:

    1. The pipe format, if it's there. Lines containing | whose first field is GROUP or CATEGORY get parsed normally.

    2. A keyword scan over the entire response, malformed prose included. This is the robust bit. It walks a fixed priority list - people, cars, bus, trucks, buildings, grass, trees, sky, road, water, animals, furniture, machinery, food, products, clothing - and pattern-matches words anywhere in the text: automobile, sedan, hatchback all land as cars; lorry as trucks; foliage as trees. The prose doesn't have to be structured at all. If a VLM says "I can see a couple of cars parked on a street", you get cars and road.

    3. A fallback derived from your project context. If the two passes leave gaps, it fills slots from a list chosen by project_context: urban-ish context (Milano, urban, city, street) gets cars, people, buildings, grass, sky, road; anything else gets people, animals, buildings, trees, sky, road. Then a final generic list (furniture, products, machinery, water, clothing, food) tops up remaining slots.

    The design goal is stated in the source: prevent catastrophic six-NONE plans. A plan where nothing matched means no masks, no crops, no repairs - the graph runs and does nothing, which is the worst possible outcome because it looks like it worked.

    Inputs and outputs

    Two inputs: inventory_text and project_context (both multiline STRING). Project context is the thing that makes the fallback meaningful - it's where "Milan, Italy, 1972–1978" lives, and DOGMARestorationBriefV16 is a fine place to hold it.

    The preview output is where this version earns its place, because it labels the origin of each group: GROUP 1: cars [OBJECT] | SAM: car, automobile, ... | threshold=0.20 | QWEN, versus | FALLBACK for anything it invented. Read that string and you know instantly whether your VLM is pulling its weight.

    Six slots follow, each with category_N, sam_prompt_N, kind_N and threshold_N. Thresholds here sit in the 0.16–0.22 band - noticeably stricter than v40's 0.055–0.075, because the fallback rows are guesses and a strict threshold stops a guess from becoming a mask.

    Install

    Manager → search DOGMA Nodes → install → restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
    

    No dependencies, no models, nothing to download - the pack declares none, and this node is regex work over a string. Registers under DOGMA/v42. It pairs with a local VLM (Qwen3-VL is the community default) writing the inventory and a segmenter consuming the prompts.

    DOGMA Nodes comes from axior, the studio arm of a Milan production team that runs commercial AI jobs through big ComfyUI inpaint chains. The fallback list mentioning Milano and "city, street, urban" is not coy about which project it was written for.

    The honest caveat

    Fallbacks invent work. A FALLBACK row for cars on an image with no cars produces a mask with nothing in it - harmless, a wasted segmenter pass. But on an image with one distant car the VLM didn't mention, the fallback will find it and schedule a repair pass the VLM never asked for. Usually that's a win. Occasionally it's a hallucinated edit in a region you never inspected.

    So: watch the preview, and if you'd rather have nothing than a guess, use the v44 planner, which deliberately removed context-based fallback and only ever reports what it found in the source text. Same author, opposite philosophy, three versions apart. Read both previews on your own image before you decide which you trust.

    CategoryDOGMA/v42

    Inputs (2)

    NameTypeDefaultDescription
    inventory_textSTRING
    project_contextSTRING

    Outputs (25)

    NameTypeDescription
    previewSTRING
    category_1STRING
    sam_prompt_1STRING
    kind_1STRING
    threshold_1FLOAT
    category_2STRING
    sam_prompt_2STRING
    kind_2STRING
    threshold_2FLOAT
    category_3STRING
    sam_prompt_3STRING
    kind_3STRING
    threshold_3FLOAT
    category_4STRING
    sam_prompt_4STRING
    kind_4STRING
    threshold_4FLOAT
    category_5STRING
    sam_prompt_5STRING
    kind_5STRING
    threshold_5FLOAT
    category_6STRING
    sam_prompt_6STRING
    kind_6STRING
    threshold_6FLOAT