Nodes/yiu_comfy_nodes/.internal/image_tile
ComfyUI Node

.internal/image_tile

Cut one image into an overlapping tile batch (the loop's quiet helper)

By leizingyiu·Created about a year ago·Updated 3 months ago· 1
.internal/image_tile
  • image
  • tiles
  • help_text
orig_h0
orig_w0
rows1
cols1
overlap_x0
overlap_y0

Splitting a big image into overlapping tiles is the standard trick for upscaling beyond your VRAM budget - the community calls it tiled diffusion, and it's the difference between "upscale to 10k" and "upscale to whatever fits on the card." __y_i_u__image_tile is this pack's implementation of that cut: it takes a full image and a layout (rows, cols, overlap) and returns a batch of tiles.

It's an .internal node - hidden from the menu by the pack's front-end code - and it does its real work inside the yiuUpscaleLoopStart/END loop, where START calls it internally on every iteration. You'll typically only see it in a saved workflow, wired between a tiling-meta node and your upscaler. Which is exactly what it's for: stand-alone tiling for custom pipelines.

How it works

Given the original height/width, it divides the image into a rows × cols grid of core rectangles. Interior edges are extended by the overlap amount on each side (edge tiles stay flush at the image border), so every tile except the edges overlaps its neighbours. All tiles get padded to the batch's max tile size so they form a clean rectangular batch tensor for your upscaler. Because the tiles overlap, when they come back from the upscaler and get stitched with matching overlap values, the seams crossfade instead of showing a line.

The layout inputs (rows, cols, overlap_x, overlap_y, orig_h, orig_w) are expected to come from __y_i_u__tiling_meta, which computes them consistently for both this node and the untile node.

Inputs

  • image - the full image to cut.
  • orig_h / orig_w - the original dimensions (matters if the image is already downscaled; 0 falls back to the image's own size).
  • rows / cols - the grid, at least 1 each.
  • overlap_x / overlap_y - seam width in px.

Outputs

tiles - the IMAGE batch, and the pack's usual help_text string.

Installing it

Part of yiu_comfy_nodes by leizingyiu:

cd ComfyUI/custom_nodes
git clone https://github.com/leizingyiu/yiu_comfy_nodes

restart ComfyUI, done. No extra dependencies.

Where people get burned

  • It's hidden on purpose. You can't add it from the right-click menu. If you genuinely want it, the loop's saved workflows are where you'll find it in the wild - and the loop uses the same code internally, so you usually don't need to.
  • Overlap on all four interior sides, not the outside. Edge tiles stay flush. That's correct behavior for stitching, but if you expected a uniform border everywhere, adjust your mental model.
  • Layout numbers must match the untile side. Feed this node a rows/cols plan from a different source than the one your untile uses, and the batch won't stitch. Use tiling_meta for both.
Category_yiu_nodes/internal

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
orig_hINT00–16384
orig_wINT00–16384
rowsINT11–9999
colsINT11–9999
overlap_xINT00–16384
overlap_yINT00–16384

Outputs (2)

NameTypeDescription
tilesIMAGE
help_textSTRING