Nodes/deforum-comfy-nodes/Smart Loop Preview Image | Deforum
ComfyUI Node

Smart Loop Preview Image | Deforum

Preview frames inside a loop without filling your disk

By deforum·Created about a year ago·Updated 3 months ago· 29
Smart Loop Preview Image | Deforum
  • images
  • images

The official description - "saves the input images to your ComfyUI output directory" - undersells what this node actually exists for. Smart Loop Preview Image | Deforum is a SaveImage that was designed for the one place a normal save node becomes a disaster: inside a frame loop. Run a loop that writes 600 frames with a plain SaveImage and you get 600 PNGs and a folder you're afraid to open. This node writes previews while keeping only a sliding window of the most recent ones, so you can watch an animation render without it eating your disk.

The input is images (an IMAGE), and the output is the same images passed through untouched. The node is marked as an output node, so it always runs and its preview shows up in the UI like a normal SaveImage - but it's also a pass-through, which is the trick that lets it sit inline in a loop without disturbing the data flow. What it does on the side: it tracks how many times this particular node instance has run, appends that iteration number to the filename, saves the frames to ComfyUI's temp directory, and then deletes the previews from the oldest iterations, keeping a small window (one) so you see current progress without accumulating garbage.

There's a real reason this matters beyond tidiness. In the loop-based animation model this pack is built on, each iteration re-runs the same nodes - and a normal SaveImage inside that loop writes a file every single pass, forever. Iteration 1,000 of a workflow writing the same filename over and over is also a race on your output folder. The smart loop preview sidesteps both: it renames each pass with its iteration number so you can see progress in the filename, merges the previews in the UI, and cleans up after itself. It even stamps loop_iteration into the PNG metadata if metadata is enabled, which is handy when you're hunting for the frame where an animation went off the rails.

Two practical notes. First, it saves to ComfyUI's temp directory, not your main output folder - that's deliberate (temp gets cleared on restart), but don't go looking in output/ for these previews. Second, it keeps only the most recent previews by default; if you want to keep every frame, this isn't the node for it - use a normal SaveImage for final output, and this one for watching the loop live. The pass-through output means you can chain it after a save node or use it purely as a monitor.

Installation is the pack: ComfyUI Manager → search "ComfyUI-Deforum" or deforum-comfy-nodes → install and restart, or git clone https://github.com/deforum-art/deforum-comfy-nodes into ComfyUI/custom_nodes and restart. No model downloads, no extra Python dependencies. The repo was at XmYx/deforum-comfy-nodes before moving to the deforum-art org, in case old links look unfamiliar. If you've ever watched a loop silently fill a hard drive with PNGs, this is the node that stops you from reliving it.

CategoryDeforum/Image

Inputs (1)

NameTypeDefaultDescription
imagesIMAGE

Outputs (1)

NameTypeDescription
imagesIMAGE