DOGMA v35 Latent-Aligned D&C Prepare
Tiling a 2x upscale so the Flux latent grid never lands off-centre
- image
- IMAGE
- dac_data
- ui
If you've ever tiled a big render through a Flux-family model and gotten a faint grid in the output, you've met the actual problem this node solves. It isn't the mask and it isn't the prompt - it's that the VAE divides the image by 16, so a tile whose origin lands on pixel 817 is mid-latent, and every tile then decodes slightly differently. The seams aren't visible in the tiles; they're visible in the joins.
DOGMAAlignedDacPrepareV35 is the "divide and conquer" front end: it computes a working canvas and a tile grid where every tile origin and every stride is a multiple of 16, then hands you the upscaled canvas plus a dac_data record describing the geometry.
Inputs
image- the source.tile_size(default 1536, 512-4096, step 16) - the sampling window, snapped down to a multiple of 16.target_scale(default 2.0, 1.0-4.0) - how far up you're going. The target dimensions are rounded to multiples of 16 too.overlap_fraction(default 0.50, 0.10-0.75) - how much consecutive tiles share.alignment(default 16, 8-64, step 8) - the grid quantum; silently floored to a multiple of 16, since anything smaller is pointless for a /16 VAE.tile_order(spiralorlinear) - the visit order.
Outputs: IMAGE (the upscaled working canvas, Lanczos via Comfy's own common_upscale), dac_data (the geometry record consumed by the aligned-noise and stitch nodes), and ui (a readable one-line summary).
What the maths buys you
Rather than assume a grid, the node solves for one. It picks the grid count that comes closest to your requested overlap, rounds the resulting stride to the alignment, then extends the working canvas so the last tile lands exactly on the edge: work = tile + (grid-1) * stride, overlap = tile - stride. The info string prints it back - source size, target, working size, grid, tile, stride and overlap, with the note that both strides are divisible by 16.
That's the whole trick, and it's why overlap_fraction behaves a bit differently from the overlap slider in a conventional tile upscaler: you're asking for an approximate overlap and getting an exact, aligned one. With the default 1536/0.50 you'll typically see a 2x2 or 3x3 grid - and a canvas slightly larger than your nominal 2x target, because that's what alignment costs.
spiral builds the visit order centre-out and then reverses the list, so the middle of the image comes last in the sequence. It's a drift heuristic: the tiles you care about most are sampled after the outer ones, rather than accumulating whatever the first few passes did.
Wiring
IMAGE goes to your VAE encode / sampling chain, dac_data goes to DOGMAAlignedTileNoiseV35 for the noise, to the aligned stitch node for compositing, and to the test-tile selector if you want to sanity-check the geometry on four tiles before committing to the whole grid. If you're doing a 2x upscale that you'll then detail with the semantic nodes, this is the node that makes the seam arithmetic not your problem.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
Or Manager → DOGMA Nodes, restart. No Python dependencies - the pack declares none - and nothing to download; the source is the docs, because the README only covers the WAN VACE and sampler nodes.
Common issues
The output is bigger than my requested scale. Expected: the working canvas grows so the last tile reaches the edge on an aligned stride. Crop or resize at the end; don't try to force exact dimensions here.
Seams anyway. Then the noise is the culprit, not the geometry - you're using plain RandomNoise per tile instead of the aligned global field.
Non-multiple-of-16 dimensions downstream. Your alignment is being floored to 16 regardless, so check the ui string for the actual working size rather than assuming.
A grid of one tile. Your tile_size is at or above the target size, so there's nothing to divide. That's valid - it just means you built a tile pipeline to sample once.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| tile_size | INT | 1536512–4096 | — |
| target_scale | FLOAT | 2.001–4 | — |
| overlap_fraction | FLOAT | 0.500.1–0.75 | — |
| alignment | INT | 168–64 | — |
| tile_order | COMBO | spiral | 2 options: spiral, linear |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| dac_data | DAC_DATA | — |
| ui | STRING | — |