DOGMA Shift Pad v34 — Half-Stride Grid Offset
Move every tile seam by half a stride and watch the grid disappear
- image
- image
- meta
- info
What it is
DOGMAShiftPadV34 exists to solve one specific, very visible artifact: repeated grid seams. Reflect-pad the image by half a tile stride on each side, run your second tiling pass on the padded canvas, and every seam now falls somewhere different from where it fell the first time. Where two independent seam maps disagree, the eye stops reading either of them as a grid.
The class docstring is the mechanism in one line: "Reflect-pad a restored master so the second D&C grid is shifted by half a stride."
This is the classic dither-the-offset trick from tiled diffusion, and it's the reason two-pass tiled upscales look smoother than single-pass ones at the same tile size. The KB's own upscaling notes land on the same point from the other side: without a tile condition, tiles diverging from the source is what produces the patchwork look. Offsetting the grid doesn't fix divergence, but it stops every tile boundary from landing on the same line, which is what makes divergence read as "a grid" instead of "a slightly odd patch of texture."
How it works
Padding is reflect mode, (x, x, y, y) - mirror-symmetric on all four sides, so a tile straddling the new edge sees a plausible continuation of the image rather than black bars or edge smear.
Two implementation details you'll want to know:
- The pad is clamped to the image dimensions. Reflect padding in PyTorch requires the pad to be smaller than the corresponding axis, so a
shift_xlarger than the image width is clamped toW - 1rather than erroring. Theinfostring reports what actually got applied. - Zero shift is a real pass-through. Set both shifts to 0 and you get the input image back unchanged with a meta dict full of zeros and the message "v34 shifted grid: no pad." That's an easy way to A/B whether the shift is helping at all.
The output meta is a DOGMA_SHIFT_META dict carrying pad_x, pad_y, orig_w and orig_h. It's not decoration: you need those four numbers to crop the padding back off after generation, and the pack ships a matching unshift/crop node in the same v34 block that consumes it.
Inputs and outputs
image- the master you're about to upscale. Colour channels only for the pad itself; the padding is applied to the channel-first tensor and moved back.shift_x- INT, default 384, 0–1024, step 16.shift_y- INT, default 384, 0–1024, step 16.
Outputs: image (padded), meta (DOGMA_SHIFT_META), info (a one-liner like v34 shifted grid pad: x=384, y=384, 6144x4096 -> 6912x4864).
The 16px step on the widgets isn't cosmetic - it keeps the padded canvas aligned to the same grid the tiling side of this pack builds everything on, so tiles still land on latent-friendly offsets after the shift.
Install
ComfyUI Manager → DOGMA Nodes, or:
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
# restart ComfyUI
No dependencies: requirements.txt in the repo is a comment line, and the node is a handful of PyTorch calls. Nothing to download, no keys, no model files.
Gotchas
- You must crop the padding off afterwards, using the
metaoutput. Forget it and you get a slightly larger image with mirrored content at every edge - and if you then stitch your tiles back, the mirrored strips end up composited into the final frame. - Pad too little and the shift does nothing. Half a tile stride is the useful ballpark: with a 1536px tile and 50% overlap, a stride of 768 means
shift_xaround 384, which is why that's the default. - Reflect padding duplicates content near the edges. On a frame with strong directional texture (a fence, a row of windows), the mirrored band is visible in the padded canvas - it will be cropped away, but don't be alarmed when you look at intermediates.
- No community threads exist for this pack, and the README covers only the WAN VACE prep nodes and DOGMA samplers, so the class docstrings and the source are the manual.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| shift_x | INT | 3840–1024 | — |
| shift_y | INT | 3840–1024 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| meta | DOGMA_SHIFT_META | — |
| info | STRING | — |