DOGMASoftStitchV545
Feather inward only, so nothing outside the mask can move
- base_image
- patches
- generation_masks
- blend_masks
- stitch
- image
- info
What it is
The careful version of the paste-back. DOGMASoftStitchV545 composites re-rendered regions into a master with a Gaussian feather - but the feather is applied inward only. Its docstring makes a promise you rarely get from a stitch node: "Outside the semantic blend mask the result is mathematically identical to the incoming master."
That's the whole point. A normal paste-back with a feathered mask changes pixels slightly everywhere the mask has a value, including in a soft ring around the region. On a restoration job where most of the frame is already correct, that ring is damage. Here, alpha is literally zero wherever the semantic mask says zero, so untouched areas come through bit-for-bit.
(Note: the docstring and the node category say v56.4 while the class is named V545. Version drift inside a pack that ships every iteration, which is worth knowing before you assume a label tells you what's inside.)
How it works
Two masks, not one. generation_masks is where the model was allowed to work; blend_masks is where you want it composited. From these it builds a seed (blend_mask >= 0.50) and a support region (generation_mask >= 0.40), then:
- Gaussian-blurs the seed. The sigma is chosen from the short side of the region and scaled by
kind-STRUCTUREandSURFACEget 14–42px, everything else gets 8–24px. Larger structures get longer feathers because a 14px ramp on a building edge still reads as a line. - Applies a gamma of 0.8 to the blurred mask, which pushes the ramp outward a little so mid-tones hold.
- Multiplies by the hard seed and the support mask - the inward-only guarantee and a safety clamp, in one expression.
Then it composites each region: region * (1 - alpha) + patch * alpha.
The patch gets resized to the recorded region size in Lanczos via ComfyUI's own common_upscale, falling back to bicubic if that call isn't available. That matters more than it sounds: a region crop that was sampled at 2560px and comes back needing to land on a 2400px window is being resampled, and bicubic here gives you a softer result than you think you're getting. The info string reports how many regions were native versus resized, which is your tell that your crop settings and your stitch target disagree.
Inputs and outputs
All list-mode, matched by index:
base_image- the master.patches- re-rendered regions.generation_masks,blend_masks- the two masks above.stitch- theDOGMA_STITCHmetadata list. It also honours optionalpad_right/pad_bottomentries by trimming the patch before the composite.category,kind-kindis the one that changes behaviour: uppercaseSTRUCTUREorSURFACEselects the wider feather band.categoryis canonicalized and reported in the info line.
Outputs: image and info - the info string gives you category, kind, region count, the sigma range used, and the native/resized tally.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
ComfyUI Manager → DOGMA Nodes also works; it lands under DOGMA/v56.4 rather than the semantic detailer folder. No dependencies (the repo's requirements.txt is literally a comment), no model downloads, no API keys.
Gotchas
- The list-length truncation is silent. The loop runs to
min()of patches, generation masks, blend masks and stitch entries. Feed four of five and you lose a region without a warning. - Inward-only cuts both ways. If your blend mask is tighter than the actual damage, you get a hard step at the mask edge, because there's no outward feather to hide it. If that happens, grow the blend mask, not the sigma.
- The 0.50 and 0.40 thresholds are hard-coded. A very soft mask - say, a heavily blurred SAM output - can fail both and produce no visible change at all, with the info string cheerfully reporting the region as used.
- No tutorials exist for this pack: zero reddit threads name it, and the README skips the whole semantic detailer half. Read the docstring and the source.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| base_image | IMAGE | — | |
| patches | IMAGE | — | |
| generation_masks | MASK | — | |
| blend_masks | MASK | — | |
| stitch | DOGMA_STITCH | — | |
| category | STRING | — | |
| kind | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| info | STRING | — |