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

DOGMA InstanceAuditView v1.0.9

One mask per VLM call, and a prompt that hates outline-only masks

By axior·Created 6 months ago·Updated 16 days ago· 2
DOGMA InstanceAuditView v1.0.9
  • image
  • candidates
  • instance_sheets
  • audit_instructions
◄panel_size512►

What it is

The v1.0.9 way of asking a vision model "did this mask actually select the thing?". Where the DOGMAAuditBatch nodes pack four (or two) candidates into one sheet to save calls, this node goes the other way: one candidate, one sheet, one instruction string, and it takes semantic strictness about as far as a prompt can.

The result is a list pair - a sheet per candidate and a matching instruction per candidate - that you feed to a VLM, one call each. On a scene with thirty candidates that's thirty VLM calls. Expensive, and deliberate: this is the version you want when each individual mask is going to drive an expensive render, and a false PASS costs more than the calls do.

What's on the sheet

Per candidate: the source image is cropped around the mask with a 12% margin, then laid out as a 2×2 - original crop, white mask, cyan overlay, and selected pixels on gray. Everything is scaled so the panel's long side is panel_size. Judge-the-pixels is spelled out in the instructions; the gray panel in particular is there so the model can see what the mask excluded against what the crop contained.

The prompt is the interesting part

The instruction text this node emits is the most specific in the pack, and it reads like a list of things that actually went wrong in someone's renders:

  • PASS only if the mask selects the substantial visible body of a coherent target object or structural unit.
  • FAIL masks that select only outlines, highlights, isolated windows or scattered surface fragments while the main body is unselected.
  • FAIL background, sky, a crop-shaped rectangle, or unrelated classes selected as the target.
  • An architectural arch means its solid masonry and piers - the actual opening stays unselected, as do occlusions.
  • Occluded parts and true openings don't need filling; several disconnected visible components of the same occluded object are fine.
  • Other separate objects may stay unselected.

That middle rule is the one worth internalising if you're hand-writing prompts for this job anywhere else. "Outline-only mask" is the classic failure of a text-conditioned segmenter on structured objects - you ask for a building and get its window frames, or ask for a fence and get its rails. A model that has been told what that failure looks like catches it; a model told merely "is this a building?" does not.

Inputs and outputs

  • image (IMAGE) - the source the masks were computed on.
  • candidates (DOGMA_CANDIDATES) - the bundle from a DOGMA search node.
  • panel_size (INT, 256–768, step 64, default 512) - per panel, so the sheet comes out roughly twice this.

Outputs, index-aligned lists:

  • instance_sheets (IMAGE, list) - one sheet per candidate.
  • audit_instructions (STRING, list) - the matching prompt for each.

With zero candidates you get a sentinel 1×64×64 image and the single string No candidate; return FAIL. - so the list stays aligned and the reviewer can still run.

Wiring, and the count rule

This node pairs with DOGMAInstanceReviewV109, and that pairing has a hard rule: the reviewer requires exactly one answer per mask. Not ceil(n/2), not ceil(n/4) - one each. If the counts don't line up it raises DOGMA: N masks but M audit answers. No guessing by position. Which is the right call: positional matching with the wrong offset would attach verdicts to the wrong masks and you'd never notice.

That's also why a generic VLM node that concatenates or drops list items will break this chain, and why you should check the reviewer's output count before you trust the run. The batch nodes exist precisely because on big scenes the one-per-call pattern runs out of time before it runs out of masks; this is the quality tier, not the throughput tier.

One more thing worth knowing before you build on it: the v1.0.9 search path it was designed alongside used a box-only SAM decoder (segment each detected box in a single pass, then geometry-check the result). Version 1.0.10 rolled that back to text-conditioned SAM refinement because the box-only approach was misbehaving on real scenes - the changelog is unusually blunt about it. If you're on 1.0.9-era nodes, know that this audit is your main defence, and it is a probabilistic one. A VLM verdict is evidence, not ground truth.

Install

Manager → search DOGMA Nodes, or:

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

Only scipy>=1.10 in requirements.txt; no weights downloaded, no core edits. Your VLM is whatever you wire it to - the pack's own workflows use ModernVLM from comfyui_vlm_nodes, and it also ships a list-mode adapter for it. Pick the VLM the way the KB suggests picking VLM nodes generally: something widely installed and open, because a VLM node is expected to load big weights and touch the network, which is exactly why a sketchy one doesn't look suspicious.

CategoryDOGMA/v1.0.9

Inputs (3)

NameTypeDefaultDescription
imageIMAGE—
candidatesDOGMA_CANDIDATES—
panel_sizeINT512256–768—

Outputs (2)

NameTypeDescription
instance_sheetsIMAGE—
audit_instructionsSTRING—