Nodes/DOGMA Nodes/DOGMA v54.2 Opaque-Core Generation Mask
ComfyUI Node

DOGMA v54.2 Opaque-Core Generation Mask

The mask was see-through

By axior·Created 4 months ago·Updated 3 days ago· 1
DOGMA v54.2 Opaque-Core Generation Mask
  • latent
  • mask
  • latent
  • info

There's a specific kind of disappointment in local repair where you set denoise to 0.30, run the pass, and get back… roughly what you started with, only slightly softer. You check the prompt, you check the mask, everything looks right. The problem is usually the mask's values, not its shape - it's translucent across the whole object, so the sampler is only partially re-rendering it everywhere.

DOGMAMaskedLatentV542 is the fix, and its subtitle says it: Opaque-Core Generation Mask.

The mechanism

Same two inputs as the v40 version - latent and mask - but it builds the generation mask the other way round:

  • everything at or above 0.20 in the incoming mask becomes a hard, fully opaque core
  • that core is dilated by 8 pixels, so the model gets a little room to correct wheels, body edges and occlusion just outside the segmentation
  • a short outward feather is generated from the core, and the final mask is max(core, feather × 0.85)

The max is the whole idea. Wherever the core is set, the mask value is 1.0 and stays 1.0 - the feather can only add strength outside the object, never subtract from the middle. So the inside of your selected car is a uniform full-strength region and (per the source's own notes) a denoise of 0.30 is actually applied at 0.30 across the whole thing, instead of being scaled down by a half-transparent mask into "a bit of work in a lot of places".

The output is a copy of the latent with noise_mask set, plus an info string reporting coverage - opaque generation core +8 / outward feather 8 | coverage=…%. Keep an eye on that number. If it's tiny, your mask wasn't there to begin with; if it's most of the frame, one category is about to be re-rendered as if it were the subject.

v40 or v54.2?

Both are legitimate, and they're for different subjects, not different eras of the same subject.

DOGMAMaskedLatentV40 feathered broadly - a 13px dilate followed by two averaging passes - which produces a wide soft gradient. That's kind to surfaces: grass, asphalt, water, foliage, walls, where a fading repair is exactly right and a boundary would be visible.

DOGMAMaskedLatentV542 is for discrete objects - vehicles, people, animals, furniture. Anything with countable identity, a silhouette, and an expectation that when you say "reconstruct only this object" you mean the whole object at full strength. If you've been running the soft mask on cars and wondering why they come back mushy, this is the swap.

Inputs and outputs

latent, mask in; latent, info out. No parameters. It writes into a copy, so nothing upstream is mutated.

Install

ComfyUI Manager → search DOGMA Nodes, or:

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

Restart, then look under DOGMA/v54.2. Zero dependencies - the pack's requirements.txt is a comment and pyproject.toml declares none. No weights either; this node operates on tensors between your VAE and your sampler.

Where it bites

The 0.20 threshold is worth knowing about. Anything above 0.20 in your incoming mask counts as "core", which is generous - a soft SAM edge or a lightly blurred mask will get promoted to opaque well outside the object's true boundary. That's intentional (the author wants a stable semantic body, not a faithful one) but it means a sloppy mask doesn't get penalised here, it gets amplified. If you've been leaning on mask blur to hide a bad segmentation, this node will gently tell you.

The hard core also means the stitch matters more, not less. Generation side and stitch side are two different masks in this pack's design: an opaque core here, and a kind-aware feather at the stitch (DOGMARegionStitchV542 uses a slightly expanded opaque core with only a few pixels of feather outside it). If you keep the soft stitch from an earlier version while running this on the generation side, you'll get a hard repair edge sitting under a wide translucent blend, which reads as a faint halo.

And one thing this can't fix: if your local pass is running at a denoise high enough to invent, an opaque core just means it invents confidently. Match the denoise to the category - around 0.30 for objects, much lower for surfaces - and let the mask do its job.

CategoryDOGMA/v54.2

Inputs (2)

NameTypeDefaultDescription
latentLATENT
maskMASK

Outputs (2)

NameTypeDescription
latentLATENT
infoSTRING