Nodes/DOGMA Nodes/DOGMA SelectedMasks8 v1.0.11
ComfyUI Node

DOGMA SelectedMasks8 v1.0.11

Eight category masks, no overlapping claims, one report that explains every skip

By axior·Created 6 months ago·Updated 16 days ago· 2
DOGMA SelectedMasks8 v1.0.11
  • selection
  • mask_1
  • mask_2
  • mask_3
  • mask_4
  • mask_5
  • mask_6
  • mask_7
  • mask_8
  • enabled_1
  • enabled_2
  • enabled_3
  • enabled_4
  • enabled_5
  • enabled_6
  • enabled_7
  • enabled_8
  • ownership_report

Once you have category masks, the question that immediately follows is: what happens where two of them overlap? A person standing in front of a building is in both. If you re-render the building mask with a different prompt than the person mask, one of them is going to eat the other's pixels, and the seam will be in the worst possible place - the silhouette.

SelectedMasks8 v1.0.11 is the node that settles ownership. It takes the pack's interactive category bundle and hands you eight masks plus eight booleans, with every pixel claimed by exactly one category.

How it works

The input is a DOGMA_CATEGORIES bundle - the thing DOGMAChooseCategoriesV111 produces after you've picked which categories to work on (or accepted all of them, which is the auto default). Inside it are the per-slot masks, the category names and the selection.

Then the node sorts categories by a priority ladder and lets the higher-ranked ones claim first:

  1. people
  2. vehicles
  3. everything else
  4. structural categories - buildings, houses, cathedrals, bridges, towers, facades
  5. surfaces - road, ground, pavement, floor, water, grass, vegetation, sky

Each mask is intersected with the negative of everything already claimed, so a populated person mask punches a hole in the building mask beneath it and in the road under that. Instance rows that come out empty are dropped, and each category's remaining masks form the output batch.

Anything you did not select gets an empty mask and its enabled_i flag stays false. That's the whole point of the pair: you can wire mask_i into a regional diffusion or detail path and enabled_i into a switch, so an unselected category doesn't run captions, doesn't run diffusion, and does not claim a single pixel. The pack's 1.0.11 notes are explicit that unselected categories do not claim pixels - you're not going to find your "vehicles" slot mysteriously holding half the street.

The inputs and outputs

One input, seventeen outputs, and that's the correct ratio for this job:

  • selection (DOGMA_CATEGORIES) - the bundle only.
  • mask_1 … mask_8 (MASK) - the per-category masks, ownership resolved, empty if unselected or fully occluded.
  • enabled_1 … enabled_8 (BOOLEAN) - true only when the slot is selected and has surviving pixels. Wire these into your gates.
  • ownership_report (STRING) - one line per slot: render or skip, and the mask count. Read it; it's how you find out that your road mask vanished because the building claimed all of it.

Install

Manager → search DOGMA Nodes, or:

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

Restart. scipy>=1.10 is the pack's only pip dependency and this node needs nothing beyond PyTorch. It does need the upstream trio loaded - a mask builder feeding DOGMAChooseCategoriesV111, which feeds this - all in the same pack, so a full install is the only real requirement.

Where it bites

Mask resolutions must match. If one category's masks came from a different render size you'll get Category mask resolutions differ. and the node stops - which is the right call, and the reason DOGMAScaleFactor v1.0.11 is sitting in the same pack.

Fully-occluded categories are silently skipped, not errored. That's intentional and reported, but it's the kind of thing you only notice from the report - a category that was perfectly valid in the search pass can come out empty here because something with higher priority owns the pixels it found.

Priority is a heuristic, and it will occasionally be wrong for your scene. A car parked inside an archway: the vehicle wins, the building loses that patch. A road with a crowd on it: every person is punched out of the road. For the pack's original use - a street scene where architecture, ground and people each get their own render pass - that ordering is right, and it's why the ladder exists. For an unusual hierarchy you'd be better off with the version that takes explicit category names alongside each mask. One more thing while you're here: the interactive chooser's dialog is partly in Italian ("Fase 3 - scegli le categorie da lavorare"), because this is a real studio's pipeline and the studio is Italian. It works fine; that's just whose tool it is.

CategoryDOGMA/v1.0.11

Inputs (1)

NameTypeDefaultDescription
selectionDOGMA_CATEGORIES—

Outputs (17)

NameTypeDescription
mask_1MASK—
mask_2MASK—
mask_3MASK—
mask_4MASK—
mask_5MASK—
mask_6MASK—
mask_7MASK—
mask_8MASK—
enabled_1BOOLEAN—
enabled_2BOOLEAN—
enabled_3BOOLEAN—
enabled_4BOOLEAN—
enabled_5BOOLEAN—
enabled_6BOOLEAN—
enabled_7BOOLEAN—
enabled_8BOOLEAN—
ownership_reportSTRING—