DOGMA Safe Masked Stitch v34 — Opaque Core
Paste the repair back with an opaque core
- base_image
- patches
- masks
- stitch
- image
Compositing a repaired crop back into a big image has two failure modes, and they fight each other. Feather the seam properly and the middle of your repair gets diluted by original pixels - a face comes back semi-transparent, or a car looks ghosted. Skip the feather and you get a visible rectangle.
Safe Masked Stitch v34's whole design is one rule: the semantic core is 100% edited patch; the strength dial only affects the feather.
How it works, step by step
It's a list node (INPUT_IS_LIST), so it takes the base image plus parallel lists of patches, masks and DOGMA_STITCH metadata - the same contract as DOGMARegionStitchV543 - and iterates. For each region:
- Reads the destination rectangle (
x,y,width,height) from the metadata, skipping any region flagged as a no-op. - Resizes the patch to the region with bicubic + antialias, and the mask with bilinear.
- Computes a DC colour offset using only the pixels where the mask is below 0.02 - i.e. the untouched context around the repair - averages the per-channel difference, clamps it to ±0.05, and subtracts it from the patch. That's a small colour/tone match, deliberately tiny so it can't wreck the patch.
- Splits the mask into a hard core (
m >= 0.999→ alpha 1.0) and a feather (the rest). Final alpha iscore + feather * strength.
So at strength = 0.0 you get a hard-edged paste of exactly the mask core; at 1.0 you get the mask's own falloff. The core - the object itself - is never blended, at any setting.
Inputs and outputs
base_image, patches, masks, stitch and strength (FLOAT, default 1.0, 0–1). One output: image. There's no info string here, so if something looks wrong you get to debug it by eye - that's the cost of the simpler sibling. If base_image is empty it raises DOGMA Safe Masked Stitch v34 received no base image, which is the one error message worth recognising: it means the wire feeding the master never produced a frame.
strength is the only dial, and thinking of it as "blend amount" instead of "feather width" is the fastest way to be confused. Half-strength does not make the repair half-visible; it makes the edge twice as soft.
Which stitcher do you want?
The pack ships two, and they're not versions of each other:
- v34 (this one) - colour-aligns the patch from surrounding context, opaque core, one strength dial. Better when your repaired patch comes back with even a slight tone shift, e.g. after a VAE round-trip on a tiled pass.
DOGMARegionStitchV543- no colour matching, but a kind-aware feather (10px forSTRUCTURE/SURFACE, 5px for objects) and a much more detailed info string.
Reach for v34 on tile/base-pass composites where tone drift is the visible artifact; reach for v543 on object repairs where the edge is the visible artifact.
Install
ComfyUI Manager → search DOGMA Nodes → install → full restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
No Python dependencies to install and no model downloads - it's pure compositing against ComfyUI's own APIs. It registers in DOGMA/Semantic Detailer.
The pack itself is axior's in-house tooling, from the studio half of a Milan production team doing commercial AI work with heavy masked-inpaint chains. That background explains the priorities: the colour clamp is ±0.05 because a studio repair pass must not shift the brand's colours, and the opaque core exists because a half-transparent product is a reshoot.
Where it goes wrong
Mismatched list lengths. The loop stops at the shortest of the three lists. A region that silently drops out of the composite is almost always an empty patch list, not a bad mask.
Feather semantics. If you fed a soft/blurred mask, the "core" is smaller than you think and more of your repair gets blended. This node rewards a hard inpaint mask.
It won't fix geometry. If a patch is misaligned by 20 px, a symmetric feather just spreads the error - you'll see a doubled object rather than a seam. Alignment is the crop node's job; check the crop's info output before blaming the stitch.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| base_image | IMAGE | — | |
| patches | IMAGE | — | |
| masks | MASK | — | |
| stitch | DOGMA_STITCH | — | |
| strength | FLOAT | 1.000–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |