Nodes/DOGMA Nodes/DOGMA v39 Multiband Detail Stitch
ComfyUI Node

DOGMA v39 Multiband Detail Stitch

Take the texture, keep your geometry

By axior·Created 4 months ago·Updated 3 days ago· 1
DOGMA v39 Multiband Detail Stitch
  • base_image
  • patches
  • masks
  • stitch
  • image
  • info
mid_strength0.28
detail_strength0.88
drift_start0.04
drift_end0.10

Here's the thing nobody warns you about with crop-and-stitch: a patch that looks great in isolation can be a worse global image than the tile it replaces. The model had 2K pixels to spend on a car and it spent them. But it also re-decided where the car sits, how bright the tarmac is around it, and which way the shadow falls. Paste it in and the local detail is better while the frame is subtly wrong.

This node is the fix for the part where you want the detail and not the decisions. It splits both the base region and the generated patch into frequency bands, keeps the base's low frequencies wholesale, and dials in the patch's mid and high bands by separate amounts.

How it works

For each crop:

  1. Downscale to 1/16 and back up - that's the low band. The same at 1/4 gives a mid-reference, so mid = quarter − sixteenth and high = original − quarter.
  2. Rebuild the candidate as low_base + mix(mid_base, mid_patch, mid_strength) + mix(high_base, high_patch, detail_strength).

The low band comes from the base and only the base. That's the "master low-frequency geometry retained" line in the info output, and it's the entire reason to use this over a straight paste: brightness, colour, gross placement and soft gradients can't drift, because they were never taken from the patch.

Defaults tell you the intent: mid_strength 0.28 (mostly keep the master's mid-tones) and detail_strength 0.88 (mostly take the patch's fine detail). That's a very conservative seam in the middle bands and an aggressive one in the top band - fine for a repair pass, and it's exactly the shape of "add texture, don't restage the scene."

The last piece is a guard. The node measures how far the patch's low band has drifted from the base's, and scales the mask down as that drift grows: guard = 0.05 + 0.95 × (1 − clamp((drift − drift_start) / (drift_end − drift_start))). With the defaults (drift_start 0.035, drift_end 0.105), a patch that has decided your image is now brighter gets mostly rejected, and the info line records how many crops were injected.

Inputs and outputs

base_image (IMAGE, the master), patches (IMAGE, list), masks (MASK, list), stitch (DOGMA_STITCH, list) - the standard four, all in list plumbing, same order, min() of the lengths. Then mid_strength, detail_strength, drift_start, drift_end.

Outputs image (IMAGE) and info (STRING). The info string is short and worth reading: v39 multiband: N crop(s) injected; master low-frequency geometry retained. If N is zero, the drift guard ate everything and you should be looking at your prompt or your denoise rather than at the stitch.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes

Manager → DOGMA Nodes, or comfy node install comfyui-dogma-nodes. There's no dependency step and nothing to download: requirements.txt in the repo is a single comment, pyproject.toml declares dependencies = [], and the node needs torch plus the image list coming out of a DOGMA crop node. MIT.

Where people get burned

detail_strength above 1.0 is allowed on purpose. The range goes to 1.2, which means you can over-add the patch's high band - a sharpening-ish move for soft, upscaled sources. It's a real tool and it's also how you get halos, so use it as the last 10% of a tuning pass, not the first.

Feed it the right mask. You want the feathered stitch mask, not the wide generation mask. DOGMAFastDualMaskV34 outputs both, and handing it the generation mask puts the blend boundary somewhere you didn't choose.

It's still doing a frequency split, so mismatched scales show up as ringing. If your stitch geometry came from a crop node working on a different resolution than base_image, the patch lands distorted and the drift guard may or may not save you. The info count from the crop node and the resolution you pass here should agree.

And the pack-honesty note: no README entry, DOGMA/v39 category alongside other v39 nodes, and four earlier stitch nodes still registered. This one is the sophisticated end of the family; the cost is that you now have four numbers to reason about instead of one.

CategoryDOGMA/v39

Inputs (8)

NameTypeDefaultDescription
base_imageIMAGE
patchesIMAGE
masksMASK
stitchDOGMA_STITCH
mid_strengthFLOAT0.280–1
detail_strengthFLOAT0.880–1.2
drift_startFLOAT0.040–0.3
drift_endFLOAT0.100.01–0.5

Outputs (2)

NameTypeDescription
imageIMAGE
infoSTRING