XVideoSave
Save video as H.265/HEVC with real quality control and your workflow embedded in the file
- video
The default video-saving story in ComfyUI has been thin for a long time: you get a file, but codec and quality control are someone else's problem. XVideoSave fixes that with a proper ffmpeg-backed save node that encodes to H.265/HEVC (10-bit, yuv444p10le), copies your audio stream without re-encoding it, and embeds the workflow metadata right into the file so ComfyUI can read it back.
That metadata bit matters more than it sounds. In the ComfyUI culture, "workflow included" is a community norm - you drag an image back in and the whole pipeline reconstructs. XVideoSave does the same for video: it writes the prompt and workflow info into the container, so your saved clip carries its recipe along with it.
How it works
The node takes a VIDEO object, pulls out its frames, audio, and fps, and does the work in stages. Frames get piped raw into ffmpeg with libx265; audio (if present) is written to a temp WAV and then muxed with acodec copy - no re-encode, so the original quality survives. Finally it writes metadata (prompt + extra_pnginfo) into the container and returns a video preview in the UI.
The two container options split the difference:
- MP4 (default) - routes through ComfyUI's official video API so metadata comes out the way the web UI expects. Best for sharing and for re-loading the workflow from the file.
- MKV - prioritizes lossless compatibility when you're keeping the file for editing or archival.
The inputs that matter
- crf - the quality knob, 0–40. Default is 0, which is lossless. If you're saving for delivery, that's usually overkill - files get enormous. Most people land around 18–23 for a good size/quality balance.
- preset - encoding speed vs. compression, ultrafast to veryslow.
mediumis the default and a sane place to start; slower presets shrink files but eat wall-clock time. - filename_prefix and subfolder - support datetime tokens like
%Y%,%m%,%d%,%H%,%M%,%S%(note the unusual%token%syntax). The default prefix stamps a timestamp. Subfolder defaults to "Videos", is single-level only, and path separators are not allowed. - container - MKV or MP4 as above.
The node is an output node with no data outputs; its result shows up as a preview, and the file lands in ComfyUI's output directory under your subfolder. A sequence number is auto-appended so it never silently overwrites an existing file.
Installing
Ships in ComfyUI-Xz3r0-Nodes. ComfyUI Manager → search "ComfyUI-Xz3r0-Nodes" → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Xz3r0-M/ComfyUI-Xz3r0-Nodes.git
cd ComfyUI-Xz3r0-Nodes
pip install -r requirements.txt
Restart ComfyUI. The Python side is just ffmpeg-python - but the real requirement is FFmpeg installed on your system PATH. The README is explicit: without FFmpeg, XVideoSave (and XAudioSave) simply won't work. Install it, verify ffmpeg -version runs, then restart.
Gotchas
- FFmpeg missing = node fails. This is the #1 reason XVideoSave errors on a fresh install. It's a system dependency, not a pip one, so
pip install -r requirements.txtwon't save you. - CRF 0 by default means giant lossless files. If your output directory suddenly fills up, this is why. Dial crf up into the low 20s for anything you plan to share.
- Metadata embed works best with MP4; if you pick MKV and then drag the file back into ComfyUI expecting the web UI to reconstruct the workflow, you may be disappointed - that's the trade the container option is describing.
- The subfolder field is deliberately strict (no separators, single level) because the pack sanitizes path inputs against traversal. Don't fight it - use
Videos/2026style nesting via a subfolder like2026and the timestamp tokens instead.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| video | VIDEO | The video to save. | |
| filename_prefix | STRING | ComfyUI_%Y%-%m%-%d%_%H%-%M%-%S% | Filename prefix, supports datetime placeholders: %Y%, %m%, %d%, %H%, %M%, %S% |
| subfolder | STRING | Videos | Subfolder name (no path separators allowed), supports datetime placeholders: %Y%, %m%, %d%, %H%, %M%, %S% |
| crf | INT | 00–40 | Integer quality parameter (0=lossless, 40=worst quality). Higher CRF means lower quality with smaller file size. |
| preset | COMBO | medium | Encoding speed/compression tradeoff. Faster presets encode quickly but with larger files. Slower presets provide better compression but take longer. |
| container | COMBO | MP4 | Output container format. MKV prioritizes lossless compatibility. MP4 prioritizes ComfyUI web metadata compatibility. |
Outputs (0)
No outputs