Nodes/ComfyUI-PJLatent/PJ Image Preview/Save
ComfyUI Node

PJ Image Preview/Save

Compare two images by dragging a split

By pongjoo·Created 7 months ago·Updated 2 months ago· 0
PJ Image Preview/Save
  • images
  • images_b
    save_imagefalse
    filename_prefixPJ_Image

    PJ Image Preview/Save is the node you reach for when you're testing two things against each other and you're tired of squinting at two separate preview images. Feed it image A and an optional image B, and it draws a draggable slider right on the node canvas - drag left and you see B, drag right and you see A, split down the middle. It's the classic A/B comparison interaction, and out of the box ComfyUI doesn't really have one.

    The classic use case: same prompt, two samplers, or with and without a LoRA, or original vs upscaled. Wire the two outputs into images and images_b, run, and scrub the slider to find where they actually differ. It beats stacking previews because your eyes can catch fine detail changes right at the seam. This is the node that got me through "is this LoRA actually doing anything?" - answer: yes, the hair is different, and I can point at exactly where.

    How it works

    It's an output node (no output sockets), with a small JavaScript front end doing the heavy lifting. Every run it writes both images to ComfyUI's temp directory for display, and the JS loads the first image of each batch onto the canvas and draws a vertical split you drag with the mouse. The save_image toggle flips between Preview Only and Save Enabled. Here's the honest detail: when saving is on, it saves only image A to your output folder, and it embeds the full workflow metadata in that PNG - so a saved image is drag-back-into-ComfyUI reproducible. Preview images skip the metadata.

    It's also wired into ComfyUI's normal history and assets manager, so previews show up in the sidebar history like any output node, and saves are assets you can browse. No surprises there.

    Inputs

    Three you'll actually set:

    • images - image A. Required.
    • images_b - image B. Optional. Leave it empty and the node behaves like a plain preview/save node (the slider just has nothing to compare).
    • save_image - the Preview Only / Save Enabled toggle.
    • filename_prefix - default PJ_Image; your saved files come out as PJ_Image_00001_.png, incrementing per run.

    One gotcha if you're feeding it batches: the slider compares only the first image of each batch. If you're testing 4 generated variants against each other, do them one pair at a time or you'll keep seeing image one.

    Installing it

    Standard custom-node install - ComfyUI Manager search PJLatent, or:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/pongjoo/ComfyUI-PJLatent.git
    

    Restart ComfyUI. It's under Add Node → PJ_Nodes → Image. No dependencies, no models; the slider is a bundled JS file that loads automatically.

    The honest take

    This is a small personal pack (the whole repo is five nodes, MIT, written by one author), and this node is the "nice to have" of the bunch. If you do a lot of A/B comparison work it genuinely replaces two previews with one better interaction. If you mostly run one image at a time, it's just a slightly fancier Save Image. The slider is the feature - the save side is functionally identical to ComfyUI's built-in save node, so don't install the pack for the saving. Install it for the split.

    CategoryPJ_Nodes/Image

    Inputs (4)

    NameTypeDefaultDescription
    imagesIMAGE
    save_imageBOOLEANfalse
    filename_prefixSTRINGPJ_Image
    images_boptIMAGE

    Outputs (0)

    No outputs