Nodes/ComfyUI 1hewNodes/Image Main Stitch
ComfyUI Node

Image Main Stitch

One clean strip out of your main shot plus extras

By 1hew·Created about a year ago·Updated 7 days ago· 33
Image Main Stitch
  • image_1
  • image_2
  • image_3
  • image
  • mask
directionleft
match_image_sizetrue
spacing_width10
spacing_color1.0
pad_color1.0

Contact sheets, storyboard strips, before/after rows, "show me all four variations at once" - stitching multiple images into one canvas is a constant chore in ComfyUI, and the stock tooling is fiddly. Image Main Stitch is the pack's take on it: one main image (that's the "main" in the name) plus up to a few companions, laid out in a direction you pick, sized to match, with spacing and a mask output so you know exactly where each piece lives.

It's from ComfyUI 1hewNodes (solo dev 1hew, bilingual README, active development). Where the pack's Edit Stitch is built for the reference/edit layout of edit models, this one is the general-purpose strip builder.

How it works

image_1 is your main shot. image_2 and image_3 are optional companions (the node also accepts extra dynamic image_4..image_N inputs internally). The companions are stitched together first, then joined to the main image in the direction you choose - left, right, top, or bottom. With match_image_size on (the default), companions are resized to match the main image's dimensions so the strip is clean and aligned; with it off, each keeps its own size and you get a ragged-edge mosaic.

spacing_width inserts a gap between images filled with spacing_color (default white), and pad_color fills any leftover canvas when sizes don't line up perfectly. If any input has an alpha channel, the whole output goes RGBA so transparency survives the join. The mask output is a full-white mask over the stitched image - its real job is staying in sync with the canvas dimensions so downstream compositing has a size-accurate map.

The inputs that matter

  • image_1 - the main image (required).
  • image_2, image_3 - optional companions.
  • direction - left (default), right, top, bottom.
  • match_image_size - resize companions to the main image (default on).
  • spacing_width / spacing_color - the gap between pieces.
  • pad_color - leftover-canvas fill.

Outputs: image (the stitch) and mask.

Installing it

ComfyUI Manager → search "1hew" / "ComfyUI 1hewNodes" → install → restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/1hew/ComfyUI-1hewNodes

Heavy requirements list (opencv, scikit-image, plus ultralytics/rembg/transformers for other nodes) makes the first install slow; this node needs numpy/PIL/torch. No models. Needs current ComfyUI.

Gotchas

  • White strips where you expected transparency - the default spacing_color and pad_color are white. If you're compositing the strip onto something, set them (or use the RGBA path).
  • Ragged edges with match_image_size off - that's by design, but it surprises people. Turn it on for tidy strips, off for true-size mosaics.
  • Only one image? - with no companions it just returns the main image plus a white mask. Harmless, but you've built a passthrough.
Category1hewNodes/image

Inputs (8)

NameTypeDefaultDescription
image_1IMAGE
directionCOMBOleft4 options: top, bottom, left, right
match_image_sizeBOOLEANtrue
spacing_widthINT100–1000
spacing_colorSTRING1.0
pad_colorSTRING1.0
image_2optIMAGE
image_3optIMAGE

Outputs (2)

NameTypeDescription
imageIMAGE
maskMASK