Nodes/yiu_comfy_nodes/.internal/image_untile
ComfyUI Node

.internal/image_untile

Stitch an upscaled tile batch back into one seamless image

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

The mirror image of the tiling step - literally. Where __y_i_u__image_tile cuts an image into a batch of overlapping tiles, __y_i_u__image_untile puts them back together, at whatever scale your upscaler applied, with the overlap zones blended so you don't get a quilt of visible seams.

It's an .internal node, hidden from the menu by the pack's front-end code, and it does its main work inside the yiuUpscaleLoopStart/END loop: END calls it on the upscaled tiles every iteration before recursing. When you open a loop workflow saved by this pack, this is the node sitting right before END, and it's the reason the final stitched image comes out clean.

How it works

It takes the tile batch and lays it back into a canvas sized round(orig_h × scale) × round(orig_w × scale). Each tile is placed at its scaled position using the same rows × cols grid and overlap layout that produced it. The overlap regions are blended with a linear weight ramp - a tile contributes fully at its core and fades toward its edges, so where two tiles overlap, the result is a weighted crossfade rather than a hard boundary. A weight buffer normalizes the accumulation, which is what makes the seams disappear.

scale matters: it's the factor your upscaler applied this pass, and it must match what the tiles were upscaled by. The loop feeds it from the current step's scale_this_time.

Inputs

  • tiles - the upscaled IMAGE batch.
  • scale - the upscale factor for this pass (default 1.0).
  • orig_h / orig_w - the original image dimensions (required - the node errors if they're 0).
  • rows / cols, overlap_x / overlap_y - the layout, from the same tiling_meta plan the tile step used.

Outputs

image - the merged full image, plus 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. No extra dependencies.

Where people get burned

  • Layout must match the tile step, exactly. Same rows, cols, overlap - if you hand-typed numbers that differ from what tiling_meta computed, the tiles land in the wrong cells and you get a scrambled stitch. Feed both sides from the same plan.
  • The batch size is validated. The node raises a clear error if the tile count isn't divisible by rows × cols, so a dropped or duplicated tile doesn't silently corrupt the output.
  • scale is a real input, not a display. Set it to the actual factor your upscaler applied. Leave it at the default 1.0 when your upscaler was fixed-factor and it'll come out at the wrong size - which is precisely why the loop wires scale_this_time into it.
Category_yiu_nodes/internal

Inputs (8)

NameTypeDefaultDescription
tilesIMAGE
scaleFLOAT1.0000.001–64
orig_hINT00–16384
orig_wINT00–16384
rowsINT11–9999
colsINT11–9999
overlap_xINT00–16384
overlap_yINT00–16384

Outputs (2)

NameTypeDescription
imageIMAGE
help_textSTRING