Image Concat From Batch (Swwan) · 旧版兼容
Turn a batch into a contact sheet, legacy style
- images
- IMAGE
You generated eight variations, you want to see all eight at once, and you don't want to click through a preview queue. This node takes a batch and lays it out as a grid - a contact sheet. It's the legacy version, superseded by Image Concat Multi in grid/batch_grid mode, but it's the one that existing workflows call, so it's worth knowing exactly what it does to your pixels.
The interface
images (IMAGE), num_columns (INT, default 3, 1–255), match_image_size (BOOLEAN, default false - note the difference from Image Concatenate, which defaults it true), and max_resolution (INT, default 4096).
One output: IMAGE, a single grid image.
How the grid gets built
Rows are ceil(batch_size / num_columns). So 8 images at 3 columns gives you 3 rows, and the last row has two empty slots - you'll see those as black holes in the bottom-right, because the canvas is allocated at full num_rows × num_columns and never cropped.
With match_image_size on, each frame is resized to preserve its own aspect ratio against the first frame's geometry before being placed. With it off - the default - images are assumed to already agree, and the node interpolates each one down into a height × width cell with bilinear filtering anyway.
Then there's the max_resolution step, which is the part that catches people. If num_rows × height or num_columns × width exceeds 4096, the cell size is scaled down so the whole sheet fits, and the scaled dimensions are snapped to multiples of 8 (the code nudges by 4 pixels in either direction before rounding, to land closer to the true scale). The result: a sheet whose cell size is not your input size, and slightly soft because bilinear is doing the downscale. Turn max_resolution up if you want the tiles pixel-exact and you have the VRAM to look at a 6000px preview.
When it's the wrong tool
- You want tiles at original resolution. There's no "don't resize" switch. Both the per-tile interpolate and the max_resolution downscale are always in the path.
- Your batch is video frames. A 60-frame batch of a 704×1280 clip at 3 columns wants a 2112-wide, 1280×20-tall sheet; you'll trip
max_resolutionand everything goes soft. Use Grid to Batch's inverse, or don't grid video at all. - You're building a real grid for downstream processing. This node doesn't respect a
columnsgrid you can invert reliably oncemax_resolutionhas rescaled - you lose the 1:1 mapping to the source tiles. The modern Concat Multigridlayout plus Grid to Batch is a cleaner round-trip.
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, hard-refresh, search Swwan. It's under Swwan/Legacy, needs no models, and runs on your existing torch.
The one thing that will bite you on this pack generally: 1.0.0 renamed 56 node IDs that used to collide with KJNodes and does not register aliases. If you're upgrading and a workflow suddenly shows a missing node where this used to be, that's why, not a broken install. From the repo root:
python scripts/migrate_workflow.py your_workflow.json --dry-run
Dry-run first; the real run writes a new file and leaves the original alone. If a node's origin is ambiguous the tool makes you declare it with --swwan-node-id, which is annoying for exactly one workflow and then never again.
If the whole pack refuses to appear in the node search after install, check that the folder is literally ComfyUI/custom_nodes/ComfyUI_Swwan, check the startup console for import errors, and confirm Python ≥3.11 - the pack declares that floor in its pyproject.toml and doesn't work around it.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| num_columns | INT | 31–255 | — |
| match_image_size | BOOLEAN | false | — |
| max_resolution | INT | 4096 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |