DOGMARegionStitchV543
Pasting the repair back without a halo
- base_image
- patches
- masks
- stitch
- image
- info
Every crop-and-repair loop ends with the same awkward step. You cut a region out of a big image, let a model repaint it at a resolution where it can actually resolve detail, and now you have to put it back. Do it naively and you get the classic detailing tell: a faint rectangular patch with a soft or hard edge where the repair meets the original.
Region Stitch v54.4 is DOGMA's answer. It is the last node in the pack's semantic-detailer chain, and its whole job is to make the pasted pixel ramp live inside the area the model actually generated.
What it does, mechanically
You feed it the untouched master and three parallel lists: the repaired patches, their masks, and the DOGMA_STITCH metadata that the crop node handed out. That metadata is a small dict per region carrying x, y, width, height and a noop flag, which is why this node is a list node (INPUT_IS_LIST) - it exists to iterate, not to be used once.
For each region it:
- trims the alignment padding recorded in the metadata (
pad_right,pad_bottom), - resizes the patch back to the recorded region size with bicubic + antialias if the model returned something else (the
infooutput tells you how many were native and how many were resized back), - binarizes the generation mask at 0.50, erodes it by a feather radius, then blurs that eroded core back toward the generation edge and takes the max of the two. The result is a 1→0 ramp that never touches ungenerated pixels. Feather is 10px for
STRUCTURE/SURFACEand 5px for everything else; alpha is exactly zero outside the generation mask.
That last sentence is the point. Most stitch nodes feather across the boundary, which means the outer edge of your repair is blended with original pixels and the object goes semi-transparent at its rim. Here the object stays fully opaque and the softening happens on generated pixels only.
Inputs and outputs that matter
Forget tuning - there is nothing to tune. base_image takes your master, patches / masks / stitch take the crop node's list outputs in the same order, and category / kind are forwarded from the planner (they land in the info string, and kind picks the feather width). Outputs are image and info. Wire image into your save/preview; read info when something looks wrong, because it reports region count, feather, and whether patches came back native or resized.
Install
ComfyUI Manager → search DOGMA Nodes → install → full restart (not just a refresh; the node classes are registered at import). Or:
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
comfy node install comfyui-dogma-nodes also works. The pack ships zero Python dependencies - requirements.txt literally says "No external dependencies" - so if install breaks, it is not a pip problem. There are no model files to download for this node; it is pure tensor compositing.
You will need the rest of the chain to be useful: a SAM-style segmenter to make the masks, a crop node to produce the DOGMA_STITCH payload, and an instruction-edit model (Klein, Qwen-Edit - whatever you run) for the actual repair. Note that the pack's README documents only its WAN VACE and sampler nodes; these semantic nodes are shipped, registered, and undocumented, so the string outputs are your manual.
Where people get bitten
Mismatched list lengths. The loop runs min(len(patches), len(masks), len(stitch)), so a shorter list silently truncates the job. If half your regions are missing from the composite, count your lists before you blame the math.
Feeding a blend mask instead of a generation mask. Alpha is derived by thresholding at 0.5, so a heavily feathered mask reads as a larger generation area, and the feather gets applied to pixels the model never touched. Feed it the hard inpaint mask.
Expecting color alignment. This node does not do the small DC colour correction that its sibling DOGMASafeMaskedStitchV34 does. If your patch comes back a hair cooler or darker, you will see a faint rectangle even with a perfect alpha ramp. That is the trade: v54.4 favours a clean geometric edge, v34 favours a matched tone.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| base_image | IMAGE | — | |
| patches | IMAGE | — | |
| masks | MASK | — | |
| stitch | DOGMA_STITCH | — | |
| category | STRING | — | |
| kind | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| info | STRING | — |