Nodes/ComfyUi-MpiNodes/Mpi Save Video
ComfyUI Node

Mpi Save Video

The fastest way to get a generated video out of ComfyUI

By MadPonyInteractive·Created 11 months ago·Updated 5 days ago· 3
Mpi Save Video
  • images
  • audio
  • video_path
fps24.00
filename_prefixMpiVideo
use_audiotrue
truncate_to_audiofalse

The standard ComfyUI video pipeline is VHS_VideoCombine, which goes through a latent preview encoder and a file-picker UI you mostly don't want. MpiSaveVideo is the stripped alternative: feed it an IMAGE batch (plus optional AUDIO) and it writes a single .mp4 in one libx264 pass. No in-graph preview, no VHS parameter surface, no GPU dependency - just a fast, boring encoder at the end of your video generation.

Why does "fast" actually matter here and not just feel nice? Because every other node in the chain is GPU work, but encoding is CPU work that can stall the whole pipeline. This node streams frames straight into ffmpeg's stdin one at a time instead of buffering the entire raw video in RAM - the source notes that .tobytes() on a multi-GB clip could double memory usage, and the frame-by-frame write keeps peak overhead to a single frame. For remote/cloud generation there's a second win: you only transfer the final mp4, never the raw frame batch.

The inputs that matter

  • images - the frame batch. Output of your VAE decode, usually.
  • fps - default 24, range 1–120. Set it to match your model's native fps (video models have their own, usually 24 or 16).
  • filename_prefix - default MpiVideo. Saved as MpiVideo_00001.mp4 style into your output folder.
  • use_audio (optional, default on) - off ignores the audio input entirely. The point: wire audio straight in, and toggle it with one boolean instead of building an if/else router around it.
  • truncate_to_audio (optional, default off) - on means -shortest semantics, so a short audio track trims the video down to the audio's length. Off keeps the full video and pads short audio with silence to match.
  • audio - the AUDIO object, only used when use_audio is on and it actually carries samples.

It has no outputs - it's a terminal output node.

Install

Part of ComfyUi-MpiNodes. ComfyUI Manager (search "MpiNodes" / publisher "mad-pony-interactive") or:

cd ComfyUI/custom_nodes
git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes

Restart. The one real dependency is ffmpeg, which it finds via the imageio-ffmpeg bundle, VHS_FORCE_FFMPEG_PATH, or PATH. If you already run VHS, you have this.

What bites people

No ffmpeg found → a hard RuntimeError at save time; if you see it, install ffmpeg or point VHS_FORCE_FFMPEG_PATH at it. Also know the encoder is intentionally simple: libx264 at CRF 18, yuv420p, no nvenc - so it's GPU-agnostic but also not GPU-accelerated, and odd resolutions get silently cropped to even dimensions (that's the crop=trunc(iw/2)*2 in the pipeline, which exists because libx264/yuv420p require even dims). If your video is 2899 wide, the last pixel column vanishes - usually invisible, but it's why MpiRoundToMultipleRes is a sensible upstream neighbor.

CategoryMpiNodes/Video

Inputs (6)

NameTypeDefaultDescription
imagesIMAGE
fpsFLOAT24.001–120
filename_prefixSTRINGMpiVideo
use_audiooptBOOLEANtrueOff = ignore the audio input and encode video-only. Lets you toggle audio with one boolean — wire audio straight in, no if/else router needed.
truncate_to_audiooptBOOLEANfalseOn = end the clip when the audio ends (shorter audio trims the video). Off = keep the full video and pad the audio with silence to match.
audiooptAUDIO

Outputs (1)

NameTypeDescription
video_pathSTRING