Nodes/Comfyui-Image-Concat/Image concatenate(V1.2 QQ2540968810)
ComfyUI Node

Image concatenate(V1.2 QQ2540968810)

Turn a folder of images into labeled contact sheets — no Photoshop, no grid math

By shmbatom·Created 8 months ago·Updated 7 months ago· 0
Image concatenate(V1.2 QQ2540968810)
  • a0_images
  • b1_concat_images
  • b2_page_count
  • b3_size_per_title
  • b4_valid_image_count
  • b5_title_save_path
  • b6_help_info
a1_image_dir
a2_page_width4000
a3_page_aspect_ratio3:2
a4_cols_rows_per_page3
a5_page_margin50
a6_title_padding30
a7_title_draw_mode3.zoom by long side (recommended)
a8_title_first_positionstart_from margin
a9_background_styleLight (white)
a10_title_borderRounded (radius=10px)
a11_title_border_styleSolid
a12_page_borderRounded (radius=30px)
a13_page_border_styleSolid
a14_filename_positionnone
a15_filename_colorblack
a97_title_save_modenone
a98_title_save_dir./output/concat_titles
a99_title_save_filenamesource file name

You know that moment where you've generated 40 variations and need to actually look at them side by side, in order, at a consistent size? ComfyUI's default preview shows one tensor at a time, and hand-assembling a grid in Photoshop is a slow afternoon of copy-paste. That's the gap this node closes: point it at a folder (or feed it an image batch from elsewhere in your graph) and it lays everything out onto fixed-aspect-ratio "pages" - contact sheets with margins, borders, filename labels, and true alpha-channel transparency. The full display name is literally "Image concatenate(V1.2 QQ2540968810)" - the author's QQ number lives in the title, which tells you everything about who built this. One-person tool, v1.2 in name while the README still says v1.1, and it works.

It's also secretly a batch image resizer: one fill mode plus "save single image" and you've resized a whole folder to a uniform width without touching a single-image node.

How it works

Under the hood it's pure PIL + numpy + torch - no model files, no extra pip dependencies, nothing to download. It reads your folder, filters to known image extensions (PNG, JPG, JPEG, BMP, GIF, WEBP, TIFF), sorts them, then computes a grid across pages sized from a2_page_width and a3_page_aspect_ratio. Page height is auto-calculated from the ratio; you never set it. Each image scales to fit its block per the draw mode, and the finished pages come out stacked as a batch tensor on b1_concat_images - multi-page output, previewed or saved like any other batch.

The nice touch: this is true 4-channel RGBA. Set the background to Transparent and you get real alpha through the whole pipeline, ready for compositing or editing in Photoshop. Alpha only survives if your sources are PNGs - a JPEG has no alpha to preserve.

The inputs that actually matter

Yes, the node has a wall of widgets (19 of them). Resist the urge to panic - almost everything has a sane default and most are cosmetic. The handful you'll set:

  • a1_image_dir - absolute path to the folder of images. Required, unless you connect a0_images from another node instead, in which case the folder is silently ignored. That's the one input that trips people up, so remember it: a0_images wins.
  • a2_page_width + a3_page_aspect_ratio - your canvas. Width in px (default 4000, max 50000), ratio picks 3:2 by default; use something like 9:16 for a vertical layout.
  • a4_cols_rows_per_page - columns per row for modes 1–5, rows per page for mode 6. Default 3.
  • a7_title_draw_mode - the six fill modes. The default, 3.zoom by long side, is the recommended one and it's a safe choice for normal images. Stretch will distort; crop-square-by-short-side is for when you want uniform square-ish tiles.
  • a14_filename_position / a15_filename_color - show the source filename on each block. Set to none if you just want clean grids.
  • a97_title_save_mode / a98_title_save_dir - save each individual block as its own PNG (with or without the border/title).

On the output side, wire b1_concat_images into a Preview or Save node, and if you ever wonder what a parameter does, connect b6_help_info to a Preview Any / string-preview node - the author packed the whole usage guide into that output, which is a neat trick.

Installing it

Standard two ways, and this is the rare pack where installation is truly trivial - no requirements.txt, no model downloads, nothing:

cd ComfyUI/custom_nodes
git clone https://github.com/shmbatom/Comfyui-Image-Concat.git

Then restart ComfyUI. Or open ComfyUI Manager → Install Custom Nodes → search "Comfyui-Image-Concat" and click install. Once it's loaded, find it by double-clicking and searching concat - it lives under Image Processing/concat. It also ships a little JS extension that adds a "Select Folder" button right on the a1_image_dir widget, so you don't have to type paths.

Gotchas and troubleshooting

  • Connected a0_images? Your folder is ignored. Disconnect it to fall back to directory mode.
  • Missing or empty folder doesn't crash - the source returns a red 100×100 error image and a b2_page_count of 0. If your preview is a red square, check b4_valid_image_count (the count of images it actually read) instead of staring at the canvas.
  • Version drift: display name says V1.2, README documents v1.1. A few port names changed along the way (a4_n_per_rows became a4_cols_rows_per_page, a8_draw_mode became a7_title_draw_mode), so older saved workflows need re-wiring.
  • Alpha caveat: transparency survives the output (save as PNG), but only PNG sources carry alpha in.
  • It's a small, quiet pack - no community footprint to lean on if something odd happens. Your docs are the built-in b6_help_info output and the images/one_port.png starter workflow in the repo.
CategoryImage Processing/concat

Inputs (19)

NameTypeDefaultDescription
a1_image_dirSTRINGAbsolute path to the folder containing images to concatenate. Ignored if 'a0_images' are connected via input.
a2_page_widthINT4000100–50000Total width of the output canvas (px). Height is auto-calculated based on aspect ratio.
a3_page_aspect_ratioCOMBO3:2Select the overall aspect ratio of the canvas.
a4_cols_rows_per_pageINT31–20Layout parameter: Columns per row for Mode 1-5, or Rows per page for Mode 6.
a5_page_marginINT500–500Margin space around the canvas border (px).
a6_title_paddingINT300–200Padding space between image title blocks (px).
a7_title_draw_modeCOMBO3.zoom by long side (recommended)Choose how images fit into their blocks (e.g., Scale, Stretch, Crop, Equal Width/Height).
a8_title_first_positionCOMBOstart_from marginAlignment for the first image block (e.g., Top-left alignment, Vertical Centering).
a9_background_styleCOMBOLight (white)Set the canvas background style (White, Black, or Transparent).
a10_title_borderCOMBORounded (radius=10px)Border shape for individual image blocks.
a11_title_border_styleCOMBOSolidLine style for the image block borders (Solid, Dashed, Dotted, etc.).
a12_page_borderCOMBORounded (radius=30px)Border shape for the whole page.
a13_page_border_styleCOMBOSolidLine style for the page border.
a14_filename_positionCOMBOnonePosition to display the filename (Above, Top, Middle, Bottom, Below, or None).
a15_filename_colorCOMBOblackSelect the text color for the filename.
a97_title_save_modeCOMBOnoneSelect whether to save individual blocks (with padding/title or original image only).
a98_title_save_dirSTRING./output/concat_titlesDirectory path to save the individual titles/images.
a99_title_save_filenameCOMBOsource file nameSelect the naming rule for saved files (Index, Original Name, or Page+Index).
a0_imagesoptIMAGEselect image(s) from other node. If 'a0_images' are connected via input, `a1_image_dir` will be IGNORE.

Outputs (6)

NameTypeDescription
b1_concat_imagesIMAGE
b2_page_countINT
b3_size_per_titleSTRING
b4_valid_image_countINT
b5_title_save_pathSTRING
b6_help_infoSTRING