CMK Preview & Compare
Hold the mouse down to see before and after, no extra image plumbing
- VISUAL
The single most common way people evaluate a ComfyUI change is by putting two Preview Image nodes side by side and squinting. CMK Preview & Compare is the pack's answer: a terminal node that takes the VISUAL chain and renders a press-and-hold before/after comparison, so you flip between the two images with the mouse button instead of with your memory.
It's a Toolbox node - CMK/Toolbox/Image - not part of the guided Flow chain, and you can drop it anywhere a CMK VISUAL pipe reaches.
How it works
The VISUAL pipe isn't a second IMAGE wire, and that distinction is what makes this node possible. It's an accumulating registry: each module that has something to show registers a provider - a stable identity for that specific module instance, a label, a sort order, named channels (result, source, before, after), and a status. Channels hold references to images that already exist upstream; registering doesn't copy pixels.
CMK Preview & Compare walks that registry and picks a provider to display. It prefers a provider that has both a before-ish channel (before or source) and an after-ish channel (after or result) - that's the one that can actually show a comparison - and otherwise falls back to the last provider in the chain that has any channels at all. It then filters the pipe down to just that provider and hands off to the Visualizer for the actual rendering, so you get the same presentation surface minus the saving and upscaling controls.
Two mechanics are worth knowing because they explain behaviour that otherwise looks odd:
VISUALis declared lazy, andcheck_lazy_statusskips requesting it entirely when the gate is off. That's how the optionalenableinput can mute the display without forcing the upstream chain to evaluate. Turning the compare off genuinely costs nothing.IS_CHANGEDreturnsfloat("NaN"). That's the standard ComfyUI idiom for "always dirty" - NaN never equals itself, so the engine re-runs the node every execution. Which is correct for a display node: you want the panel refreshed after every run, not served from cache.
Inputs and outputs
VISUAL(CMK_VISUAL_PIPE, required) - the accumulated visual chain. Wire it from the last module in the branch you care about, or from aCMK Visual Provider -Pipe-you placed deliberately.enable(BOOLEAN, optional, wire-only) - a gate driven by an upstream boolean rather than a widget. Off means the node renders disabled and doesn't pull the chain.
And that's the lot - this node has no outputs at all. It's an output node by construction; the comparison is the product. If you need the image onward, take it from the module that produced it, not from here.
The press-and-hold interaction and the provider selection state are frontend presentation only. They don't touch prompts or processing pipes, and they don't invalidate upstream modules - so flipping between before and after never causes a regeneration.
Install
Manager → search CMK Flow → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/CMKFlow/cmk_nodes
python3 custom_nodes/cmk_nodes/scripts/install_cmk_requirements.py
Expect CMK dependency check: OK, then restart. Two settings matter for this node specifically: the Vue Nodes / Nodes 2.0 ComfyUI setting must be on (CMK warns at startup otherwise, and the dynamic node rendering, dropdowns and auto-sizing fall back to legacy LiteGraph without it), and for live previews during sampling you want Comfy → Execution → Live preview method set to auto. No models needed here.
Common issues
- The node shows one image and no comparison. The provider it selected only had one channel. A comparison needs a provider that published both sides - typically the module you'd expect (an upscaler, a detailer, a face pass) rather than the bare result. Check what's on the
VISUALchain upstream. - Nothing renders at all. Either the visual chain is empty (a bypassed or disabled module registers no provider - that's deliberate: CMK treats a provider as evidence of an actual image signal), or the node isn't receiving a valid
VISUALpipe. A pipe from a non-CMK source will raise a type error. - The old "CMKImageCompare" node. Different thing. That's the pack's internal dependency-free two-image preview used inside shipped subgraphs, and its output goes forward as an image. Preview & Compare is the standalone visual-pipe endpoint.
- The comparison resets between runs. Expected. A new ComfyUI execution discards the previous presentation history.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| VISUAL | CMK_VISUAL_PIPE | — | |
| enableopt | BOOLEAN | — |
Outputs (0)
No outputs