PVL Image Stitch
Stitch up to eight images into one canvas, grid or guillotine
- image_1
- image_2
- image_3
- image_4
- image_5
- image_6
- image_7
- image_8
- IMAGE
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_squareis on when you wanted a simple row, or the images have wildly different resolutions andmatch_image_sizeis off. pack_to_squareandarrangementdon'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.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| image_1 | IMAGE | — | |
| arrangement | COMBO | right | 4 options: right, left, up, down |
| pack_to_square | BOOLEAN | false | — |
| pack_mode | COMBO | grid | 2 options: grid, guillotine |
| match_image_size | BOOLEAN | false | — |
| match_type | COMBO | downscale | 2 options: downscale, upscale |
| resample | COMBO | bicubic | 5 options: lanczos, bicubic, bilinear, area, nearest |
| spacing_width | INT | 00–2048 | — |
| spacing_color | STRING | 0,0,0 | — |
| square_tolerance_pctopt | INT | 150–50 | Allow up to this % extra area to pick a squarer layout. |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| image_5opt | IMAGE | — | |
| image_6opt | IMAGE | — | |
| image_7opt | IMAGE | — | |
| image_8opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |