预览图像(内循环用)
PreviewImageLam
- images
- images
Stock ComfyUI has a hard rule that trips up every loop builder eventually: a PreviewImage node marked as an output node ends the branch. Attach one inside a loop's body and the loop logic chokes, because the output node wants to finalize the flow right there. PreviewImageLam (预览图像(内循环用), "preview image, for inner loops") is the fix - a preview node that also passes the images through, so you can look at what a loop just produced without the graph treating it as the end of the line.
The display name says it all: 内循环 means "inner loop," and that's precisely the design target. The lam pack ships a whole loop system - ForStart/ForEnd, DoWhileStart/DoWhileEnd - with example workflows like 漫画内循环.json (manga inner loop) built around iterative passes. When you're generating frame-by-frame or region-by-region inside a loop, you want to see each iteration as it lands. This node lets you do that and keep feeding the result onward.
How it works
Under the hood it subclasses ComfyUI's own SaveImage and writes to the temp folder (the same place stock PreviewImage puts files), showing the preview in the UI. The crucial differences from stock are two small lines: it sets OUTPUT_NODE = False (so it doesn't terminate the flow) and returns the images in its result (RETURN_TYPES = ("IMAGE",)), so the graph can carry on. Practically: image in, preview in the browser, same image out the right side of the node.
Inputs and output
images- theIMAGEyou want to inspect.- Output:
images- the identicalIMAGE, passed straight through.
Install
In yanlang0123/ComfyUI_Lam - Manager search "ComfyUI_Lam", or:
cd ComfyUI/custom_nodes
git clone https://github.com/yanlang0123/ComfyUI_Lam
restart. It lives in the image category. No models, no extra deps - it's a thin wrapper around ComfyUI's own save machinery.
Where people get tripped up
The main surprise is that this is a preview, not a save - files go to the temp directory and get cleaned up eventually, so don't use it when you need permanent output (that's what SaveImageLam, the pack's through-putting save node, is for). And while it won't kill your loop, a preview inside a hot loop still writes a PNG per iteration, which slows a 100-iteration run more than you'd think; for production loops, mute or bypass it. For anything where you're debugging iterations, though, it's the node that turns a blind loop into something you can watch - and that's worth a lot.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |