Nodes/Comfyui_PDuse/PD:imageconcante_V1
ComfyUI Node

PD:imageconcante_V1

Imageconcante_V1 — stitch two images side by side without a Photoshop tab

By 7BEII·Created 2 years ago·Updated 15 days ago· 53
PD:imageconcante_V1
  • image1
  • image2
  • image
directionright
match_sizelongest
image2_cropcenter

Before-and-after comparisons. "Original vs. upscaled." "A/B of two LoRAs." In a normal workflow you build these by hand in an editor - in ComfyUI you want them as a node so the comparison regenerates every run. PD:imageconcante_V1 is that node: it stitches two images together in a direction you pick, handles the size mismatch for you, and returns a single image you can save or preview.

The class name is PDImageConcante (yes, the typo is in the source - the author's English display names have a habit of drifting from the class names), so don't go hunting for "PDImageConcante" in the node menu; search PD:imageconcante_V1.

How it works

The core is a torch.cat along the width or height axis, but the real work is the size matching, because two images almost never have compatible dims. There are two modes:

  • match_size = longest - scales both images so their shared axis (height for left/right joins, width for up/down joins) is the larger of the two, preserving aspect ratio with Lanczos. Result: neither image is cropped, but one may be shorter/less wide than the other.
  • match_size = crop by image1 - scales image2 up so one edge matches image1 exactly, then crops the overflow to image1's exact dimensions. The image2_crop anchor (center/top/bottom/left/right) decides which part of image2 survives the crop. Result: a clean rectangle with no aspect distortion, at the cost of losing image2's edges.

It also reconciles channel counts - if one image is RGBA and the other RGB, it pads the missing alpha channel so the concat doesn't error. And if image2 isn't connected at all, it just passes image1 through, which makes the node safe to leave in a graph.

The inputs that matter

  • image1 (IMAGE) - required, the first image.
  • direction - right (default), down, left, up. "Right" puts image2 to the right of image1; "left" puts image2 first.
  • match_size - longest or crop by image1.
  • image2_crop - center/top/bottom/left/right, only used in crop mode.
  • image2 (IMAGE) - optional.

One output: image (IMAGE).

A word on batches

It concatenates the whole batch along the chosen axis - so a batch of 10 image1s and 10 image2s yields one batch of 10 stitched frames, not 20. If your batch sizes differ, matching breaks. For a single pair (the common case) this is invisible; for batch work, make sure the two inputs have equal batch counts.

Install

ComfyUI Manager: search PDuse (repo 7BEII/Comfyui_PDuse), install, restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/7BEII/Comfyui_PDuse
cd Comfyui_PDuse
pip install -r requirements.txt

Restart ComfyUI; the node lives under PDuse/Image.

The take

If you're comparing two generations, this is the fastest route to a single "here's the diff" image. The crop by image1 mode is the one I actually reach for - it guarantees a tidy rectangle, which is what you want for posting. The only gotcha is remembering the typo'd class name when a workflow save references it.

CategoryPDuse/Image

Inputs (5)

NameTypeDefaultDescription
image1IMAGE
directionCOMBOright4 options: right, down, left, up
match_sizeCOMBOlongest2 options: longest, crop by image1
image2_cropCOMBOcenter5 options: center, top, bottom, left, right
image2optIMAGE

Outputs (1)

NameTypeDescription
imageIMAGE