Nodes/DOGMA Nodes/DOGMA v35 Center-Weighted Tile Combine
ComfyUI Node

DOGMA v35 Center-Weighted Tile Combine

Stop averaging your overlaps into mush

By axior·Created 4 months ago·Updated 3 days ago· 1
DOGMA v35 Center-Weighted Tile Combine
  • images
  • dac_data
  • image
  • info
center_power3.00

If you've ever tiled a big upscale and ended up with soft square patches on the skin, you've met the problem this node exists to solve. The tiles aren't wrong - the blend is. Average two overlapping tiles equally and every seam region becomes a 50/50 ghost of two slightly different textures, which reads as exactly what it is: a grid.

The fix is weighting, not feathering

Most tile combines use a broad Gaussian or a long linear ramp across the whole overlap. That's what gives you the wide soft band: half the overlap is being decided by a tile that has no business there. DOGMA's version makes a much sharper decision - "most of an overlap is decided by the tile whose center is closer, not a broad Gaussian average," per the docstring - and it does it with a cosine ramp that's only applied along edges that actually face another tile.

For each tile: a horizontal and vertical weight ramp (0.5 − 0.5·cos(πt), the classic cosine ease) is applied to the left and top edges only if the tile isn't against the canvas boundary, and mirrored on the right and bottom edges under the same rule. The two ramps multiply into a 2D weight field, that field is raised to center_power, and everything is accumulated into a float canvas with a weight accumulator that gets divided out at the end. So it's a true normalized blend - no darkening at the edges, no dependence on tile order.

center_power is the dial. At 1.0 you get a normal-ish cosine blend. At 3.0 (the default) the nearer centre dominates hard and the overlap crossfades quickly. Higher still and it approaches "nearest tile wins," which is what you want when your tiles are high quality and your only enemy is the seam.

Note the exponent is applied to the weights, not the pixels, and the whole thing runs in float32 before casting back - so this is a cheap node. On a 4-tile grid it's milliseconds.

Inputs and outputs

  • images (IMAGE) - a list of tiles. The node sets INPUT_IS_LIST=True, so a batch from a normal node will not do; you want the tile list coming out of a tiling branch.
  • dac_data (DAC_DATA) - a geometry dict: upscaled canvas width/height, tile size, overlap x/y, grid, tile order. In practice this comes from DOGMAAlignedDacPrepareV35, which is the node in this pack that actually produces DAC_DATA and which also snaps the canvas and strides to multiples of 16 so the latent grids line up across overlaps.
  • center_power (FLOAT, 1.0–8.0, step 0.25).

Outputs: image (IMAGE) - the combined canvas - and info (STRING), which reports the power and the tile count. Trust that count: if it says 4 when you expected 12, your list is short and the bottom of your canvas is empty.

Install

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

Or ComfyUI Manager → DOGMA Nodes; comfy node install comfyui-dogma-nodes also works. No Python dependencies whatsoever - requirements.txt is a comment line, pyproject.toml declares an empty list, and this node is pure tensor arithmetic on top of torch. No models to download. MIT licensed.

Where people get burned

The canvas is sized by dac_data, not by your tiles. If the tiles don't cover it, the weight accumulator stays near zero in the uncovered band and you get black. If a tile extends past it, the node clips the write. Either way the symptom is a colour band, not an error.

Tile order has to match the coordinate list. The node walks coords[:len(images)] and pairs each tile with a position. Feed the tiles in a different order than they were sliced and you get a scrambled mosaic - this is the classic failure when someone inserts a reordering node into the middle of a tiling branch.

Don't use this for stitching repairs. This is for reassembling a uniform grid of tiles into one canvas. For pasting individually-masked crops back onto a master, that's a stitch node (DOGMAExactCoreStitchV35, DOGMADetailBandStitchV39), which reads DOGMA_STITCH geometry instead of DAC_DATA and respects per-crop masks. Wiring the wrong one is a common stumble because both take "images plus a geometry object."

And the sanity check that applies to every tiling graph: if your tiles diverged from the source, no combiner saves you. The KB's line on tiled upscaling is unsentimental - skip the structure-preserving condition and "tiles can diverge from the source, creating patchwork artifacts." This node hides the seam; it doesn't make the tiles agree.

CategoryDOGMA/Semantic Detailer

Inputs (3)

NameTypeDefaultDescription
imagesIMAGE
dac_dataDAC_DATA
center_powerFLOAT3.001–8

Outputs (2)

NameTypeDescription
imageIMAGE
infoSTRING