Nodes/lf-nodes/Side by side
ComfyUI Node

Side by side

Put two images next to each other and actually see the difference

By lucafoscili·Created 2 years ago·Updated a day ago· 35
Side by side
  • image_a
  • image_b
  • ui_widget
  • image
  • image_list
gap_px8
max_height0
show_labelsfalse
label_aA
label_bB

The most common image-comparison move in all of ComfyUI is also the most manual: generate two images, open two previews, and switch tabs until your eyes cross. LF_SideBySide automates that with a single horizontal stitch - image A on the left, image B on the right, separated by a divider you control. It's the two-image special case of the pack's LF_ImageGrid, and for before/after, seed-vs-seed, or checkpoint-vs-checkpoint checks it's usually the faster reach.

What separates it from slapping two images together with a resize node is the care around dimensions. The composite scales the panes to a common height and preserves each side's aspect ratio - widths are computed proportionally, with halves rounded up - so nothing gets stretched. max_height (default 0) lets you cap the composite height; leave it at 0 and it uses the taller input's height. And it's alpha-safe: if your inputs have transparency, the stitch handles it rather than blacking it out.

Inputs that matter

  • image_a / image_b - left and right panes. Batch sizes must match, or one side must be a single-image batch that gets broadcast.
  • gap_px - the opaque black divider width (default 8). Set 0 for no divider at all.
  • max_height - cap on the composite height, 0 for "taller input wins."
  • show_labels / label_a / label_b - burn a small label chip into the upper-left corner of each pane ("A"/"B" by default). Labels are off unless you enable them.

Outputs are image (the stitched batch, ready for a save or preview node) and image_list (the same stitched images as a one-item list, for nodes that only eat lists). There's no receipt on this one - it's a plain utility, and honestly that's refreshing.

When you'd use it

  • Before/after comparisons (upscale, LoRA, inpaint region, prompt tweak).
  • Seed triage: generate a few seeds, stitch pairs, pick a winner without alt-tabbing.
  • Building quick "option A vs B" images to drop into a document or Discord - show_labels exists exactly for that.

It's deliberately dumb, which is the point: two inputs, one output, no hidden state. If you need a full matrix of many images with headers, that's LF_ImageGrid's job; this node is for when you want exactly two and you want them side by side in one frame.

Installing and gotchas

Ships in LF Nodes, same routine as the rest of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/lucafoscili/lf-nodes.git

restart (ComfyUI Manager: search "LF Nodes"). Manager installs the pack's requirements - Pillow is pinned at 12.2.0 in there. And the recurring pack note: the repo was rewritten with the old one archived in 2025, so clone lucafoscili/lf-nodes, not whatever stale URL a tutorial cites.

The realistic gotchas are mild. Mismatched batch sizes error out unless one side is a single image - broadcast only goes one way. Different aspect ratios mean different final widths per side, which is correct but can surprise people expecting both panes to be identical width. And if you compare images of wildly different heights, max_height is your friend - set it or the taller one dictates the whole composite. Otherwise it just works, which is more than you can say for most things in this ecosystem.

Category✨ LF Nodes/Image

Inputs (8)

NameTypeDefaultDescription
image_aIMAGEImage shown in the left pane.
image_bIMAGEImage shown in the right pane.
gap_pxINT80–4096Opaque black divider width in pixels. Set 0 for no divider.
max_heightINT00–16384Maximum composite height. Set 0 to use the taller input's height.
show_labelsBOOLEANfalseBurn the two labels into the upper-left corner of their panes.
label_aSTRINGALeft-pane label, used only when show_labels is enabled.
label_bSTRINGBRight-pane label, used only when show_labels is enabled.
ui_widgetoptLF_MASONRY[object Object]

Outputs (2)

NameTypeDescription
imageIMAGEHorizontally stitched image batch.
image_listIMAGEIndividual stitched images in batch order.