XImagePreview
A preview node that doesn't explode when there's nothing to show
- images
- image_or_mask
Every ComfyUI user hits this eventually: you build an optional branch with a gate or a switch, a PreviewImage sits at the end of it, and the moment that branch produces nothing the whole run dies with an error about None. Stock preview nodes have zero tolerance for an empty input. XImagePreview exists specifically so you can preview a value that might not be there, without the workflow falling over.
How it works
It's a passthrough preview with a safety net. Feed it an optional images input that accepts either an IMAGE or a MASK (a 4D tensor previews as an image, a 3D/2D one as a mask, using ComfyUI's own PreviewImage / PreviewMask rendering). With a value present, you get the normal preview in the UI and the value is passed through the image_or_mask output unchanged.
When the input is unconnected or arrives as None, the node doesn't error - it just shows a small text notice ("No image or mask information") in the UI and passes None along. That single behavior is the whole point. It's an output node, so it marks the end of a chain, but because it also passes through, you can drop it inline in a wire to peek at what's flowing without rerouting anything.
Why this exists
Read the pack's changelog and you'll see the author built it for a specific reason: XImageCompare, the pack's fancy A/B comparison node, has a custom frontend that can't shrink small enough for every layout. So this is the compact fallback - a preview that takes up almost no space and behaves well in the optional branches that XImageCompare-style big-UI nodes can't survive. It also carries search aliases like "preview", "show image" and "mask viewer", so typing any of those in the node menu will find it.
Installing it
XImagePreview ships in ComfyUI-Xz3r0-Nodes (by Xz3r0-M) under the ♾️ Xz3r0/Workflow-Processing menu. Through ComfyUI Manager, search ComfyUI-Xz3r0-Nodes and install. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Xz3r0-M/ComfyUI-Xz3r0-Nodes.git
cd ComfyUI-Xz3r0-Nodes
pip install -r requirements.txt
Then restart ComfyUI. No models, no heavy dependencies - this is a small frontend node, and it's one of the pack's pure-Python nodes with no FFmpeg involvement.
Gotchas
Don't expect it to replace a real preview node for quality - it renders through the stock preview UI, so the pixels you see are exactly what PreviewImage would show, just with better manners about None. If you're using it at the end of a gate and the workflow still errors, double-check the thing upstream of the gate is what's failing; this node's job is specifically to not be that. One more quirk worth knowing: because it's an output node, an empty one will show "No image or mask information" on every run - that's not an error, that's the feature.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| imagesopt | COMFY_MATCHTYPE_V3 | Optional image or mask input. Leave unconnected or receive None to show a text notice instead of previewing. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image_or_mask | COMFY_MATCHTYPE_V3 | Passthrough of the input image or mask, or None when no input is available |