Nodes/zsq_prompt/imageTilesFromBatch
ComfyUI Node

imageTilesFromBatch

The tile-picking node for tiled upscaling, without the guesswork

By windfancy·Created 2 years ago·Updated 5 months ago· 2
imageTilesFromBatch
  • tiles
  • masks
  • overlap
  • image
  • mask
  • x
  • y
index0

If you've ever done tiled upscaling - splitting a big image into chunks, refining each one, and stitching it back - you know the fiddly part isn't the upscaling, it's remembering which tile is which and where it belongs. imageTilesFromBatch from the zsq_prompt pack exists to solve exactly that: it pulls a single tile out of a tile batch by index, and returns the x/y position of that tile in the original image, so you can process it and paste it back exactly where it came from.

How it works

This node comes from the ComfyUI-Easy-Use lineage, and it expects to sit downstream of a tiling node that produces three things: a batch of tiles (IMAGE), a matching batch of masks (MASK), and an overlap value that encodes the tiling layout (tile size, overlap, rows and columns). You give it an index, and it:

  1. Pulls out the tile at that index from the tile batch.
  2. Pulls out the matching mask.
  3. Uses the overlap metadata and the index to compute where that tile sits in the original image, returning it as x and y.

The mask and the x/y are the reason this node is useful rather than redundant - they let you composite the refined tile back seamlessly, feathered edge and all.

The overlap input is a custom OVERLAP data type, not a plain number - it has to come from a node that produces that type (the tiler that made your tile batch). This is not a standalone tile splitter; it's the "give me one tile back, positioned" partner in a tiling pipeline.

Inputs and outputs that matter

  • tiles - the tile batch from your tiler.
  • masks - the matching mask batch (used for feathering/blending on paste-back).
  • overlap - the OVERLAP metadata from the tiling layout. Must be wired, not typed.
  • index - which tile to pull (0-based). That's the knob you'll drive, often from a loop or a batch-count node.
  • Outputs: image, mask, x, y - the tile, its feathering mask, and its position in the original canvas.

Where it fits

Tiled img2img / tiled upscaling, full stop. The canonical pattern: tile a big image, loop over tiles with this node, run each tile through a sampler or upscaler at a higher resolution, then paste each result back at (x, y) with its mask. It's the same niche as Ultimate SD Upscale's internal machinery, but exposed as graph-level nodes so you can control the pass. If you're not doing tiled upscaling, this node has little to offer you - and that's fine.

Installing zsq_prompt

Shared pack install. ComfyUI Manager → search zsq_prompt → install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/windfancy/zsq_prompt

Restart ComfyUI. Heavy shared deps (transformers, opencv-python, opencv-contrib-python, scikit-image, timm, onnx, ultralytics) come with the pack. If Manager flags "conflicting with zsq_prompt" on a workflow, that's dependency-overlap noise; only meaningful once the pack is actually installed. No model downloads needed.

Gotchas

  • The OVERLAP input type means this node won't wire to just any tiler - it expects the layout type from this node family. If you're using a different tiling pack, check its output types first.
  • Index is 0-based and gets clamped to the batch size, so an out-of-range index silently returns the last tile rather than erroring. Loop with care.
  • It returns one tile per call. For full batch processing you'll pair it with a loop or a per-index batch of runs - it's a building block, not a one-shot upscaler.
CategoryZSQ/Image

Inputs (4)

NameTypeDefaultDescription
tilesIMAGE
masksMASK
overlapOVERLAP
indexINT00–10000

Outputs (4)

NameTypeDescription
imageIMAGE
maskMASK
xINT
yINT