Nodes/DOGMA Nodes/DOGMA v56.4 Source-Anchored Tile Border
ComfyUI Node

DOGMA v56.4 Source-Anchored Tile Border

Kill the tile seam by nailing each tile's border back to the source

By axior·Created 4 months ago·Updated 3 days ago· 1
DOGMA v56.4 Source-Anchored Tile Border
  • generated
  • source
  • image
  • info
edge_width192
edge_generated_floor0.00

You restored a 3K crop with a model, it looks great, and then the combine step shows you a faint rectangle where the generated tile meets its neighbour. That rectangle is almost always a border mismatch - one tile came back two percent warmer, or shifted three pixels, and the seam is where the two disagree. This node makes the border disagree with nothing.

The mechanism, which is refreshingly simple

It computes, for every pixel, the distance to the nearest of the four tile edges. Normalise that by edge_width, run it through a smoothstep (t*t*(3-2t) - no banding, no hard ring), and you get an alpha ramp that is fully source at the border and fully generated at the centre:

alpha = edge_generated_floor + (1 - floor) * smoothstep(distance / edge_width)
out   = source * (1 - alpha) + generated * alpha

With the default edge_generated_floor of 0, the outermost pixel row is mathematically the source pixel. Every tile in the grid is anchored to the same underlying image at its shared boundary, so when the combiner averages them it's averaging near-identical pixels. The centre of the tile - where all the generated detail lives - is untouched.

The docstring in the source is explicit about the intended partner: this is a pre-combine step for overlapping tiles, and the combine it was written against is the Divide-and-Conquer family (the pack's own docstrings reference Steudio's combine). The D&C pattern itself goes back to a 2025 r/comfyui release that was upvoted into the hundreds for exactly the "tiles processed individually, then seamlessly merged" pitch, and the seam complaint is as old as tiled upscaling - the KB's upscaling doc carries a 2023 tile-ControlNet thread at +1730 for the same class of artifact.

Inputs and output

  • generated - the tile as the model returned it.
  • source - the same region of your master, at the same resolution. If it isn't, the node bicubic-resizes the source up to the generated size, which works but anchors you to a soft reference.
  • edge_width (default 192, step 16, max 512) - how many pixels the ramp takes to reach full generation. 0 disables the node entirely and returns the generated tile unchanged, so leaving it at 0 is a safe way to A/B this.
  • edge_generated_floor (default 0.0) - how much generated signal survives at the very edge. 0 is a hard source anchor; 0.2 or 0.3 keeps a hint of your restoration texture in the border zone.

Outputs image and info. The info string prints the width and confirms the centre is at 1.00 - it's the only running feedback you get, so read it.

Install

ComfyUI Manager, search DOGMA Nodes:

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

Restart. No dependencies (the pack's requirements.txt is # No external dependencies.) and no models - this is pure tensor math. It'll run on any ComfyUI new enough for the pack to import.

Where it bites

Wider is not safer. Set edge_width past roughly a tenth of the tile and you're eating the region you just paid GPU time to restore. A 3K crop with 384px of anchor has a sizable soft frame around it.

It fixes edges, not interiors. If one tile came back globally darker or more saturated than its neighbour, anchoring 192px of border moves the seam, it doesn't remove it. That's a job for a statistics match against the source.

It can't rescue a tile the model hallucinated into. Anchoring the border to a source that visibly disagrees with a wildly changed centre just re-creates the mismatch one ramp-width inside. If a tile is inventing content, fix the prompt, not the seam.

Do it before the combine, not after. Run this per tile, then combine. Run it after you've already stitched and there's nothing to make agree.

CategoryDOGMA/v56.4

Inputs (4)

NameTypeDefaultDescription
generatedIMAGE
sourceIMAGE
edge_widthINT1920–512
edge_generated_floorFLOAT0.000–1

Outputs (2)

NameTypeDescription
imageIMAGE
infoSTRING