DOGMA Protect Semantic Masks v21
Same protections, fewer surprises
- 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
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.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| mask_1 | MASK | — | |
| category_1 | STRING | — | |
| mask_2 | MASK | — | |
| category_2 | STRING | — | |
| mask_3 | MASK | — | |
| category_3 | STRING | — | |
| mask_4 | MASK | — | |
| category_4 | STRING | — | |
| mask_5 | MASK | — | |
| category_5 | STRING | — | |
| mask_6 | MASK | — | |
| category_6 | STRING | — | |
| protect_radius | INT | 120–96 | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| mask_1 | MASK | — |
| mask_2 | MASK | — |
| mask_3 | MASK | — |
| mask_4 | MASK | — |
| mask_5 | MASK | — |
| mask_6 | MASK | — |
| summary | STRING | — |