Nodes/Deforum Nodes/(deforum) Save Video
ComfyUI Node

(deforum) Save Video

The node that turns your frame stream into an actual video file

By XmYx·Created 3 years ago·Updated 3 months ago· 198
(deforum) Save Video
  • image
  • deforum_frame_data
  • audio
  • waveform_image
  • IMAGES
  • VIDEOPATH
filename_prefixDeforum
fps24
codec
pixel_format
format
quality10
dump_by
dump_every0
dump_nowfalse
skip_savefalse
skip_returntrue
enable_previewtrue
restorefalse
clear_cachefalse

Every Deforum workflow ends at this node. The whole point of animating a few hundred frames is to get a playable file at the end, and (deforum) Save Video is the output node that writes it. Feed it your generated frames, it buffers them, and when the run hits its target length it hands the stack to ffmpeg and produces an mp4 (or mov, gif, avi) with the codec and fps you asked for. If you've used Deforum in A1111 this is the "save video" step made visible - in ComfyUI it's just another node on the graph.

How it works

The node caches every frame it receives as a PNG into a temp directory, one file per frame. It keeps doing that across the whole animation run - that's why the same node instance can survive hundreds of queue executions - and only encodes once the dump condition triggers. By default it dumps when the number of cached frames reaches max_frames, which it reads out of the deforum_frame_data it's fed (that value comes from your animation parameters further up the graph). Alternatively you can set dump_by to per_N_frames and control it with dump_every directly.

When it dumps, it encodes the whole frame cache through ffmpeg (imageio-ffmpeg/moviepy under the hood), and if you've wired an AUDIO into the optional audio input it muxes that in as the soundtrack. That's how you get a music video instead of a silent animation.

The inputs that actually matter

  • fps - frames per second of the output. Default 24; if your animation was made at a different cadence, this is where you fix playback speed.
  • codec and format - libx264/libx265/libvpx-vp9/libaom-av1/mpeg4/libvpx for codec, mp4/mov/gif/avi for container. Default-minded: mp4 + libx264 is the safe combo; gif only if you really want a gif (it's huge and lossy).
  • filename_prefix - the name prefix for the output file in ComfyUI/output.
  • quality - 1–10, higher is better; for H.26x this roughly maps to the encode quality.
  • skip_save / skip_return - the two toggles people trip over. skip_save off means it will write the file; skip_return off makes the node also hand the whole frame stack back as IMAGES (handy if you want to chain to interpolation, but memory-heavy on long runs).
  • clear_cache - wipes the accumulated frames after dumping, so the next run starts clean.

Outputs are IMAGES (the full stacked tensor, when skip_return is false) and VIDEOPATH (a string pointing at the file that was just written - wire it to a Show Text node to confirm where things landed).

Installing it

This is one node in the Deforum Nodes pack (by XmYx). The easiest route is ComfyUI Manager: search "Deforum Nodes" and install. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/XmYx/deforum-comfy-nodes.git

Then restart ComfyUI. On first load the pack's install.py runs and pip-installs a heavy dependency list (librosa, opencv-contrib-python, moviepy, pydub, pandas, numpy<2.0.0, plus the deforum-studio backend from git). That first launch can sit there for a few minutes - that's normal. The README is blunt that you should be on Python 3.10 or the nodes won't work.

Where people get burned

The most common "it didn't save anything" is a misread of the dump logic: if the run never reaches max_frames (or dump_every if you switched), nothing gets encoded and no file appears. Also watch the combo of skip_save + clear_cache - if you're clearing the cache every frame, you're throwing away frames before they can be encoded. And these nodes track ComfyUI's internals closely; after a big ComfyUI update the pack can stop loading entirely (there's a real 2025 report of exactly that). When it happens, git pull inside the custom_nodes folder and re-run install.py before you go hunting for a different pack.

Categorydeforum/video

Inputs (18)

NameTypeDefaultDescription
imageIMAGE
filename_prefixSTRINGDeforum
fpsINT241–10000
codecCOMBO6 options: libx265, libx264, libvpx-vp9, libaom-av1, mpeg4, libvpx
pixel_formatCOMBO10 options: yuv420p, yuv422p, yuv444p, yuvj420p, yuvj422p, yuvj444p, +4
formatCOMBO4 options: mp4, mov, gif, avi
qualityINT101–10
dump_byCOMBO2 options: max_frames, per_N_frames
dump_everyINT00–4096
dump_nowBOOLEANfalse
skip_saveBOOLEANfalse
skip_returnBOOLEANtrue
enable_previewBOOLEANtrue
restoreBOOLEANfalse
clear_cacheBOOLEANfalse
deforum_frame_dataoptDEFORUM_FRAME_DATA
audiooptAUDIO
waveform_imageoptIMAGE

Outputs (2)

NameTypeDescription
IMAGESIMAGE
VIDEOPATHSTRING