Nodes/DOGMA Nodes/DOGMA MaskAuditGate v56.6
ComfyUI Node

DOGMA MaskAuditGate v56.6

The fussiest PASS in ComfyUI

By axior·Created 4 months ago·Updated 3 days ago· 1
DOGMA MaskAuditGate v56.6
  • masks
  • approved_masks
  • report
audit_text
category
geometry_report

This node takes your masks, your geometry report and your vision model's verdict, and decides whether the category goes to the sampler. If the verdict isn't the exact literal string PASS, the masks come back zeroed. No half-measures, no fuzzy matching - and knowing that saves you an hour of "why is my category empty".

What it's gating

The v56.6 phase-3 pipeline does geometry cleanup first (the SAM instance guard, which clips masks to their detector boxes and removes speckle) and then a semantic audit: a VLM looks at a 2×2 sheet and judges whether the selected pixels actually belong to the named category. Two failure modes need two different checks, and the author is careful that this node doesn't pretend to do the first one - it just carries the geometry report through into its own output so one string holds the whole story.

The gate's rule, in full:

ok = (verdict == 'PASS' and masks.numel() > 0
      and bool((masks >= .5).any())
      and category not in {'none', '__none__', ''})

Four conditions: the audit said PASS, there are masks, at least one pixel is over the threshold, and the category is a real one. Fail any and you get torch.zeros_like(masks) - same shape, same dtype, all zeros, so downstream nodes don't break on a shape mismatch while nothing gets rendered.

The exact-string trap

verdict is your audit_text, stripped and uppercased. Then compared to PASS - the whole string. Which means:

  • PASS works.
  • PASS. does not.
  • PASS - the selection follows the facade does not.
  • \\boxed{PASS} does not.

The v56.6 audit prompt in DOGMAMaskAuditViewV566 does end with "Return exactly one word: PASS or FAIL. No explanation.", so the design is self-consistent - but it puts the entire correctness of the pipeline on a language model emitting one bare token, which is a bet. If your VLM likes punctuation or commentary, this gate will zero every category and the only clue is inside the report string, where the raw verdict is quoted (truncated to 100 characters) next to the SKIP.

If that's happening to you, the honest fix is the v56.7 path: DOGMAInstanceReviewV567 parses verdicts with a regex, accepts PASS/FAIL followed by a short reason, and treats an unparseable answer as a rejection instead of a zeroed batch.

Inputs and outputs

  • masks - the geometry-cleaned masks for one category.
  • audit_text - the VLM's verdict. Usually from the VLM node consuming DOGMAMaskAuditViewV566's sheet and instruction.
  • category - the category string; none/__none__/empty short-circuit to zeros.
  • geometry_report - the string from DOGMASAMInstanceGuardV566, passed through into the output report. Wire it even though the gate ignores its content; you want it in the log.

Outputs: approved_masks (MASK, exact or zeroed) and report (a one-liner like buildings: PASS; visual audit='PASS'. <geometry report>). Take the report somewhere you'll read it - a preview text node, or into DOGMAImageAfterAuditV567 - because it is the only place a SKIP becomes visible.

Install

comfy node install comfyui-dogma-nodes
# or
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
pip install -r ComfyUI-DOGMA-Nodes/requirements.txt

Restart afterwards. The pack claims to be PyTorch-only but ships scipy>=1.10 in requirements.txt, and the v56.6 module imports scipy.ndimage, so don't hand-copy the folder without installing that. No models to download here; the vision model judging the sheet is a separate install.

Gotchas

Zeroed masks look like a working pipeline. Nothing errors, the shapes are right, and the sampler runs on an empty region - so the output is just the untouched source. If a category "isn't doing anything", the gate is the first place to look, not the last.

A category-wide PASS is coarse. This node gates every mask of a category together, because it consumes a category-wide audit sheet. One bad instance takes the whole category down; the v56.7 per-instance review was written specifically to fix that, and the README says so - instance-level review costs more analysis than a single category verdict.

Check the audit image before blaming the gate. If DOGMAMaskAuditViewV566's sheet shows scattered islands on unrelated surfaces, the VLM is right to fail you, and no amount of prompt tweaking will help. That's a detection problem: raise the SAM threshold, or use the v56.7 guard and search nodes instead.

CategoryDOGMA/v56.6

Inputs (4)

NameTypeDefaultDescription
masksMASK
audit_textSTRING
categorySTRING
geometry_reportSTRING

Outputs (2)

NameTypeDescription
approved_masksMASK
reportSTRING