Nodes/Mikey Nodes/Upscale Tile Calculator (Mikey)
ComfyUI Node

Upscale Tile Calculator (Mikey)

The math node behind clean Ultimate SD Upscale tiles

By bash-j·Created 3 years ago·Updated 10 months ago· 188
Upscale Tile Calculator (Mikey)
  • image
  • image
  • tile_width
  • tile_height
tile_resolution512

If you've used Ultimate SD Upscale (the tiled-diffusion upscaler almost everyone in ComfyUI eventually reaches for), you've probably hit the problem this node solves without necessarily realizing there was a fix: pick a tile size that doesn't evenly divide your image, and the last tile along an edge ends up an odd, ragged size - which shows up as a faint seam or inconsistency where that tile meets its neighbors. Upscale Tile Calculator exists purely to do the division math for you so that doesn't happen.

Per the README, it was built specifically as a companion to ssitu's Ultimate SD Upscale, to calculate tile dimensions that fit evenly inside the larger image without leaving weird edges. It's a small, single-purpose utility node - it doesn't upscale anything itself, it just does the arithmetic that a proper tiled upscale needs to be seamless.

The inputs that matter: image - feed in the image you're about to upscale, so the node knows its actual dimensions to divide against. tile_resolution (default 512) is the resolution your model family is comfortable denoising a tile at. The README gives a concrete table worth memorizing: 512 for SD 1.5, 768 for SD 2.1, 1024 for SDXL base, 768 for SDXL refiner. Pick based on whichever model is actually doing your tile pass, not necessarily your base generation model. The outputs are image (a passthrough of what you fed in, so you can chain straight into the next node without a separate wire), tile_width, and tile_height - plug those two straight into Ultimate SD Upscale's tile size fields and you're done.

Installing it

Comes with the full Mikey Nodes pack. Through ComfyUI Manager, search "Mikey Nodes." Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/bash-j/mikey_nodes

Restart ComfyUI. This node needs no models of its own - but to actually use its output for anything, you'll want ssitu's Ultimate SD Upscale installed separately, since that's the node it was designed to feed. It's not a Mikey Nodes dependency, but without it, this calculator's outputs have nowhere useful to go.

Common issues

The most common confusion is expecting this node to do any actual upscaling - it doesn't touch pixels beyond passing the image through unchanged; it's pure math. If you wire it up and the output image looks identical to the input, that's correct behavior, not a bug - the real work happens downstream in Ultimate SD Upscale using the tile_width/tile_height numbers this node hands over.

The other thing worth getting right is tile_resolution: picking a number that doesn't match your actual tiling model's comfort zone (say, using 1024 when your tile pass is actually running an SD 1.5 model) undermines the whole point - the tiles will divide evenly, but each one will still be denoised at a resolution the model wasn't trained for, which brings back the softness or artifacting this node was meant to help you avoid in the first place.

CategoryMikey/Image

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
tile_resolutionINT5121–8192

Outputs (3)

NameTypeDescription
imageIMAGE
tile_widthINT
tile_heightINT