Nodes/ComfyUI_Swwan/Image Grid Composite 2x2 (Swwan) · 旧版兼容
ComfyUI Node

Image Grid Composite 2x2 (Swwan) · 旧版兼容

Four wires in, one square out

By aining2022·Created 10 months ago·Updated about 18 hours ago· 33
Image Grid Composite 2x2 (Swwan) · 旧版兼容
  • image1
  • image2
  • image3
  • image4
  • IMAGE

Four fixed IMAGE inputs, one IMAGE out, arranged top-left / top-right / bottom-left / bottom-right. That's the whole node. It's in the pack's Swwan/Legacy category, its register entry points at SwwanImageConcatMulti as the recommended replacement, and it exists because a lot of shared workflows have it in the middle of a comparison layout.

Sometimes a fixed 2x2 is exactly what you want, though. Four LoRA strengths, four seeds, four upscale models - a square that posts well and needs no configuration. There's no dropdown to get wrong.

The interface

image1, image2, image3, image4, all required IMAGE. Output: IMAGE, a single 2×2 sheet.

No size matching options, no padding, no scaling. Under the hood it's a row-wise concatenation: image1 next to image2 along the width axis, image3 next to image4, then the two rows stacked along the height axis. Because torch.cat requires matching dimensions along every axis except the one being joined, all four inputs must have identical height, width, channel count and batch size. If they don't, you get a tensor-shape error rather than a polite resize.

So: resize your inputs to a common size first. The pack's Resize Image node is the obvious upstream, and if you'd rather the node did it for you, Image Concat Multi in grid layout with match_image_size enabled will lanczos-fit each tile to the first one's geometry and complete the rectangle for you.

Batch behavior

It's worth being explicit, because it's the thing that confuses people: the node takes four tensors, each of which may be a batch. If all four are single frames you get one 2×2 frame. If all four are batches of N frames, you get a batch of N sheets - each frame position getting its own composite. What you can't do is mix a single frame with a batch of four, because the batch dimensions have to agree for the concat.

When it's still the right call

  • You're rebuilding an old workflow and want it to render identically. That's the Legacy category's entire reason for existing.
  • The layout is genuinely the point: a stable before/after/GT/prediction panel, a four-way seed comparison, a LoRA grid where the positions carry meaning and you don't want a columns setting to reinterpret them.
  • You want a hard failure on size mismatch. The 2x2's rigidity is a check: if something upstream changed resolution, this node tells you by refusing to run.

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 lives under Swwan/Legacy. No models, no GPU-heavy dependencies - this is tensor work on your existing torch, and requirements.txt only adds the vision extras (opencv-python, scipy, scikit-image) the pack uses elsewhere.

Two notes on the pack as a whole, both of which show up as bug reports:

Missing node after an upgrade. The 1.0.0 release re-namespaced 56 nodes that overlapped with KJNodes and registers no conflict aliases by design. If a graph that used to work now shows a red node, that's the cause. From the repo root:

python scripts/migrate_workflow.py old.json --dry-run

Nodes not appearing at all. Confirm the clone landed at ComfyUI/custom_nodes/ComfyUI_Swwan (case matters on Linux), check the console for import errors on startup, and force-refresh the browser - the pack ships a frontend extension for its dynamic-input controls, and a cached old version of it makes existing nodes render oddly.

CategorySwwan/Legacy

Inputs (4)

NameTypeDefaultDescription
image1IMAGE—
image2IMAGE—
image3IMAGE—
image4IMAGE—

Outputs (1)

NameTypeDescription
IMAGEIMAGE—