Nodes/ComfyUI LC123 Nodes/LC Preview Image ๐Ÿ–ผ๏ธ
ComfyUI Node

LC Preview Image ๐Ÿ–ผ๏ธ

The preview that doesn't throw a fit when the branch is muted

By lonecatone23ยทCreated 2 months agoยทUpdated about 7 hours agoยท 22
LC Preview Image ๐Ÿ–ผ๏ธ
  • image
  • image

If you build graphs with optional branches, you know the drill. You mute the upscale path, or the refiner, or whichever half you're not testing today, and ComfyUI's stock Preview Image stops the queue with "required input missing" or a null crash. Nothing is wrong with your image - the branch just isn't feeding anything, and the node refuses to accept that.

LC Preview Image takes the optional input route. Nothing connected, a muted node upstream, a null, or an empty batch - it sits there with an empty preview window and lets the rest of the graph run. That's the entire feature, and if you use optional sockets it's a big one.

How it works

It subclasses ComfyUI's own PreviewImage, so writing the preview out is the same code path - the PNGs go to ComfyUI/temp/ with an LC.preview prefix, same as the core node, just under the pack's own UI key so the stock preview widget doesn't fight the LC window.

The difference is the guard. Before doing anything it checks whether it's holding a real, non-empty tensor. If it isn't, it returns nothing - actually an ExecutionBlocker, on modern ComfyUI - and that's the clever half. A blocker tells the executor "skip everything downstream of me, quietly", so a chain of nodes after this one doesn't run and doesn't eat a None and die. No signal in, no error out, no downstream noise.

It also passes the image through: image in, image out. Batches show the first frame in the preview window.

Inputs and outputs

One optional input: image. Deliberately optional - that's the whole design. One output: image, so you can daisy-chain previews through a pipeline and watch the image at each stage.

The window is the standard LC one: 300 wide, 268ร—335 preview, 16px padding, and it launches in the pack's teal so you can tell it from a core preview at a glance.

Install

Manager โ†’ ComfyUI LC123 Nodes, or:

cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes.git

Restart ComfyUI. No dependency step - it's a thin subclass of core PreviewImage plus a small lc_preview_nodes.js for the window. Hard-refresh the browser after a pack update or you'll get the old JS.

Common issues

It shows nothing and I want it to complain. That's backwards from most nodes but worth saying: this node will never tell you a wire is missing. If your image isn't appearing, check the upstream branch yourself - a muted node, a switch pointing at an empty slot, or a LoRA-stack apply node that passed a null through.

Where did the image go? ComfyUI/temp/, not output/. These are scratch files, and the directory is meant to be cleared. If you generated something worth keeping while iterating on a preview, it may already be gone - a preview is not a save. Swap in a real save node before a run you care about.

Preview looks stale after changing upstream settings. ComfyUI caches aggressively and works backwards from output nodes; this node is an output node, so it always runs, but the node feeding it might not have re-executed. Change one thing at a time with a locked seed and the cache stops lying to you.

It renders oddly, or the window is blank/black. Almost always the browser, not the node - clear the cache or hard-refresh. If it persists, check the console for a JS error; a half-loaded pack update is the usual cause.

"Why not just use the core Preview Image?" Because you don't use optional branches, or you don't mute things mid-session. If neither is true for you, the core node is fine and you don't need this. The moment you start commenting out half a graph to test the other half, you'll want it.

CategoryLC123/image

Inputs (1)

NameTypeDefaultDescription
imageoptIMAGEImage to show. Nothing connected or a null signal is fine: the node just waits.

Outputs (1)

NameTypeDescription
imageIMAGEโ€”