AIMZ Preview Image (None Safe)
A PreviewImage that doesn't explode when there's nothing to show
- images
- images
ComfyUI's stock PreviewImage node is great until the moment it isn't. The moment is when some upstream branch legitimately produces no image - an optional branch that's empty, a video frame batch that came back None - and instead of showing you nothing, the node dies with a TypeError: 'NoneType' object ... and kills the whole run. AIMZ Preview Image (None Safe) is a drop-in replacement that simply skips cleanly when there's nothing to preview, and also passes the image through so your graph can keep going.
That's it. That's the whole selling point, and in the dynamic-branching workflows this pack is built for, it's the difference between a graph that runs and one that aborts on an empty Tuesday.
How it works
The backend logic is a polite version of the core preview: if the images input is None, or isn't a real tensor, or is an empty batch, it returns an empty preview result and passes None through - no exception, no red node. If there is an image, it saves previews to ComfyUI's temp directory exactly like the stock node, and - here's the part that makes it worth using even when everything works - it also returns the image.
Stock PreviewImage is an output node: it consumes images and shows them, but it has no image output, so it has to be the end of a line. This one's output is the image itself, so you can drop it in the middle of a chain, peek at what's flowing through, and keep the wire going. One node does preview and passthrough at once.
The input and output
One input, images (optional). One output, images - same tensor that came in, untouched. If you're using it purely as a preview, just wire the input and ignore the output. If you want to inspect mid-graph, wire the output onward.
Installing it
Part of the ComfyUI_AIMZ pack. In ComfyUI Manager → Custom Nodes Manager, search comfyui_aimz or AIMZ, Install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/AIMZ-GFX/ComfyUI_AIMZ.git
No model files, no dependencies beyond what's already installed.
Where people get tripped up
The easy trap is expecting it to fix a branch that's empty. It doesn't - if your upstream genuinely produced nothing, this node quietly shows nothing and passes None on. Whatever comes after still has to be able to handle None, or the crash just moves downstream. The point of the node is that you get to choose where the None-safe boundary is, instead of being forced into one by the preview.
Also worth noting: it writes its previews to the temp directory, same as the core preview node, so preview images still get cleaned up on restart. And if you're comparing two branches side by side, you'll still want the core preview or an image-comparer node for that - this one is about not crashing and not breaking the chain, not about fancy UI.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| imagesopt | IMAGE | Optional image input. If None, cleanly skips without error. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |