Nodes/Dehypnotic/🧘 Save Video (Dehypnotic)
ComfyUI Node

🧘 Save Video (Dehypnotic)

Get a real MP4 out of ComfyUI (and the frames, too)

By DehypnoticΒ·Created about a month agoΒ·Updated 20 days agoΒ· 7
🧘 Save Video (Dehypnotic)
  • images
  • audio
  • video
  • images
  • video_path
β—„file_pathoutput/videoβ–Ί
β—„date_subfolder_pattern%Y-%m-%dβ–Ί
β—„filename_prefixVIDβ–Ί
β—„filename_delimiter_β–Ί
β—„preview_onlyoffβ–Ί
β—„number_padding4β–Ί
β—„number_start1β–Ί
β—„containermp4β–Ί
β—„video_codech264β–Ί
β—„fps24β–Ί
β—„crf23β–Ί
β—„presetfastβ–Ί
β—„loop_still_to_audiotrueβ–Ί
β—„show_progresstrueβ–Ί

ComfyUI is great at producing 97 frames of video and weirdly bad at the moment you have to turn those frames into a file you can actually send someone. The stock Save Video node gets you there, but it's minimal. Save Video & Frames (Dehypnotic) is what you reach for when you want a proper MP4 (or MKV, WebM, MOV) with real codec choices, an optional still-frame export, and an optional audio track, all in one output node.

How it works

It pipes your IMAGE batch as raw RGB frames straight into ffmpeg via stdin and writes the encoded file to disk. No system-wide ffmpeg install needed - it uses the static binary bundled by imageio-ffmpeg, auto-downloaded on first run. Feed it an optional AUDIO input and it writes a temp WAV and muxes it in. Two mechanical details worth knowing: frames are padded to even dimensions (H.264 and friends demand even sizes), and container/codec pairing is enforced - pick VP9 inside an MP4 and it refuses, printing the allowed list. MP4 takes h264/h265/av1; WebM takes vp9/av1; ProRes and DNxHR are MOV-only.

The inputs that matter

  • images - the frame batch from your sampler/VAE decode.
  • fps - constant frame rate; 24 is the sane default.
  • container and video_codec - mp4 + h264 is the right starting point for anything you'll post. WebM/VP9 or AV1 shrink files but encode slowly (the code gives AV1 -cpu-used 6 and row-mt to speed it up, but don't expect miracles).
  • crf - quality, lower = better and bigger; 18–28 is typical for H.264.
  • preset - ultrafast β†’ veryslow; the default fast is a fine balance.
  • save_mode - video, frames, or video & frames.

The frame export is where this node quietly beats the core one. Set frames_dir and frames_select (-1 = all, -2 = last, 0 = first, or a comma list like 0,5,10). Default is -2, which exports only the last frame - mildly surprising the first time you use it. And loop_still_to_audio is a neat trick: one frame plus an audio track gets looped to match the audio length, giving you a slideshow-style export.

Outputs: images (the batch passed through, so you can keep chaining) and video_path (STRING, the full saved path - or the frame folder when you only export frames). It's flagged as an output node, so it can terminate the graph. show_preview dumps a temp image sequence into the UI result while you're tuning, and show_progress prints the ffmpeg command and progress to the console - leave it on during setup.

Install

Via ComfyUI Manager (search "Dehypnotic Save nodes"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/Dehypnotic/comfyui-dehypnotic-save-nodes

Restart ComfyUI. The pack ships with no requirements.txt, so this node's only real dependency is Python packages imageio and imageio-ffmpeg. If they're missing it fails at run time with install guidance:

pip install imageio imageio-ffmpeg

Common issues

  • Codec-not-in-container error - pick a pairing the node lists; it tells you the allowed set.
  • Saving to an external drive fails. All three Dehypnotic save nodes refuse to write outside ComfyUI's output/ folder unless you whitelist a root. Create dehypnotic_save_allowed_paths.json in your ComfyUI root (or config/, user/config/) with {"allowed_roots": ["D:/VideoExports"]}, or point the DEHYPNOTIC_SAVE_ALLOWED_PATHS env var at it. The error message spells out the locations.
  • Heads up: this repo's README announces it will be deleted - the updated home is Dehypnotic/ComfyUI-Dehypnotic, and the node keeps the same class name, so migrating is a drop-in swap and your saved workflows keep loading.
CategoryDehypnotic/πŸ’Ύ IO

Inputs (17)

NameTypeDefaultDescription
file_pathSTRINGoutput/videoFolder where the video is saved.
date_subfolder_patternSTRING%Y-%m-%dOptional strftime pattern or placeholders for subfolders.
filename_prefixSTRINGVIDFilename prefix, e.g. VID_0001.mp4.
filename_delimiterSTRING_Delimiter between prefix and sequence number.
preview_onlyCOMBOoffSkip saving video file to disk while keeping player preview functionality.
number_paddingINT41–10Digits in the sequence number (0001, 0002, ...).
number_startINT10–1000000Starting value for the sequence number.
containerCOMBOmp4Container format (mp4, mkv, webm, mov).
video_codecCOMBOh264Video codec to use for encoding.
fpsFLOAT241–240Frames per second (CFR).
crfINT230–51Quality (lower = better, larger files). Typical 18-28 for H.264.
presetCOMBOfastEncoder speed versus quality (ultrafast ... veryslow).
imagesoptIMAGEOptional frame input. Batch data supported.
audiooptAUDIOOptional audio track. Mono/stereo supported.
videooptVIDEOOptional video input (video file path, video tensor batch, video dictionary, or VHS_VIDEO).
loop_still_to_audiooptBOOLEANtrueIf only one frame plus audio, loop the frame to match audio length.
show_progressoptBOOLEANtrueWrite progress information to the console.

Outputs (2)

NameTypeDescription
imagesIMAGEβ€”
video_pathSTRINGβ€”