Nodes/ComfyUI_Swwan/Image Concat Multi (Swwan)
ComfyUI Node

Image Concat Multi (Swwan)

Strip, grid, or batch-grid, and none of the black bands

By aining2022·Created 10 months ago·Updated about 18 hours ago· 33
Image Concat Multi (Swwan)
  • image_1
  • image_2
  • images
◄inputcount2►
◄directionright►
◄match_image_sizefalse►
◄layoutstrip►
◄columns2►

This is the pack's flagship utility node and the recommended replacement for four separate legacy concat nodes at once: Image Concatenate, Concat From Batch, and both Grid Composite sizes. One node, three layouts, dynamic input count.

If you make contact sheets, before/after comparisons, side-by-side LoRA comparisons, or turn-arounds, this is the node you reach for.

Inputs that matter

Required: inputcount (INT, default 2, 2–1000, step 1), image_1 (IMAGE), direction (enum: right/down/left/up, default right), match_image_size (BOOLEAN, default false).

Optional: image_2 onward, layout (enum: strip/grid/batch_grid, default strip), and columns (INT, default 2, 1–1000).

One output: images.

inputcount grows the port list and - per the author's own note - preserves inputs you've already connected when you shrink or grow it. Set it to 4 and wire four images; the fifth port simply isn't there.

What each layout actually does

strip is the classic behavior: fold image_1 and image_2 through the concatenate routine, then that result with image_3, and so on. The key detail is that the first image's shape is pinned and reused as the resize target at every step, so four wildly different images come out as a tidy strip aligned on image_1's geometry rather than drifting. direction controls whether the strip grows right, down, left or up. columns is ignored here.

grid lays the connected inputs out across columns columns using the pack's grid builder. That builder requires equally sized tiles unless match_image_size is on, in which case it lanczos-upscales each tile to the first tile's size. It also does something you should know about: it pads the final row with black tiles until the rectangle is complete. Five images into 3 columns gives you one black cell at the end. And if your tiles disagree on channel count, the shorter ones get an alpha channel of 1.0s appended.

batch_grid is the sleeper feature. It ignores the extra inputs entirely and instead explodes image_1's batch into single-frame tiles, arranged in columns columns: a 12-frame batch at 4 columns becomes a 4×3 sheet, one image out. That's your "show me every frame of this animation" button, and it's the reason this node replaced the old fixed 2×2 and 3×3 Grid Composite nodes.

Where people get burned

Unwired optional inputs default to black frames, not to "skip." Set inputcount to 4, wire only three, and you get a black band fourth. That's a deliberate behavior (torch.zeros(first_image_shape)), but it reads as a bug the first time.

Also: with match_image_size off and mismatched tiles, grid mode raises rather than guessing. The error is unhelpfully terse - something about grid tile sizes - and the fix is to turn match_image_size on, or resize upstream. strip mode is more forgiving because it resizes image_2..N to image_1 automatically; that's the asymmetry to remember: strip pads-and-resizes, grid raises.

And the output is a single frame, not a batch. If you meant to keep a batch, you wanted Concat From Batch's job done differently, or you want a list, not this.

Install

cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/aining2022/ComfyUI_Swwan.git
cd ComfyUI_Swwan
python -m pip install -r requirements.txt

Windows portable:

.\python_embeded\python.exe -m pip install .\ComfyUI\custom_nodes\ComfyUI_Swwan\requirements.txt

Restart ComfyUI, hard-refresh the browser, search Swwan. It's a primary entry filed under Swwan/Image, and it's model-free - no checkpoints, no downloads, no GPU work beyond tensor cats and a lanczos resize.

Reputation, briefly: this pack is built out of other packs' algorithms - the KJNodes lineage is acknowledged in the source headers, and the third-party notices list WAS, LayerStyle, Essentials and others. The cost of that inheritance shows up as ID churn: 1.0.0 re-namespaced 56 nodes that used to share IDs with KJNodes, and registers no conflict aliases, so a stale workflow needs python scripts/migrate_workflow.py old.json --dry-run from the repo root. The upside is you don't need KJNodes installed to get these nodes, which is the entire point of the pack.

CategorySwwan/Image

Inputs (7)

NameTypeDefaultDescription
inputcountINT22–1000—
image_1IMAGE—
directionCOMBOright4 options: right, down, left, up
match_image_sizeBOOLEANfalse—
image_2optIMAGE—
layoutoptCOMBOstrip3 options: strip, grid, batch_grid
columnsoptINT21–1000—

Outputs (1)

NameTypeDescription
imagesIMAGE—