Nodes/DOGMA Nodes/DOGMA FinalMasks v56.7
ComfyUI Node

DOGMA FinalMasks v56.7

The node that refuses to hand you an empty mask

By axior·Created 4 months ago·Updated 3 days ago· 1
DOGMA FinalMasks v56.7
  • review
  • approved_instances
  • report

End of the audit chain: the review bundle goes in, one stacked mask tensor and a report come out - or the run stops with an error that tells you which category failed. That second behaviour is the interesting one.

Why it exists

A mask-based pipeline has one failure mode that ruins everything downstream: silence. The detector found nothing, the VLM rejected everything, a category got eaten by ownership arbitration - and instead of complaining, the graph hands an empty mask to the sampler, which happily denoises nothing, and you get an image back that looks like the pass ran. Ten minutes of compute later you're diffing two PNGs to find out whether anything happened.

The DOGMA author's whole v56.7 phase-3 pass is built against that. This node is where the refusal lands:

DOGMA: category "vehicles" has no verified mask after global AND local recovery.
Restoration stopped before diffusion, rather than silently omitting this category.
See SEARCH / AUDIT previews.

It raises with the tail of the pipeline notes attached - so the error message includes the SAM search report, the per-instance audit verdicts, and whatever the geometry guard complained about. It's the most useful error message in the pack.

How it works

Two inputs' worth of work. finish() takes the DOGMA_REVIEW bundle - category, image shape, accepted items, notes - runs one more deduplication pass over the accepted instances (this time with a ceiling of 256), and stacks the survivors into a single mask tensor:

masks = torch.stack([i['mask'] for i in items]).float() else torch.zeros((0, h, w))

Two things are worth noticing. The dedupe here is the last line of defence: even if the global search and the local recovery pass both approved near-identical masks, the crop-level overlaps get resolved before stacking, and the rule is asymmetric on purpose - a candidate is dropped only if 90% or more of its own area is already covered by something bigger. A small mask sitting inside a big one isn't discarded just for being inside it, which is what stops the local recovery pass from quietly deleting the instances it was added to find.

And the empty case splits on the category: an inactive category (none, unused, n/a, absent) returning zero masks is expected and passes through as an empty tensor, because empty slots are supposed to be empty. A real category with zero verified instances is a hard stop.

Inputs and outputs

  • review - DOGMA_REVIEW, from DOGMAInstanceReviewV567. One bundle, one category.
  • approved_instances - MASK, one mask per verified instance, stacked along the batch axis.
  • report - a two-line-plus-notes STRING: how many instances survived, then the accumulated pipeline notes.

Wire approved_instances onward into the ownership arbitration (DOGMAMaskOwnershipV567) or straight into the mask-splitting step - and feed the report into DOGMAImageAfterAuditV567 if you want the audit to gate the diffusion pass. The masks it emits are already exact-ownership, no dilation, no hole filling; the fattened sampling mask is DOGMADualMaskV566's job, not this node's.

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, then load a current DOGMA workflow - the v56.7 nodes are an opt-in set added in pack 1.0.5/1.0.6 and only the shipped graphs wire them together properly. The README's standing advice is to update via Manager and use the newest workflow version. This node doesn't download models; the SAM 3 and VLM ends of the pipeline are yours to supply.

Gotchas

A legitimately absent category will stop your run. That's the point, but it means "this street has no vehicles today" is an error state rather than a no-op. Resolve it the way the design intends: mark the slot inactive upstream so the category canonicalises to something in the inactive set, or change the planner's output.

The error only fires when the category isn't inactive. If a slot's category string is empty, this node won't complain - and if it's empty because you expected the planner to fill it and the planner was fed nothing usable, you get an empty mask and no error. When a repair pass seems to do nothing, read the planner's preview first, then this node's report.

The report is long. It's the accumulated notes from both search passes, every per-instance verdict, and the arbitration lines. In a 40-instance category that's a lot of text going through a STRING socket - fine, but don't wire it into a node that logs to the console unless you want a wall of text per run.

CategoryDOGMA/v56.7

Inputs (1)

NameTypeDefaultDescription
reviewDOGMA_REVIEW

Outputs (2)

NameTypeDescription
approved_instancesMASK
reportSTRING