ComfyUI Node

Tile Test: Layout

Layout — See the Grid Before You Burn the Hour

By Blakeem·Created 3 months ago·Updated 8 days ago· 28
Tile Test: Layout
  • image
  • layout
  • overlay
  • tile_count
◄upscale_by2.00►
◄max_tile_width1536►
◄max_tile_height2048►
◄context_anchor32►
◄context_overlap32►

A 4x tile upscale of a 1024×576 image is a six-tile run at denoise 0.35. Push it to 8K in a second pass and you're looking at 24 tiles, each a full diffusion pass with a vision encode on top. That is not a workflow you want to debug by guessing.

Tile Test: Layout answers the question first. It solves the exact grid the refine will use, draws it on your image, and tells you how many tiles you just signed up for. It's officially a test node. In practice it's the first node of the chain nobody skips.

What it's for

This pack takes the opposite approach to the Ultimate SD Upscale lineage. The old path - USDU, Tiled Diffusion, SEGS detailers - samples each tile larger and then resamples back down to paste: two lossy Lanczos passes per tile, and a soft patch wherever the blend averaged two different hallucinations. Here you upscale first, then refine tile by tile at the resolution the pixels already are, with each tile conditioned on its finished neighbors held as frozen context. The author (blakeem, who forked Ultimate SD Upscale before writing this) put it plainly: nothing gets diffused twice, nothing gets rescaled.

Which means the grid geometry is the quality setting. You don't tell this pack how big a tile is. You tell it the largest crop your model handles, and it solves the grid.

How the solve works

The node takes the image, works out the size it will have after upscale_by, and fits a grid whose crops stay under your max_tile_width/max_tile_height cap. Every crop is aligned to an 8-pixel boundary. Each tile then gets two extra rings of pixels that are cropped away after sampling: the context_overlap band, which neighbors share and diffuse from both sides, and the context_anchor ring beyond it, which the tile conditions on but never re-diffuses.

Both rings count against your max tile size, which is the part people miss. Set max_tile_height: 2048 with context_anchor: 32 and context_overlap: 32 and the tile's real content area is smaller than you'd think.

The inputs

image and upscale_by are the obvious two - upscale_by defaults to 2 and just tells the solver what target shape to plan for. Then:

  • max_tile_width / max_tile_height (1536 and 2048): the hard cap on what the model ever sees in one crop, rings included. Set these to the largest size your model handles well, not the largest that technically fits in VRAM.
  • context_anchor (32): frozen pixels of context from the neighbors.
  • context_overlap (32): the band both tiles diffuse and blend. Smooth gradients want more; busy detailed scenes want less.

Outputs

layout is the whole point - a CATR_LAYOUT carrying the solved grid and the widgets it was solved from. It feeds Tile Test: Upscale, Tile Test: Captions and Tile Test: Render, and everything downstream reads its geometry from it. Solve once, at the top.

overlay is an IMAGE preview at the upscaled shape with each tile's crop, overlap and core outlined and labeled with its number. It's capped at 2 megapixels, so treat it as a schematic: the numbers are exact, the pixels aren't.

tile_count is the INT that tells you whether you want to run this. Six is reasonable. Forty is an afternoon.

Installing it

ComfyUI Manager is the easy path - search "Context-Anchored Tile Refine". Or clone it:

cd ComfyUI/custom_nodes
git clone https://github.com/Blakeem/ComfyUI-ContextAnchoredTileRefine
cd ComfyUI-ContextAnchoredTileRefine
pip install -r requirements.txt

Then restart. logit-classifier>=0.4.0 is the only dependency, and Manager installs it for you. The pack wants ComfyUI 0.3.45 or newer.

Layout needs no models. The rest of the chain does: a Krea 2-family vision-language encoder (Qwen3-VL, a separate ~8GB download) plus the Krea 2 diffusion model and the Qwen-Image VAE. Missing that encoder is the most common setup mistake.

Where it bites

The classic mistake: solve the layout, then reach back and change max_tile_width or context_overlap without re-running. The layout carries its own widgets and the nodes below read from it, not from the widget you just edited. Re-solve it.

Past that, the failure modes are loud rather than silent. Tile Test: Upscale refuses a batch outright, and it and Render both error if the image they get doesn't match the size the layout was solved for. A size mismatch almost always means you fed the chain the wrong image.

And if tile_count comes back at forty, that isn't a bug. That's the layout doing its job.

Categoryimage/upscaling/tile testing

Inputs (6)

NameTypeDefaultDescription
imageIMAGEThe image the chain starts from, before any upscale.
upscale_byFLOAT2.000.01–8The upscale multiplier. The grid is solved for the size the image has after this upscale.
max_tile_widthINT1536256–16384Hard cap on the width the model ever sees per sampled crop, including the context_overlap and context_anchor rings. Set to the largest width the model supports.
max_tile_heightINT2048256–16384Hard cap on the height the model ever sees per sampled crop, including the context_overlap and context_anchor rings. Set to the largest height the model supports.
context_anchorINT320–512Pixels around each tile that are frozen and shown to the model as context, then cropped away.
context_overlapINT320–512Overlapped context that is diffused from both sides and then blended. It anchors the tiles to each other, like context_anchor anchors each tile to its surroundings.

Outputs (3)

NameTypeDescription
layoutCATR_LAYOUTThe solved tile grid and the widgets it was solved from. Feed it to Tile Test: Upscale, Tile Test: Captions and Tile Test: Render.
overlayIMAGEA preview of the image at its upscaled shape, with every tile's crop, overlap and core outlined and its number labeled. The preview is at most 2 megapixels.
tile_countINTThe number of tiles in the grid.