Nodes/XENodes/Save Video
ComfyUI Node

Save Video

Codec-level control over your video saves — AV1 included

By xeinherjer-dev·Created 6 months ago·Updated a day ago· 2
Save Video
  • video
  • video
filename_prefixvideo/ComfyUI
format
loop_count0
pingpongfalse

Stock ComfyUI's video save is fine until you want a specific codec or a specific size. Save Video exists for exactly that: it takes a VIDEO input and re-encodes it with the codec, CRF, and audio track you pick, independently of core's save_to. The headline is AV1 - far smaller files for the same quality, which is what you want when a 5-second clip is otherwise 40MB - but you get H.264, H.265, and NVENC hardware variants too, each with its own CRF default.

Mechanically, this node is a thin, well-behaved wrapper around ffmpeg. It streams raw frames to an ffmpeg subprocess over a pipe (chunked so memory stays sane), so there's no temp file, and it muxes audio alongside it. It finds ffmpeg in your PATH first, then falls back to the imageio-ffmpeg exe the pack declares as its dependency. Quality settings map to real encoder flags: CPU codecs get -crf, NVENC variants get VBR with -cq, H.265 and AV1 encode at 10-bit (yuv420p10le/p010le) for banding-free gradients, and H.264 stays at 8-bit for compatibility. There's even a per-run timing breakdown printed to the console if you like knowing where the seconds went.

The inputs that matter:

  • video - the VIDEO you want to save (frames + audio).
  • format - mp4 or webm. The codec/audio options change to match; WebM won't offer AAC, for instance.
  • codec - h264, h265, av1, or the *_nvenc variants (h264_nvenc, hevc_nvenc, av1_nvenc), each with a CRF slider. Defaults: h264 23, h265 28, av1 42 - lower CRF = higher quality/bigger file.
  • audio_codec - aac, opus, or flac, with a bitrate dropdown (default 128k). Only appears when the source has audio.
  • loop_count (default 0) and pingpong (boolean) - loop physically repeats the frames for mp4/webm, so the file itself loops rather than a player doing it. Pingpong plays forward then backward. (Looping is for stills/animation sequences; "images only" per the tooltip.)

The video output passes your input straight through - another "save a copy here" tap that doesn't kill the branch.

Install is the pack standard:

cd ComfyUI/custom_nodes
git clone https://github.com/xeinherjer-dev/ComfyUI-XENodes.git xenodes

or search "ComfyUI-XENodes" in ComfyUI Manager, then restart. The one real dependency: ffmpeg. The pack will try imageio-ffmpeg as a fallback, but for reliable AV1 and audio muxing, have a real ffmpeg in PATH - ffmpeg -version to check, apt install ffmpeg / winget install ffmpeg to fix.

Where people get burned: the node raises a clear "FFmpeg executable not found" if it can't find one - that's the #1 first-run error, and it's an environment problem, not a node problem. Second, AV1 with the CPU encoder (libsvtav1) is slow; preset 6 balances speed and size, but a long clip will churn. If you're iterating, use H.264 or an NVENC codec and save AV1 for the final export. Also remember the pack loads as one unit - if no XENodes nodes appear, check the console for a sibling import failure (SaveAudio imports PyAV's av).

Categoryxenodes/video

Inputs (5)

NameTypeDefaultDescription
videoVIDEOThe video to save (supports both SDR and 10-bit HDR videos).
filename_prefixSTRINGvideo/ComfyUIThe prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes.
formatCOMBOThe format to save the video as.
loop_countINT00–100Loop count. 0 = play once. For mp4/webm, this physically repeats the frames.
pingpongBOOLEANfalsePingpong animation (images only). Plays frames forward then backward.

Outputs (1)

NameTypeDescription
videoVIDEO