Nodes/ComfyUI Assistant Node/PVL Image Stitch
ComfyUI Node

PVL Image Stitch

Stitch up to eight images into one canvas, grid or guillotine

By pvlprk·Created about a year ago·Updated 8 months ago· 1
PVL Image Stitch
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • IMAGE
arrangementright
pack_to_squarefalse
pack_modegrid
match_image_sizefalse
match_typedownscale
resamplebicubic
spacing_width0
spacing_color0,0,0
square_tolerance_pct15

Every once in a while you just want to glue images together: a before/after comparison, a contact sheet of generations, a row of characters, or a "pack these 6 images into one square for upload" task. ComfyUI's stock nodes are oddly thin on that - which is where PVL Image Stitch earns its place. It's a fully local node (no API, no key) in the pvlprk/comfyui-pvl-api-nodes grab bag that takes up to eight images and composites them into one output: either a straight line (left/right/up/down) or a smart pack into a roughly square canvas.

The pack's bigger selling point is the cloud API nodes, but this is one of the handful of utility nodes that make it worth installing anyway. Nothing here leaves your machine.

How it works

image_1 is required; image_2 through image_8 are optional sockets. In linear mode (arrangement = right/left/up/down) it places them edge to edge with optional spacing_width pixels of spacing_color between, centering on the cross-axis. Turn on pack_to_square and it ignores the linear arrangement and packs everything into the tightest square-ish layout using one of two algorithms:

  • grid - tries row/column partitions across permutations to find the squarest fit.
  • guillotine - a MaxRects-style free-rectangle packer that can fill L-shaped space left by the grid.

There's also square_tolerance_pct (default 15, per the tooltip "allow up to this % extra area to pick a squarer layout") so it can trade a tiny bit of wasted area for a much squarer result. match_image_size normalizes tiles first (match_type downscale/upscale) so nothing gets crushed, and resample (lanczos/bicubic/bilinear/area/nearest) picks the scaling filter. Output is a single IMAGE in RGB float.

Inputs that matter

For most jobs you set just four: image_1, arrangement, pack_to_square, and spacing_width. Everything else is tuning. spacing_color takes an "R,G,B" string like 0,0,0 (black) or 255,255,255 for a white gap.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/pvlprk/comfyui-pvl-api-nodes

Restart ComfyUI. No key, no network, and no heavy dependency drama - though ComfyUI Manager will still install the pack's full requirements.txt on first load.

Where people get burned

  • Single-image passthrough is intentional. If you only feed image_1, you get it back (alpha dropped). Don't expect an error - that's a feature for chaining.
  • Pack modes change the layout drastically. If the output looks scrambled, it's usually because pack_to_square is on when you wanted a simple row, or the images have wildly different resolutions and match_image_size is off.
  • pack_to_square and arrangement don't mix - turning on packing overrides the linear direction entirely, which surprises people the first time.
  • It outputs one composed image, not a batch - if you were hoping for a batch of tiles, this isn't it.
Categoryimage/compose

Inputs (17)

NameTypeDefaultDescription
image_1IMAGE
arrangementCOMBOright4 options: right, left, up, down
pack_to_squareBOOLEANfalse
pack_modeCOMBOgrid2 options: grid, guillotine
match_image_sizeBOOLEANfalse
match_typeCOMBOdownscale2 options: downscale, upscale
resampleCOMBObicubic5 options: lanczos, bicubic, bilinear, area, nearest
spacing_widthINT00–2048
spacing_colorSTRING0,0,0
square_tolerance_pctoptINT150–50Allow up to this % extra area to pick a squarer layout.
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE
image_6optIMAGE
image_7optIMAGE
image_8optIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE