Nodes/Difforum/Difforum · Save Video (MP4)
ComfyUI Node

Difforum · Save Video (MP4)

Write your frame batch to an MP4, no external video nodes

By chillithebillis·Created 3 months ago·Updated about a month ago· 7
Difforum · Save Video (MP4)
  • frames
  • path
filename_prefixDifforum_vj
fps24
quality8
fps_in
pingpongfalse

The last node in almost every Difforum pipeline: Save Video (MP4) takes an IMAGE batch and writes it to an h264 MP4 in ComfyUI's output folder, using imageio-ffmpeg. It closes the loop the pack's VJ template depends on - footage in, graded MP4 out, no checkpoint and no external video helper nodes anywhere in the graph.

The outputs are refreshingly boring: a path STRING pointing at the file it wrote. Filenames auto-increment (Difforum_vj_00000.mp4, then _00001, …), so you never overwrite a previous render by accident. That's the kind of small courtesy that saves real pain when you're iterating.

The inputs that matter

  • frames - the batch to write. Any IMAGE batch: feedback render frames, graded footage, a storyboard.
  • filename_prefix - what the file is called (the incrementing counter is appended).
  • fps - playback rate (default 24; up to 120).
  • quality - 1 to 10, default 8. Lower is smaller, higher is cleaner; 8 is a fine default and most people never move it.
  • fps_in (optional) - a wired-in frame rate, so you can match the source clip's fps (e.g. from Load Video's fps output) instead of hardcoding it. Wire it once and the round trip keeps its speed.
  • pingpong (optional) - append the reversed half of the batch before writing. It's the Ping-Pong Loop node, built into the writer for people who'd rather do it at write time.

How it works under the hood

Each frame gets written through ffmpeg (via imageio-ffmpeg) into an h264 MP4. It's an output node, so it renders to the UI as well as returning the path - you get a text readout of exactly where the file landed. If your batch has only a few frames, you still get an MP4; there's no minimum-length gate.

Install and gotchas

Same one-pack install as everything else here:

cd ComfyUI/custom_nodes
git clone https://github.com/chillithebillis/Difforum.git difforum

Restart ComfyUI - console shows [Difforum] loaded N nodes (ComfyUI Manager: search "Difforum"). The video writer needs imageio-ffmpeg, which is almost always already installed in ComfyUI; if you get an import error, pip install imageio-ffmpeg into your ComfyUI environment fixes it.

Two honest caveats. First, this is a functional writer, not a compression workbench - it makes a clean h264 MP4 and stops there; for pro-level encoding you'll still transcode elsewhere. Second, the fps_in vs fps relationship confuses people: if both are set, fps_in wins. Leave fps at 24 and wire fps_in when you care about matching source speed, or just leave both alone and take the 24fps default.

CategoryDifforum/video

Inputs (6)

NameTypeDefaultDescription
framesIMAGE
filename_prefixSTRINGDifforum_vj
fpsFLOAT241–120
qualityINT81–10
fps_inoptFLOAT
pingpongoptBOOLEANfalse

Outputs (1)

NameTypeDescription
pathSTRING