Nodes/DOGMA Nodes/DOGMA v35.4 Four-Sector Mask Summary
ComfyUI Node

DOGMA v35.4 Four-Sector Mask Summary

Same cleanup, one more slot

By axior·Created 4 months ago·Updated 3 days ago· 1
DOGMA v35.4 Four-Sector Mask Summary
  • mask_1
  • mask_2
  • mask_3
  • mask_4
  • mask_1
  • mask_2
  • mask_3
  • mask_4
  • summary
category_1
category_2
category_3
category_4

If you've read the v26 three-sector node, you know this one: it takes masks from your segmentation passes, makes them agree on size and layout, empties the inactive ones, and hands them back with a report. The only difference is the count - four sectors instead of three.

What it does, per mask

For each of mask_1mask_4 paired with category_1category_4:

  • a bare 2-D mask gets a batch dimension; a multi-layer mask is unioned with a max, not averaged;
  • if its dimensions don't match the largest canvas among the four, it's bilinearly resized to match;
  • if the paired category is empty or reads none, __none__ or unused, the mask is replaced with zeros - inactive slots are inert by design, so a planner falling through to "no target here" can't accidentally mask the whole frame;
  • values are clamped to 0–1;
  • coverage (percentage of pixels above 0.5) is measured for the summary.

Outputs: mask_1mask_4 plus summary. There are no knobs - no threshold, no mode, no priority order. Sixteen inputs and outputs' worth of wiring, and the node does one thing with them.

The one behavioural difference from v26, beyond the extra slot: the summary lines are terse. v26's report appends preserve all existing instances to each line; this one just gives you sector N: category | mask coverage X%. Same information you actually need, less editorialising.

Why the count matters

The pack's node names carry the version arithmetic, and it's worth knowing where v35.4 sits: this generation of the pipeline ran four local sectors on top of a global base pass, and the masks feed a kind-aware crop stage that treats objects, structures and surfaces differently. A four-sector plan usually means objects got the local repair slots while the broad stuff - sky, road, buildings - went to the base pass, which is the same division of labour DOGMAScenePlanSlots reaches with a different mechanism.

If your planner emits three targets, use DOGMASectorMasksV26. If it emits four (or emits six and you're only running the first four locally), use this. They're interchangeable in role and identical in behaviour; mixing them up costs you a widget's worth of confusion and nothing else.

Keeping overlaps

Like its sibling, this node deliberately does no cross-category erasure - overlapping masks stay overlapping. The rationale is the same one that shows up across the pack: exclusive masks look tidy until a car's mirror overlaps a pedestrian and the repair has a chunk missing. Spatial de-overlapping is the crop node's job, where it can be done with non-overlapping ownership windows instead of by punching holes in your data.

Install

ComfyUI Manager → search DOGMA Nodes → install → full restart. Or:

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

No Python dependencies at all (requirements.txt is literally "No external dependencies") and no model files. It lives under DOGMA/Semantic Detailer. What it needs to be useful is elsewhere in your install: a promptable segmenter producing the four masks - SAM 3 is the community default in 2026, with the caveat that some SAM 3 node packs want Triton - and a planner producing the four category strings.

DOGMA Nodes comes from axior, the studio half of a Milan production team that runs commercial AI work through heavy ComfyUI masking pipelines. Studio tooling, straight up: a node whose entire job is "make the inputs sane and tell me what you got".

Troubleshooting

Everything resizes and something drifts. The target canvas is the maximum height and width across the four masks - not the image's dimensions. If your masks are all different sizes, one gets upscaled and another downscaled, and registration error creeps in. Feed it masks that already match the master where you can.

An empty sector. Read the summary: if it says coverage 0.00% and the category is none, it's the zeroing rule working. If the category looks right and coverage is still zero, your segmenter returned nothing for that prompt - try the prompt string from a different planner generation, they calibrate differently.

Four masks, one image, weird crop math. Check the lengths of your lists after this node. Crop nodes iterate in parallel, and a mask sneaking in at the wrong resolution shows up as a region that's subtly off rather than an error.

CategoryDOGMA/Semantic Detailer

Inputs (8)

NameTypeDefaultDescription
mask_1MASK
category_1STRING
mask_2MASK
category_2STRING
mask_3MASK
category_3STRING
mask_4MASK
category_4STRING

Outputs (5)

NameTypeDescription
mask_1MASK
mask_2MASK
mask_3MASK
mask_4MASK
summarySTRING