Nodes/comfyui-AGSoft/AGSoft Image Concatenate
ComfyUI Node

AGSoft Image Concatenate

Side-by-side composites without the manual resize first

By Art-xmaster·Created 12 months ago·Updated about 19 hours ago· 23
AGSoft Image Concatenate
  • image1
  • image2
  • image
  • width
  • height
directionhorizontal
resize_methodLANCZOS
gap0
gap_colorwhite
scale_to_size0
multiple_of0
keep_aspect_ratiotrue

Putting two images side by side for comparison is so common that you'd think it'd be one node. It is, in some packs - and this is AGSoft's version. The reason it beats duct-taping an Image Resize + Image Concatenate together is that it handles the mismatched sizes itself: it resizes to match, pads a gap, and rounds the output to friendly dimensions, all in one pass.

How it works

Feed image1 and image2, pick direction (horizontal or vertical), and the node stitches them. Three controls decide how two differently-sized images become one canvas:

  • scale_to_size (default 0 = off) - if set, both images are resized to this length on the shared axis before joining. Leave it off and the node matches heights (horizontal) or widths (vertical) automatically.
  • keep_aspect_ratio (on by default) - when scaling, proportions are preserved; the off-switch is for when you explicitly want to distort to fit.
  • resize_method - LANCZOS by default, which is right for quality; BILINEAR is a faster option for previews.

Then the polish: gap (0–100px) inserts a spacer between the two, colored by gap_color - a gap is what keeps a before/after comparison readable instead of a jumbled seam. And multiple_of (0, 2, 8, 16, 32, 64) rounds the final canvas size to a multiple, so the composite can feed straight into a model that demands divisibility.

Inputs and outputs

Inputs: image1, image2, direction, resize_method, gap, gap_color, scale_to_size, multiple_of, keep_aspect_ratio. Outputs: the stitched image, plus width and height ints. Exactly one input pair - if you need to stitch a whole batch into a grid, the pack's Image Concatenate From Batch node is the sibling to reach for.

Where you'd use it

Before/after comparisons for upscales or inpaints (with a gap and maybe a caption overlay), building a strip of progress images, or combining a source with its result for a review board. It's the kind of node you forget exists until you're dragging two images into a graph and reaching for three resize nodes - then you remember.

Installing it

Pack standard: ComfyUI Manager → search comfyui-AGSoft → install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/Art-xmaster/comfyui-AGSoft.git

No models, no dependencies beyond ComfyUI's built-ins - pure PIL.

Common issues

Two things trip people up. First, when scale_to_size is 0, the node matches the shorter of the two images on the shared axis - so a low-res source will drag the composite down. If that happens, set scale_to_size explicitly or upscale the weak link first. Second, multiple_of rounding happens at the end, so with a gap set you can end up with dimensions slightly larger than the images + gap imply; that's expected, not a bug. And if your composite looks squished, keep_aspect_ratio got turned off somewhere - it defaults on for a reason.

CategoryAGSoft/Image

Inputs (9)

NameTypeDefaultDescription
image1IMAGE
image2IMAGE
directionCOMBOhorizontal2 options: horizontal, vertical
resize_methodCOMBOLANCZOS4 options: LANCZOS, BILINEAR, BICUBIC, NEAREST
gapINT00–100
gap_colorCOMBOwhite7 options: white, black, gray, red, green, blue, +1
scale_to_sizeINT00–4096
multiple_ofCOMBO06 options: 0, 2, 8, 16, 32, 64
keep_aspect_ratioBOOLEANtrue

Outputs (3)

NameTypeDescription
imageIMAGE
widthINT
heightINT