Nodes/DOGMA Nodes/DOGMA Protect Semantic Masks v21
ComfyUI Node

DOGMA Protect Semantic Masks v21

Same protections, fewer surprises

By axior·Created 4 months ago·Updated 3 days ago· 1
DOGMA Protect Semantic Masks v21
  • mask_1
  • mask_2
  • mask_3
  • mask_4
  • mask_5
  • mask_6
  • mask_1
  • mask_2
  • mask_3
  • mask_4
  • mask_5
  • mask_6
  • summary
category_1
category_2
category_3
category_4
category_5
category_6
protect_radius12

DOGMAProtectedMasksV21 is the tidy-up of v13. Six masks and six category strings in; six protected masks and a plain-text summary out. Same job - stop surface passes from overlapping discrete objects - with a stricter family classifier and a dial that's harder to misuse.

The classifier is the upgrade that matters. Character-string matching is doing real work in this node, and v21's version is more conservative and more explicit than v13's: it recognises roadway people and sidewalk people as separate families from generic people, it treats signage terms (billboard, rooftop sign, building sign, shop sign, large lettering) as their own family rather than as street objects, and it folds face into the people family. v13's classifier is looser - it will happily call a "person in traffic" label a roadway person, but it also lumps more things into other, where nothing is protected.

What it produces

Family mapping in hand, the node subtracts. Architecture, road, vegetation, sky and water each carry a blocker list; blockers get unioned, max-pool dilated by protect_radius (default 12, range 0–96), and multiplied out of the surface mask. Vehicles, people, signage and street objects come back as plain unions - they're the things being defended, not attacked.

Note the default: 12px, and the ceiling is 96, against v13's 14/128. The author clearly decided the wider range caused more visible holes than it prevented. summary is newline-separated here and reads like a per-slot receipt:

slot 1 road: protected from vehicles, people, street_objects
slot 2 vehicles: unchanged
slot 3 signage: unchanged

That's your debugging surface. When a pass has done nothing, summary usually tells you the mask was all-one inside the protection zone; when a pass has done too much, it tells you a slot got classified as other and skipped protection entirely.

When to reach for this versus v13

They're close enough that it's a coin flip, and both are retired in favour of the v23/v24 pair once you're doing street scenes. Rule of thumb from what actually differs: v21 has the better family vocabulary and the safer radius range, so it's the one to keep in a graph whose categories come from a planner that uses distinct roadway-sidewalk people labels. If your planner emits loose words like "pedestrians" and "signs", both versions behave similarly and protection is mostly driven by the vehicle and person masks.

Install

ComfyUI Manager → search DOGMA Nodes, or:

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

Pure mask arithmetic over PyTorch - no dependencies to install, and nothing to download. The pack README doesn't document the semantic nodes at all, so the summary output and protect_radius are the whole user interface.

Gotchas

It won't save you from a bad road mask. The node subtracts; it doesn't repair. If SAM's road region doesn't cover the sidewalk, no protection setting will stop the road pass from missing half the scene.

Masks get resized to the largest one in the set. Feed it masks from two different SAM runs at different aspect ratios and you'll silently stretch one. All six should come from the same segmentation pass.

Six is the limit. There's no seventh slot. If you need more categories than six, batch the pipeline or split the scene - the pack's whole slot layout is six-wide, from the planner down to the settings nodes.

CategoryDOGMA/Semantic Detailer

Inputs (13)

NameTypeDefaultDescription
mask_1MASK
category_1STRING
mask_2MASK
category_2STRING
mask_3MASK
category_3STRING
mask_4MASK
category_4STRING
mask_5MASK
category_5STRING
mask_6MASK
category_6STRING
protect_radiusINT120–96

Outputs (7)

NameTypeDescription
mask_1MASK
mask_2MASK
mask_3MASK
mask_4MASK
mask_5MASK
mask_6MASK
summarySTRING