ComfyUI Node

Image Compare

The before/after slider your A/B test was missing

By Nynxz·Created 11 months ago·Updated about 12 hours ago· 4
Image Compare
  • image_a
  • image_b
  • compare_view

    You change one thing - a LoRA strength, a sampler, an upscale model - and then you stare at two images in two tabs, switching back and forth, trying to remember whether the eye was that colour before. Image Compare replaces the tab-switching with a draggable slider: image A on one side, image B on the other, one seam you drag across the picture.

    It's the most obviously useful thing in the pack and it does nothing clever in Python at all, which is worth understanding before you go looking for settings.

    What it actually is

    A compare node with no outputs, no samplers, no math. is_output_node is true, so it runs like any output node, and behind the scenes it writes both inputs to ComfyUI's temp directory as previews (nynxz.compare.a and nynxz.compare.b). Those records go out in the UI payload, and the Vue widget on the node draws the reveal. The compare_view input exists so the frontend can stash the widget's state in the workflow - Python deletes it without reading it.

    Two consequences fall out of that design. First, both images land in temp/, not output/, so nothing accumulates in your real output folder. Second - and this is the thing that bites people - temp is scratch. If you see a comparison you want to keep, save it properly with a Save Image; nothing in the compare node's output directory is meant to survive.

    The other consequence is that the widget is frontend code, which matters for install (more on that below).

    The inputs

    There are two, and both are optional:

    • image_a - the "before".
    • image_b - the "after".

    That's the entire surface. There's no blend percentage to set in Python, no threshold, no output socket to wire onward. Everything you'd want to adjust - reveal versus fade, where the seam sits - lives in the on-node widget.

    Which raises the practical question everyone asks: what happens with one side unwired. Both inputs are optional, so the node runs with a single image wired, and that's genuinely useful - you can leave image_a connected to the input photo and only wire image_b once your pipeline produces something, then rewire as you iterate. Just don't expect the node to be a passthrough; there's nothing to pass through.

    Where it earns its place in a workflow

    The honest answer is: everywhere you'd otherwise squint. Sample the same seed with two LoRA weights and compare. Same latent, two upscale models. Same prompt, two samplers at the same step count. Same image, before and after a post-process. Anything where "is this actually better, or just different?" is a real question - which, once you're past your first week, is most of the tuning you do.

    The more structural use is comparing two stages of one pipeline rather than two alternatives: image_a from the base pass, image_b after a refinement or detail pass, so you can see exactly how much the second pass moved. Second-pass detailers are notorious for over-processing a region that was already fine - being able to wipe between the two makes that obvious in a way that two separate previews never do.

    There's also a smaller, sneakier use: it's a decent "what changed?" node for debugging. Two runs that should be identical but aren't will show you where, immediately.

    Installing it

    Manager → search Nynxz → ComfyUI-NynxzNodes. Or:

    comfy node install comfyui-nynxz-nodes
    

    From source:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Nynxz/ComfyUI-NynxzNodes
    cd ComfyUI-NynxzNodes
    pnpm install && pnpm build
    

    Restart ComfyUI when it's done. No models, no Python dependencies.

    Troubleshooting

    No slider. This is the one failure mode that matters, and it's almost always the frontend. The pack's built Vue frontend lives in web/, which is gitignored in the repo - so a plain git clone gives you the node registering correctly (it's pure Python and imports fine) with nothing to draw the widget. The pack's own README is explicit that source installs need pnpm install && pnpm build. If you cloned from git and got a node with no reveal, that's the cause; ComfyUI Manager and comfy node install ship the build already done, so they don't have the problem.

    Images look mismatched in size. The compare view overlays the two, so a 1024×1024 against a 1536×1536 will show one scaled or offset relative to the other. Compare like with like - put them through the same resize first if you're comparing across resolutions.

    It's doing nothing to my graph. Correct. There are no outputs to wire. If you want the comparison in your pipeline rather than at the end, use a preview or save node instead and keep this as the thing you look at.

    One last note in the pack's favour: it's a small one-person project (v0.3.0, MIT) whose author is better known around here for an Ideogram prompt-helper pack, so the widgets are the selling point and the widget is exactly what breaks if you install it wrong.

    CategoryNynxz/Image

    Inputs (3)

    NameTypeDefaultDescription
    image_aoptIMAGEFirst image (the 'before').
    image_boptIMAGESecond image (the 'after').
    compare_viewoptNYNXZ_IMAGE_COMPARE—

    Outputs (0)

    No outputs