DOGMA Stitch Crops
The plain paste-back, and the seam controls that actually matter
- base_image
- patches
- masks
- stitch
- image
What it is
The last step of a crop-and-render loop: take the original image, take the re-rendered region patches, and blend them back into place using the coordinates the crop node recorded. DOGMAStitchCrops is the straightforward version of that - a per-region alpha composite with a single strength multiplier. No feathering, no frequency analysis, no gates.
If you've built the classic ComfyUI "crop → edit → paste" workflow with a paste node and a blurred mask, this is the same thing with the DOGMA metadata contract attached: the crop nodes in this pack emit a DOGMA_STITCH list, and this node is the consumer.
How it works
Every input is list-mode (INPUT_IS_LIST = True), because this node exists to iterate a batch of regions.
The base image is cloned once. Then for each index up to min(len(patches), len(masks), len(stitch)):
- Skip anything with
noopset in its metadata - that's the crop node's "this category found nothing, do nothing" path, and skipping it is what makes an empty sector harmless. - Resize the patch to the recorded region size if it doesn't match, bicubic, using only the first three channels.
- Resize the mask to the region, bilinear, clamp to 0–1, multiply by
mask_strength, and expand to three channels. - Composite:
patch * mask + region * (1 - mask).
The region is trimmed if the recorded rectangle runs past the canvas edge, and the patch and mask are trimmed to match, so a crop at the boundary can't push the write out of bounds.
Because the blend is a straight linear mask multiply, the mask you feed it is your seam control. A hard-edged mask gives you a hard seam. A mask that's been blurred a little gives you a soft transition. The KB's inpainting notes put the usual number on it: 4–12px of blur at the mask edge is typical, too little shows the seam, too much bleeds the change into the surrounding pixels. Since these masks arrive from a crop node at model resolution, they're already blurred by the resize chain - which is often enough, and is why this node doesn't add its own feather.
Inputs and outputs
base_image- the master you're pasting onto. If a list arrives, the first entry is used.patches- the re-rendered regions, one per crop, in crop order.masks- the crop masks, same order.stitch- theDOGMA_STITCHmetadata list from the crop node.mask_strength- FLOAT 0.0–1.0, default 1.0. Scales the whole mask. Drop it to 0.7–0.8 when a region's result is close but slightly overcooked; it dials the change back without a re-render, which is the cheapest fix in this whole pipeline.
One output: image. Wire it to your preview or save node and it's done.
Install
ComfyUI Manager → DOGMA Nodes, or:
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
# restart ComfyUI
No external dependencies - the repo's requirements.txt is a comment and everything here is PyTorch. No models, no keys.
Gotchas
- List order is the contract. Patches, masks and stitch entries are matched by index, not by ID. If any node in the middle of your graph re-orders, filters or drops items, everything downstream is composited into the wrong place with no error at all.
min()truncation is silent. Extra patches beyond the shortest input are ignored, no warning.- Send a single image where a list belongs and you'll get a crash or a wrong-shape blend, not a helpful message. This node expects the crop node's list outputs exclusively.
- The pack has no community footprint - zero reddit threads name it - and the README covers the WAN VACE prep nodes and DOGMA samplers rather than the semantic detailer. Stitching nodes are where silent misalignment lives, so verify on a single region before running the full grid.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| base_image | IMAGE | — | |
| patches | IMAGE | — | |
| masks | MASK | — | |
| stitch | DOGMA_STITCH | — | |
| mask_strength | FLOAT | 1.000–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |