Nodes/DOGMA Nodes/DOGMA Protected Masks v24
ComfyUI Node

DOGMA Protected Masks v24

Text is protection-only, and everything gets out of its way

By axior·Created 4 months ago·Updated 3 days ago· 1
DOGMA Protected Masks v24
  • 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_radius20

DOGMAProtectedMasksV24 is where the pack's rules about text finally become structural instead of just prompting. Every generative pass in DOGMA carries a text lock in its instruction - don't rewrite lettering, don't invent glyphs. v24 takes the same promise and enforces it on the pixels: the signage mask is protection-only, and it gets subtracted from every repair mask in the graph.

The three rules

Inputs are the familiar mask_1mask_6 with their matching category_1category_6, plus protect_radius (default 20, hard ceiling 96). All masks are unioned and normalised to a shared resolution, then classified by family. Then:

Road is support-only. It comes out unchanged and is never generated. Same rule as v23.

Roadway people = people ∩ dilated road, minus text. The person mask is intersected with the road mask dilated by protect_radius, so people actually on asphalt are separated from people on pavement. Then the signage mask - dilated by half that radius - is subtracted from the result.

Ordinary people lose both the road users and the text. The people output is mask × (1 − road_block) × (1 − sign_block), with road_block a slightly tighter dilation of the roadway set.

Everything else loses the text too. Vehicles, street furniture, architecture, animals, furniture, clothing, machinery - any non-road, non-signage family gets (mask × (1 − sign_block)). Signs and shop lettering sit on walls, on poles, on vans; a van mask that includes the decal on its side is a mask that will be repainted by a model that can't spell.

A slot with no category maps to family none and comes out as a zero mask. summary prints the whole decision per slot: slot 5: signage PROTECTION ONLY, slot 4: people exclude roadway-person + text regions, slot 7… well, there is no slot 7.

Why this exists

Remember what FLUX.2 Klein is: an LLM-encoded instruction editor. When you run a local crop pass over a shopfront, the lettering in that crop is a legitimate target for the model, and models are terrible at lettering - they'll happily respell a shop name into something almost-right, which is the single most obvious tell of an AI restoration. The pack's answer is defence in depth: locked language in the prompt, a rejection filter on destructive phrasing, and here, a mask that simply doesn't include the glyphs. If the pass never touches those pixels, no prompt has to hold the line.

Install

ComfyUI Manager → search DOGMA Nodes, or:

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

No extra Python dependencies, nothing to download. The README covers the WAN VACE and sampler nodes only, so this node's behaviour is documented by its summary output and nothing else.

Gotchas

Signage has to be one of your six categories. If your planner never emits a signage slot, sign_block is all zeros and the text protection silently doesn't exist. Keep some signage-ish label in the inventory - "signage", "shop sign", "lettering", "billboard" all classify.

Signage subtractions punch holes in objects. Because the sign block is dilated out of every other mask, a shop sign inside a building mask leaves a hole, and your architecture pass will leave that area unrepaired. That's the intent - but if the sign mask is sloppy and covers half a wall, you'll see a hard-edged untouched rectangle in a repaired façade.

protect_radius scales two different dilations. The road dilation is full radius; the text dilation is half. Turning the dial up widens both. 20 is the default for a reason - the author tightened it from v23's 24 precisely because aggressive protection shows as visible unrepaired regions.

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_radiusINT200–96

Outputs (7)

NameTypeDescription
mask_1MASK
mask_2MASK
mask_3MASK
mask_4MASK
mask_5MASK
mask_6MASK
summarySTRING