Nodes/ComfyUI Assistant Node/PVL Stitch 2 Size
ComfyUI Node

PVL Stitch 2 Size

A contact sheet that exactly fills the frame

By pvlprk·Created about a year ago·Updated 8 months ago· 1
PVL Stitch 2 Size
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_9
  • image_10
  • image
width1024
height1024
pad_color255,255,255
keep_relative_scalefalse

Need to see four style variants side by side, or turn a pile of candidates into a comparison grid, at exactly a specific pixel size? PVL Stitch 2 Size is the node that lays up to ten images into a tidy grid and pads the whole thing to an exact target width × height. No manual math, no "close enough" canvas, no wasted cells.

It's from pvlprk/comfyui-pvl-api-nodes ("ComfyUI Assistant Node") and it sits in the same image-utility family as the pack's resize and padding nodes. If you've ever hand-assembled a comparison grid with ImageComposite and cried, this is the friendlier path.

How it works

The node takes up to ten optional IMAGE inputs, works out how many are actually connected and usable, and picks a grid (cols × rows) that fills the target canvas. Then each image is scaled proportionally to fit its cell and centered, with the leftover space filled by your pad_color.

Two behaviors worth understanding:

  • keep_relative_scale (default false). Off: every image scales independently to best fit its own cell - so a 1024×1024 and a 512×512 will render at different sizes, and relative sizes between inputs are lost. On: one global scale factor is applied to everything (the tightest fit that makes all of them fit), preserving the relative sizes of the inputs. This matters when the comparison is about size, not just content.
  • Grid choice is automatic. It scores grid layouts by used area and picks the one closest to the canvas aspect, with fewer empty cells winning ties. You don't pick 2×2 vs 4×1; it does.

An important mechanic under the hood: if an input is a batched image (a tensor with several frames), only the first frame is used. This is a one-frame-per-input node.

Inputs that matter

  • width / height - target canvas size (16–8192), default 1024×1024.
  • pad_color - R,G,B string, default white. Empty space between images gets this.
  • keep_relative_scale - the size-preservation toggle above.
  • image_1image_10 - the images. Any that are empty, invalid, or unconnected are silently skipped.

Output: one IMAGE at exactly the target size.

When you'd actually reach for it

The classic case is visual comparison: generate several prompt/style variants, stitch them into one grid, and upscale or save the grid as a single artifact - it keeps your output folder from filling with ten loose images. It's also a lazy man's contact sheet for training-data inspection, and a way to normalize a set of images to one canvas before a batch operation that demands uniform dimensions.

Installing

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

restart, or install via ComfyUI Manager (search "ComfyUI Assistant Node"). No models; Pillow and numpy, both standard in ComfyUI, do the lifting.

Where people get tripped up

  • Feeding a batch into one slot silently keeps only frame 0. If you expected all ten frames of a batch, split them into per-image inputs first (the pack's Image Batch To Image List does exactly that).
  • keep_relative_scale off is the default. If your grid looks like the inputs were "normalized" and you wanted them at true relative size, flip it on.
  • It's a grid, not a freeform composite. No overlap, no arbitrary placement, no alpha blending - exact-fit layout only.
CategoryPVL/Image

Inputs (14)

NameTypeDefaultDescription
widthINT102416–8192
heightINT102416–8192
pad_colorSTRING255,255,255
keep_relative_scaleBOOLEANfalse
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE
image_6optIMAGE
image_7optIMAGE
image_8optIMAGE
image_9optIMAGE
image_10optIMAGE

Outputs (1)

NameTypeDescription
imageIMAGE