ImageComparisonGIF☀
A before/after slider, saved as a GIF you can actually share
- image1
- image2
- gif_path
The single most useful thing you can do with two versions of the same image is slide one over the other. It's how you actually see what an upscale, a LoRA, or a prompt tweak changed. ImageComparisonGIF automates the "make a comparison GIF" job: feed it two images, and it produces a looping left-right slider animation, saved to your ComfyUI output folder as a file you can drop into a thread or a doc.
Plenty of packs give you an interactive in-UI slider (rgthree's Image Comparer is the popular one), but those live in ComfyUI - you can't attach them to a GitHub issue or a Discord message. This node turns the comparison into a portable artifact, which is the whole point of a GIF.
How it works
It takes the two input images, downscales to a max dimension of 1024px (so huge renders don't balloon into a monster file), resizes the second to match the first, then builds frames copies of the frame: each one pastes image1 on the left and image2 on the right, with the split point sliding from all-the-way-left to all-the-way-right as the frame index climbs. The frames save as an infinitely looping GIF at 100ms per frame. If a file with the chosen name already exists in the output folder, it quietly picks name_1.gif, name_2.gif, and so on, so you never clobber an earlier comparison.
Inputs and output
- image1, image2 - the two IMAGE tensors. Order matters: the slider moves from image1 to image2, so put your "before" on the left.
- frames - 2 to 100, default 20. More frames = smoother slide, bigger file. 20 is a decent default; you rarely need more than 40.
- output_path - the filename, default
compare.gif. It's written into ComfyUI'soutputdirectory, not an arbitrary path.
Output: gif_path - the full path to the saved file, as a STRING you can hand to a script or log.
Gotchas
- It's an output node. No image comes back out the bottom; the result is the file on disk plus a GIF preview in the UI.
- Square-ish inputs give the clearest slide. If the two images have very different dimensions, the second is resized to the first's size, which can distort - resize upstream if it looks wrong.
- No captions. The GIF is a pure slider; labels are on you.
- CPU-only, and it's fine. This is a Pillow job; even a 40-frame GIF takes a moment, not a while.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Hasasasa/ComfyUI_DashuaiTools
then restart ComfyUI, or install via ComfyUI Manager ("DashuaiTools"). Depends only on Pillow and tqdm - the latter is bundled with most ComfyUI installs already.
For documenting upscale passes, LoRA tests, or any "did this actually change anything" question, this is the node that makes the answer shareable.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image1 | IMAGE | — | |
| image2 | IMAGE | — | |
| frames | INT | 202–100 | — |
| output_path | STRING | compare.gif | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| gif_path | STRING | — |