Image Tile (NH)
Cut a huge image into overlapping tiles your VRAM can handle
- image
- tiles
- tile_data
- tile_count
- overlap_x
- overlap_y
- tile_info
Your GPU has a hard budget: at some resolution, the sampler runs out of VRAM and dies. Tiling is the workaround the community has used since forever - cut the big image into pieces, process each piece within budget, stitch them back. Image Tile (NH) is the cutting half: it splits an image batch into overlapping tiles and - this is the key part - records everything about the layout into a tile_data structure that Image Untile (NH) uses to reconstruct the original, even after you've resized or upscaled the tiles.
The canonical pipeline from the README:
Load Image → Image Tile (NH) → upscale/process tiles → Image Untile (NH)
You'll reach for it when an image is too large for a model to touch in one pass, or when every tile needs the same enhancement step and you want it done tile-by-tile.
How it works
Three tile_modes decide the tile dimensions:
- original_ratio - derives tile size from the image's own aspect ratio, using
tile_sizeas the long side. A landscape image gets wide tiles, a portrait gets tall ones. This is the smart default. - custom - explicit
tile_width/tile_height. - square - force square tiles at
tile_size(e.g. 1024 × 1024).
The overlap is computed automatically: about 12.5% of the tile size, rounded to a multiple of 8, clamped sensibly. That overlap is what stops seams - adjacent tiles share a border region that gets blended at reconstruction time. Edge tiles are padded with replicated edge pixels so every tile keeps the exact requested size, which matters if you're upscaling tiles uniformly.
The outputs that matter
- tiles - the tile batch (a single IMAGE tensor of tiles in grid order).
- tile_data - a structured record of positions, sizes, overlaps, and batch layout. This is the one that has to reach the Untile node untouched. Don't feed it through anything that transforms or drops data; wire it straight through.
- tile_count - how many tiles you got.
- overlap_x / overlap_y - the computed overlap, exposed so you can sanity-check or mirror it elsewhere.
- tile_info - a STRING summary of the layout, handy for logging.
The traps
- Never lose
tile_data. Without it, Untile cannot reconstruct the image - it's not just a convenience, it's the map. The README calls this out explicitly, and it's the #1 way people break this workflow. - Process tiles uniformly. If you upscale every tile by 2x, Untile infers the scale and handles it. If you upscale some tiles and not others, the reconstruction breaks. Keep it uniform.
- Mind the batch. Untile currently requires all images in a batch to share the same size - so don't batch images of wildly different dimensions into one tile operation.
Installing
Part of NH-Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/jetthuangai/NH-Nodes.git
cd NH-Nodes
pip install -r requirements.txt
Or search NH-Nodes in ComfyUI Manager and restart. No models, no downloads - pure torch slicing and padding.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| tile_mode | COMBO | 3 options: original_ratio, custom, square | |
| tile_size | INT | 102416–16384 | — |
| tile_width | INT | 102416–16384 | — |
| tile_height | INT | 102416–16384 | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| tiles | IMAGE | — |
| tile_data | NH_TILE_DATA | — |
| tile_count | INT | — |
| overlap_x | INT | — |
| overlap_y | INT | — |
| tile_info | STRING | — |