AnyImageStitch(mki-任意数量图像拼接)
Stitch two, three, or twelve images side by side
- IMAGE
Sometimes you want several images on one canvas: a before/after comparison, a character turnaround sheet, a batch preview, a contact-sheet row. AnyImageStitch_makki (display name "AnyImageStitch(mki-任意数量图像拼接)") stitches any number of images horizontally or vertically into a single IMAGE output - and it's the node the pack's older, deprecated stitchers point you to.
How it works
This is the "any number" trick you should know about: the node starts with one image input slot, and the pack's JS adds another every time you connect the last one. So you plug in image A, a slot appears; plug in image B, another appears. Stop when you're done. No "image_1 through image_10" config to scroll through.
Under the hood it normalizes every input to a common reference size - preserving each image's aspect ratio - and then torch.cats them along the width (horizontal) or height (vertical). Normalizing is the important part: if you stitch a 512×512 and a 768×768 without resizing, you get a broken, misaligned canvas. This node resizes to match instead.
The inputs that matter
- dimension -
horizontalorvertical. Horizontal stacks left-to-right (all heights matched); vertical stacks top-to-bottom (all widths matched). - reference_type - which image defines the "common" size:
first image(default) orcustom. - reference_value - the custom reference size (1–4096, default 512), used when reference_type is
custom. Pick this when the first image isn't the size you want everything normalized to. - upscale_method - how images get resized to match:
bicubic(default) is the safe all-rounder;nearest-exactfor pixel-art;areawhen shrinking. - crop -
disabled(default) orcenter, for when the aspect-ratio math leaves a sliver to crop.
One output, IMAGE, which you can feed straight into a preview or a Save Image node.
Why it beats the old stitchers
The pack used to ship separate ImageWidthStitch (horizontal) and ImageHeigthStitch (vertical) nodes, both marked deprecated. They hardcoded bicubic and always matched to the first image. This node folds both directions into one, adds a custom reference size, and lets you pick the resize method. If you're building a new workflow, use this one.
Installing
It's in ComfyUI-MakkiTools, so:
cd ComfyUI/custom_nodes
git clone https://github.com/MakkiShizu/ComfyUI-MakkiTools
cd ComfyUI-MakkiTools
pip install -r requirements.txt
Restart ComfyUI and it's under the MakkiTools category. No extra dependencies.
Watch out for one thing: the "reference" is a single dimension, not a full target size. Horizontal stitching matches heights but keeps each image's own aspect ratio, so the final width is the sum of the scaled widths. That's usually what you want for comparisons and sheets. If you need every tile to come out exactly the same pixel size, resize them individually first - or use the pack's Image_Resize and feed its width/height outputs into a proper layout node. For a quick multi-image row or column, this node is hard to beat.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| dimension | COMBO | horizontal | Direction to stitch images 拼接图像的方向 |
| reference_type | COMBO | first image | Reference size type 参考尺寸类型 |
| reference_value | INT | 5121–4096 | Custom reference size 自定义参考尺寸 |
| upscale_method | COMBO | bicubic | Method to upscale images 图像放大方法 |
| crop | COMBO | disabled | Crop method for upscaled images 放大图像的裁剪方法 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |