Nodes/ComfyUI_LC123_nodes/LC Image Stitch Multi 🖼️🪡
ComfyUI Node

LC Image Stitch Multi 🖼️🪡

Stitch a Dozen Images Without a Dozen Resize Nodes

By lonecatone23·Created 3 months ago·Updated about 7 hours ago· 46
LC Image Stitch Multi 🖼️🪡
  • image_01
  • image_02
  • image_03
  • image_04
  • image_05
  • image_06
  • image_07
  • image_08
  • image_09
  • image_10
  • image_11
  • image_12
  • image_13
  • image_14
  • image_15
  • image_16
  • image_17
  • image_18
  • image_19
  • image_20
  • image
  • width
  • height
◄directionright►
◄match_sizematch first►
◄aligncenter►
◄gap0►
◄gap_color#000000►

Every workflow eventually needs two pictures glued together. Before/after wipes, a preset test sheet, three camera angles, a banner for a post - and in stock ComfyUI that means one Image Stitch node per join plus a resize before each one to make the heights agree. LC Image Stitch Multi is the plumbing-layer fix: twenty autogrow slots, one node, edges that actually line up.

What it does

Drop images into image_01 upward and it lays them out in the direction you pick - right, down, left or up, where right/left are side by side and down/up are stacked. The node's autogrow slots work like LC Batch Image and KJNodes' Image Concatenate Multi: sockets appear as you fill them, up to twenty.

match_size is the one you'll care about. Set to match first, every later image is scaled - aspect kept - to the first image's height when you're stitching side by side, or its width when stacked. That's the whole point: heights agree, so the result reads as one image rather than a staircase. Set it to off and images keep their own dimensions, which is right only when you know you want them ragged.

When sizes still differ (and they will, if you turned match_size off), align places the smaller image along the seam: center, start (top or left) or end. gap puts 0–512 pixels of space between images and gap_color takes a hex string for that gap - and for the empty space around any smaller image, which is a nice touch, since #000000 on white panels looks like a deliberate border and #ffffff disappears.

Slots that are disconnected, muted or empty are skipped, not fatal. So a switchable "show third panel" branch doesn't need a bypass cleverly wired - mute it and the stitch just closes up.

Batches work frame by frame, and a shorter batch repeats its last frame, so you can stack a 4-frame animation against a still without it erroring out.

Outputs

Three: image, plus width and height as INTs. The dimensions are more useful than they sound - feed them into a resize, a latent-image node or a text label, and you stop guessing why your 2048-wide assumption produced something 3072 wide.

Install

Part of lonecatone23/ComfyUI_LC123_nodes. There's no requirements file and no pip step; the pack uses only what ComfyUI already has.

cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes.git

Restart ComfyUI. Or use ComfyUI Manager and search ComfyUI LC123 Nodes. Nodes appear under LC123/image. If the pack installs but nothing shows up, check that __init__.py sits directly inside ComfyUI/custom_nodes/ComfyUI_LC123_nodes/.

Where people get burned

Two things, both boring and both real.

The first is match_size. Turning it off to "avoid resampling" is a false economy: a stitch of a 1024×1536 and a 1024×1024 gives you a canvas with blank bands top and bottom, filled with gap_color. If you wanted no scaling, crop first.

The second is scale - a 20-wide stitch of 2K images is a 40,000-pixel-wide tensor and it will happily eat your VRAM until ComfyUI's memory manager starts swapping. You don't need this node to be smart about that; you need to resize before stitching if you're building a big grid. For contact sheets, LC Image Grid is the better tool, since it wraps columns instead of producing one absurd row.

And remember the whole family's rule from the plumbing layer: these utility nodes are where workflow legibility is won or lost. If you're stitching four images, fine - but if you're stitching twenty, your graph is doing something a grid node or a saved preset sheet would do more clearly.

CategoryLC123/image

Inputs (25)

NameTypeDefaultDescription
directionCOMBOrightWhere each next image goes: right / left = side by side, down / up = stacked.
match_sizeCOMBOmatch firstmatch first: every image is scaled (shape kept) to the first image's height (side by side) or width (stacked), so the edges line up. off: images keep their own size.
alignCOMBOcenterWhere a smaller image sits along the seam when sizes differ: center, start (top / left) or end.
gapINT00–512Space between the images, in pixels.
gap_colorSTRING#000000Color of the gap and of any empty space around smaller images (hex).
image_01optIMAGESkipped if disconnected, muted, or empty.
image_02optIMAGESkipped if disconnected, muted, or empty.
image_03optIMAGESkipped if disconnected, muted, or empty.
image_04optIMAGESkipped if disconnected, muted, or empty.
image_05optIMAGESkipped if disconnected, muted, or empty.
image_06optIMAGESkipped if disconnected, muted, or empty.
image_07optIMAGESkipped if disconnected, muted, or empty.
image_08optIMAGESkipped if disconnected, muted, or empty.
image_09optIMAGESkipped if disconnected, muted, or empty.
image_10optIMAGESkipped if disconnected, muted, or empty.
image_11optIMAGESkipped if disconnected, muted, or empty.
image_12optIMAGESkipped if disconnected, muted, or empty.
image_13optIMAGESkipped if disconnected, muted, or empty.
image_14optIMAGESkipped if disconnected, muted, or empty.
image_15optIMAGESkipped if disconnected, muted, or empty.
image_16optIMAGESkipped if disconnected, muted, or empty.
image_17optIMAGESkipped if disconnected, muted, or empty.
image_18optIMAGESkipped if disconnected, muted, or empty.
image_19optIMAGESkipped if disconnected, muted, or empty.
image_20optIMAGESkipped if disconnected, muted, or empty.

Outputs (3)

NameTypeDescription
imageIMAGE—
widthINT—
heightINT—