DOGMA v35 Exact-Core Stitch
Full-strength core, dialled-back feather
- base_image
- patches
- masks
- stitch
- image
Every stitch node in this pack answers the same question - how much of the generated crop do I actually paste - and this one answers it with a split. The middle of the mask goes in at 100%, no matter what you set. The feathered edge is the only part the strength dial touches.
Why you'd want that
The knob people usually want is "less confident, please." You sampled a crop, it came back slightly different in tone, and you'd like to blend it in gently. But on a normal stitch, turning strength down to 0.3 means you also blend the middle of the mask at 30% - and the middle is the part you were trying to fix. The car with the fused wheels stays 70% fused.
Splitting the alpha solves it. Inside the core, the generated pixels win outright; in the feather, you get the ramp you asked for. The docstring states the other half of the guarantee too: no generated pixels appear outside the outward feather. Combined with the fact that the node never passes the base image through a VAE, that's the "unmasked pixels must be untouched" property that makes masked inpainting worth keeping in 2026 at all - an instruction-editing model re-encodes the whole frame, and unmasked drift compounds over a chain of edits.
The mechanism, exactly
For each crop entry:
- Resample the patch to the recorded rectangle (bicubic, antialiased) and the mask to the same size (bilinear).
core = (mask >= 0.999),feather = mask - core.alpha = clamp(core + feather * strength, 0, 1).- Composite:
patch * alpha + region * (1 - alpha).
So the only thing strength does is scale the soft rim. 0.0 gives you a hard-edged paste of the solid core and nothing else - which, if your mask's feather came from a dilate-plus-blur mask node, is a perfectly sane setting. 1.0 is a straight masked composite.
There is no colour matching and no global correction, deliberately. Colour drift is a symptom of a VAE round-trip or a mismatched checkpoint, and patching the symptom by shifting the tile's mean moves the error rather than removing it.
Inputs and outputs
- base_image (
IMAGE) - your master. The node clonesbase_image[0], so it's one image, not a batch. - patches (
IMAGE, list) - the sampled crops, institchorder. - masks (
MASK, list) - one per patch, same order. - stitch (
DOGMA_STITCH, list) - the geometry entries a crop node produced.DOGMAClusteredMaskCropsemits exactly this. - strength (
FLOAT, default 1.0, 0–1, step 0.01) - feather weight only.
One output: image (IMAGE). Wire it into a preview or an image-list-to-batch node if you've been working in lists.
The node is INPUT_IS_LIST=True and iterates min() of the three list lengths, so mismatched lists truncate in silence. Count first, debug later.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
Or ComfyUI Manager, searching DOGMA Nodes - it's in the Comfy registry as comfyui-dogma-nodes, so comfy node install comfyui-dogma-nodes also works. The pack has no Python dependencies: requirements.txt is a comment line, pyproject.toml declares dependencies = [], and the imports are torch, numpy and comfy.utils. Nothing to download, MIT licensed, and it doesn't care which model produced your patches.
Where people get burned
The >= 0.999 threshold is stricter than it looks. A mask that came out of a bilinear resample, a soft SAM head, or any blur pass may never actually reach 1.0 anywhere - in which case your "core" is empty, everything is feather, and strength behaves like a normal global opacity dial. Same symptom, different cause, and the fix is upstream: run the mask through a hard threshold (or a mask-builder node that produces an opaque core) before the stitch. DOGMAFastDualMaskV34 exists for this and its docstring says so - "opaque core feathered stitch mask."
Second: this is v35 in a pack that keeps superseding itself. The v10 sibling applies strength uniformly; v39's DOGMADetailBandStitchV39 takes the same four inputs plus four strength/drift dials and merges frequency bands instead of doing a straight paste. If you want a fast, predictable, one-number stitch, this is the one. If you want the generated tile's texture without letting it move your low-frequency geometry, that's the v39 one.
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 | — |