Nodes/DOGMA Nodes/DOGMA FinalMasksBounded v2
ComfyUI Node

DOGMA FinalMasksBounded v2

The v2 end-cap that turns a review into at most 32 renderable masks

By axior·Created 6 months ago·Updated 16 days ago· 2
DOGMA FinalMasksBounded v2
  • review
  • approved_instances
  • report

What it is

The v2 family's terminal mask node: one DOGMA_REVIEW in, one mask batch and a report out. It's the same job as DOGMAFinalCoverageV110 (convert audited instances into masks you can render), with a tighter instance cap and a shorter report - 32 instances instead of 64, and no coverage percentage.

The name is the tell. Bounded is the design principle of the whole v2 node set: every stage has a hard numeric ceiling so a scene full of good detections can't turn into a 40-minute VAE encode or an out-of-memory crash three nodes later. The sibling search node in v2 is called DOGMASAMSearchBoundedV2 for the same reason, and it carries an explicit detection budget across two passes.

What it does with the review

It takes the review's accepted list and runs the shared bounded_instances helper:

  1. Rank by score * sqrt(area) - the small multiplier on area means a confident medium object beats an unconfident large one, which is usually what you want when the cap is going to bite.
  2. De-duplicate by containment. If 90% or more of a candidate's area already sits inside a mask you've kept, it's dropped. Containment rather than box IoU, because these are masks and a small mask inside a big one is a duplicate regardless of what the boxes did.
  3. Cap at 32 and stop. No warning, no exception. Anything past the cap is silently not rendered.

Then it stacks whatever survived into a MASK batch and writes a summary line - person: 14 verified masks. Sometimes followed by the thing you actually need to read: No verified candidate: category skipped, source pixels preserved. An empty result gives you a (0, H, W) tensor, so an empty category doesn't break the graph; it just means this region stays exactly as the source had it.

Inputs and outputs

  • review (DOGMA_REVIEW) - from a review node in the matching chain. This is the only input, and there's nothing to tune; the limit is in the code.
  • approved_instances (MASK) - up to 32 masks, one per instance. This is the wire that goes into your crop/render branch.
  • report (STRING) - count summary plus the accumulated notes from the search and audit stages, which is where the reason for a surprising count lives.

Which finalizer should you use?

There are four of these in the pack now, and the difference is almost entirely about which chain you're in:

| Node | Instance cap | Extras | |---|---|---| | DOGMAFinalMasksBoundedV2 | 32 | v2 baseline, short report | | DOGMAFinalCoverageV110 | 64 | adds union coverage % | | DOGMAFinalMasksV109 | 32 | strips internal state from the report, delegates here | | DOGMAFinalCleanMasksV111 | 64 | adds optional micro-hole repair, delegates to v1.0.10's node |

So: if you're on a v2-era workflow, this is the one wired in and it's fine as-is. If you want the coverage number, use the v1.0.10 node - it's a superset. If your masks have pinholes that show up as speckle in the final render, DOGMAFinalCleanMasksV111 is the one with the repair pass. All four produce a mask batch with the same semantics, so swapping them inside a saved workflow is a one-link change.

One real gotcha when you swap: the caps are silent. Moving from a v1.0.10 chain (64) to a v2 chain (32) on a busy scene can quietly halve your rendered instances, and nothing in the graph tells you. Check the count in the report after the swap, and if you're hitting 32 exactly, that's your signal.

Install

Manager → search DOGMA Nodes, or:

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

scipy>=1.10 from requirements.txt is the only Python dependency, and there are no model downloads - this pack is pure tensor and image plumbing over models you install yourself. Note the internal dependency direction, because it explains an error message you might see: the v2 nodes and the 1.0.9/1.0.11 nodes look each other up by class name in ComfyUI's registry, and a missing one raises DOGMA v2 requires the existing node pack containing <name>. That's not a version conflict to solve - it means a file from the pack didn't import, which in practice is nearly always the missing SciPy install.

CategoryDOGMA/v2

Inputs (1)

NameTypeDefaultDescription
reviewDOGMA_REVIEW—

Outputs (2)

NameTypeDescription
approved_instancesMASK—
reportSTRING—