Nodes/DOGMA Nodes/DOGMA SemanticPlan v1.0.9
ComfyUI Node

DOGMA SemanticPlan v1.0.9

Five lines of VLM output, five wired-up SAM jobs

By axior·Created 6 months ago·Updated 16 days ago· 2
DOGMA SemanticPlan v1.0.9
    • plan_preview
    • category_1
    • sam_prompt_1
    • sam_threshold_1
    • category_2
    • sam_prompt_2
    • sam_threshold_2
    • category_3
    • sam_prompt_3
    • sam_threshold_3
    • category_4
    • sam_prompt_4
    • sam_threshold_4
    • category_5
    • sam_prompt_5
    • sam_threshold_5
    ◄planner_text—►

    This is the plain-text ancestor of the pack's whole planning chain, and it's worth a look for two reasons: it's the least fiddly way to turn a VLM description into segmentation jobs, and it shows you the shape everything later versions do with more ceremony.

    How it works

    You feed it planner_text - a VLM's description, typically one line per category. It reads the text line by line, and each line is split on a pipe:

    people | person; pedestrian
    buildings | building facade; arch
    road | road surface
    

    Text before the pipe is the category, text after is the query hint. Categories go through the pack's canonicaliser (person, persons and pedestrian all become people), names longer than four words are discarded, and anything matching noise, blur, artifact, background, foreground, quality, signage or text is dropped on sight. That last filter is doing more work than it looks like - those are the words a chatty model reaches for when it has nothing concrete to say, and they make terrible SAM queries.

    Queries for each category are built from your hint first - split on semicolons, lowercased, capped at six words - and topped up with the pack's built-in aliases for that category. Duplicates collapse, three queries max per category, and duplicate categories merge their hints rather than occupying two slots.

    With no usable categories at all, the node raises: DOGMA: no usable scene categories; inspect planner output. That's a hard failure rather than an empty pass, and it's the right call - an empty plan means nothing downstream should run.

    The inputs and outputs

    • planner_text (STRING) - the only input, and it's a forced input, so wire a text-outputting node into it.
    • plan_preview (STRING) - the categories and their resolved queries as drawn. The node's own text calls it "scene-specific queries (not a coverage guarantee)," which is refreshingly honest.
    • category_1 … category_5, sam_prompt_1 … sam_prompt_5, sam_threshold_1 … sam_threshold_5 - five wired slots. Unused ones come out as none with an empty prompt.

    Wire each category_i / sam_prompt_i / sam_threshold_i triple into one search node (DOGMASAMCoherentSearchV109 is the one that shipped alongside it), and the threshold outputs straight into that node's threshold input.

    The threshold is where this node shows its age: every slot reports 0.25, hardcoded, no widget. If you want a different detection threshold for a category - and for some categories you do - you override it at the search node.

    Install

    Manager → search DOGMA Nodes, or:

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

    Restart afterwards. No Python dependencies beyond the pack's scipy>=1.10, and this node in particular is pure string handling - it can only fail on what you feed it.

    Should you use it, or the newer planners?

    If you want the shortest path from "a VLM describes my image" to "SAM has five jobs," this is it. Set your planner prompt to ask for category | queries lines and you're done; the parsing is simple enough to predict, which is a virtue after you've spent an evening debugging a JSON parser.

    What you give up is everything v1.0.11 and v1.0.12 added: no independent presence verification (so a hallucinated category goes straight to SAM), no per-slot evidence, no retry on malformed model output, no planner status, and eight slots instead of five. If your VLM is well-behaved and you're hand-checking the preview anyway, none of that is a loss. If your VLM is the reason you're here, use DOGMAProposeCategoriesV112 with DOGMAVerifiedPlan8V112 - same idea, two models checking each other, and a parser that has actually seen a model lose its train of thought.

    CategoryDOGMA/v1.0.9

    Inputs (1)

    NameTypeDefaultDescription
    planner_textSTRING—

    Outputs (16)

    NameTypeDescription
    plan_previewSTRING—
    category_1STRING—
    sam_prompt_1STRING—
    sam_threshold_1FLOAT—
    category_2STRING—
    sam_prompt_2STRING—
    sam_threshold_2FLOAT—
    category_3STRING—
    sam_prompt_3STRING—
    sam_threshold_3FLOAT—
    category_4STRING—
    sam_prompt_4STRING—
    sam_threshold_4FLOAT—
    category_5STRING—
    sam_prompt_5STRING—
    sam_threshold_5FLOAT—