Nodes/LF Nodes/Compare images
ComfyUI Node

Compare images

A slide-to-compare node for before/after checks

By lucafoscili·Created 2 years ago·Updated about a year ago· 50
Compare images
  • image
  • image_opt
  • ui_widget
  • image
  • image_list
  • all_images
  • dataset

Squinting between two output images in separate preview windows gets old fast, especially when you're checking whether a LUT, an upscale pass, or a LoRA weight tweak actually did anything. LF_CompareImages puts a drag slider directly on the node so you can flick between two images without leaving the graph. This isn't a generation node - it doesn't touch pixels - it's pure quality-of-life, the same category rgthree's popular Image Comparer node lives in. If you've used that one, the idea here is identical; this is LF's own take on it, built on the pack's LF Widgets UI library instead.

Wire an image in as your first input; image_opt is the optional second one you're comparing against. Once both are connected, the node's built-in slider widget (KUL_COMPARE) lets you drag across the canvas to reveal one image or the other - that widget is the node's own display, not something you set a value on. What makes this more than a viewer, though, is the outputs: image and image_list re-emit what you fed it so the comparison doesn't dead-end your pipeline, all_images accumulates every image the node has seen across runs (handy if you're iterating and want a running gallery, not just the latest pair), and dataset hands back a JSON blob describing the comparison - useful if you want to log or save what was compared, say via LF_SaveJSON. It's flagged as an output node, meaning it renders its result in the UI on its own, without needing a separate save step downstream.

Installing it. Search "LF Nodes" in ComfyUI Manager and install, or manually cd ComfyUI/custom_nodes && git clone https://github.com/lucafoscili/lf-nodes (the actively maintained repo - the one comfy.icu links, comfyui-lf, has been archived since the author's migration; same nodes, new home). Restart ComfyUI either way. No models to download, no heavy dependencies - it's a lightweight visual utility, not a generation node, so it adds essentially nothing to your load time.

Where people get tripped up. If the slider widget doesn't show anything, double check both images actually reached the node before execution - an empty image_opt just means you're comparing one image against nothing, which defeats the point. If you're expecting the node to output a merged or blended image, it doesn't: it's a viewer and a passthrough, not an image-processing step, so don't chain it expecting pixel changes. And like most nodes in this pack, don't try to wire a value into the ui_widget slot - that's the comparer UI rendering itself, not a real input.

Category✨ LF Nodes/Image

Inputs (3)

NameTypeDefaultDescription
imageIMAGEFirst input image tensor or a list of image tensors.
image_optoptIMAGESecond input image tensor or a list of image tensors (optional).
ui_widgetoptKUL_COMPARE[object Object]

Outputs (4)

NameTypeDescription
imageIMAGE
image_listIMAGE
all_imagesIMAGE
datasetJSON