ComfyUI Node

Tile Calculator

The node that does your tiled-upscale math so you don't have to

By jchiotaka·Created 8 months ago·Updated 8 months ago· 0
Tile Calculator
  • image
  • image
  • tile_width
  • tile_height
  • upscale
tiles_per_width2
tiles_per_height2
upscale1.0

Tiled upscaling is how you get a 4K print out of a 6GB card: split the image into tiles, diffuse each one separately (with ControlNet Tile feeding the original back so the tiles don't drift into patchwork), and blend the result. The one thing nobody wants to do by hand is the arithmetic - if I upscale this 1024×768 image 2x and cut it into a 2×2 grid, how big is each tile? That's the whole job of the Tile Calculator node, and it does nothing else. It's a pocket calculator wearing a node's skin, and that's fine.

What it actually does

The node takes your image, a per-dimension tile count, and an upscale factor, then runs the math you'd do on paper:

tile_width  = ceil((image_width  × upscale) / tiles_per_width)
tile_height = ceil((image_height × upscale) / tiles_per_height)

So for a 1024×768 image at 2x with 2 tiles per side, you get 1024×1024 tiles. The original image passes through untouched, and because the node is flagged as an output node, it also prints the result right in its UI ("Tile: 1024 x 1024") so you can see the answer at a glance without hunting for a tooltip. There are no dependencies beyond Python's math module - no model downloads, no VRAM, no external calls. It's the simplest custom node you'll ever install.

The inputs that matter

  • upscale (FLOAT, 0.1–8.0, default 1.0) - the magnification factor. Same thing as the "zoom" you see in the README; it was renamed to upscale in the code and the README hasn't caught up. The field that runs is upscale.
  • tiles_per_width / tiles_per_height (INT, 1–16, default 2) - tiles per dimension, not total tiles. 2×2 means four tiles, 4×4 means sixteen. If you're tiling on a 6GB card, this is your VRAM lever: more tiles means smaller tiles means less memory per diffusion pass.
  • image - only used for its dimensions. Nothing touches the pixels.

Where it fits

The outputs are the point: tile_width and tile_height are INTs, so you wire them straight into the tile-size input of whatever actually does the tiling - an Ultimate SD Upscale-style node, a Tiled Diffusion setup, or a sampler KSampler input in a tile-based workflow. Change your mind about tile count, and every downstream node updates without you redoing the mental math. And because the image passes through, you can drop the node inline in the graph without breaking any connections.

Installing it

ComfyUI Manager is the easy path - search "Tile Calculator" and install. Otherwise:

cd ComfyUI/custom_nodes
git clone https://github.com/jchiotaka/comfyui-tile-calculator.git

Restart ComfyUI and you'll find it under Add Node → image → utils → Tile Calculator. No requirements, no models, nothing to babysit. It's MIT-licensed and the whole implementation is one file.

The honest gotchas

Two things to know. First, the math assumes a clean grid - it ignores the overlap that real tiled upscalers use to blend seams. Treat the output as the tile size you feed the tiler, not a promise of what the tiler will internally compute. Second, this node only does the calculation. It won't tile anything for you; pair it with an actual tiling/upscale node or you've built a very expensive calculator. For anything more than that - tile overlap control, VRAM-aware sizing - you want a full Tiled Diffusion setup. But for the simple "how big are my tiles" question, this is the one you reach for.

Categoryimage/utils

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
tiles_per_widthINT21–16
tiles_per_heightINT21–16
upscaleFLOAT1.00.1–8

Outputs (4)

NameTypeDescription
imageIMAGE
tile_widthINT
tile_heightINT
upscaleFLOAT