Y7 Image Stitcher
Stitch 2 to 8 images side by side, without the manual resize dance
- image1
- image2
- image3
- image4
- image5
- image6
- image7
- image8
- stitched_image
Combining images in ComfyUI usually means fiddling with resize nodes until every input matches the same height, then finding a concat node and hoping the shapes line up. Y7 Image Stitcher removes the fiddling: plug in 2–8 images, pick horizontal or vertical, and it resizes everything to match the first image, then concatenates. One node, one output.
It's from the Y7Nodes pack, a grab-bag the author describes as "probably only useful to me" - but this is one of the few genuinely turnkey utilities in it.
How it works
The headline feature is the image_count widget (2–8). It doesn't just set a number - it controls how many image sockets the node actually shows. Change it from 2 to 4 and two more imageN sockets appear live on the node; drop it back and they vanish. That's the kind of dynamic-socket trick that keeps ComfyUI graphs tidy instead of showing eight empty holes you never use.
Two orientations, via the orientation dropdown:
Side-by-Side (Horizontal)- all images are resized to match the first image's height, then concatenated left to right.Top-and-Bottom (Vertical)- all images are resized to match the first image's width, then stacked top to bottom.
The "match the first image" rule is the thing that makes this painless: whatever the first image is, the rest get resized to fit it, so there's no manual sizing to think about. Note it resizes, not crops - images with different aspect ratios get stretched to match the reference dimension, so wildly different aspect ratios will distort. For same-shaped images (a row of comparison outputs, for instance), it's exactly what you want.
Sockets within the count that aren't connected are skipped gracefully rather than erroring, which makes partial batches safe - handy when a run produces fewer outputs than your node allows.
Inputs and outputs
Inputs: image_count, orientation, and up to eight image1–image8 IMAGE inputs (all optional; the count controls which are shown). Output: a single stitched_image - one IMAGE tensor ready to feed a preview or saver.
Where you'd use it
Contact sheets and comparison strips are the obvious case - a row of seeds, a before/after pair, a grid of upscale results - where you want one combined image to save or share instead of eight previews. It's also handy for building training-adjacent visualizations: a dataset of stitched pairs where each line shows image + its caption reference. Vertical orientation is the one people overlook; stacking a batch of same-width renders into one long strip is a nice way to eyeball a run at a glance.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/yushan777/ComfyUI-Y7Nodes
cd ComfyUI-Y7Nodes
pip install -r requirements.txt
Restart ComfyUI, or install via ComfyUI Manager → search "Y7Nodes".
Gotchas
The stretch behavior is the thing to remember - "resized to match" means non-uniform scaling when aspect ratios differ, so if you feed a square and a wide image side by side, one of them will look wrong. The fix is to normalize shapes before the stitcher. Also, the dynamic sockets can confuse you if you change image_count after wiring things up - the wires follow the sockets, so keep count stable while editing. Small, predictable behavior; no hidden traps beyond that.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| image_count | INT | 22–8 | Number of image inputs to show |
| orientation | COMBO | Side-by-Side (Horizontal) | 2 options: Side-by-Side (Horizontal), Top-and-Bottom (Vertical) |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| image5opt | IMAGE | — | |
| image6opt | IMAGE | — | |
| image7opt | IMAGE | — | |
| image8opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| stitched_image | IMAGE | — |