XB-BOX - 🎬 保存视频
The two-node video ending, welded into one
- images
- audio
- video
Two nodes you always wire the same way
A modern ComfyUI video workflow ends with the same pair: Create Video assembles a batch of frames plus optional audio into a VIDEO object, then Save Video writes it out. You will wire those two in exactly the same order, with the same three values, for every video you ever make.
XB_SaveVideo is those two nodes in one box: images in, file on disk, plus a VIDEO output if something downstream wants the object instead of the file. The convenience is real - it halves the vertical space your ending takes and removes the "I set fps on one node and the encoder disagreed" mistake.
What it's actually doing
It's built on ComfyUI's newer backend authoring API (io.ComfyNode with a schema, not the old NODE_CLASS_MAPPINGS dictionary), and it reuses the official input definitions rather than retyping them: the format dropdown is a deep copy of Save Video's dynamic combo, and images/fps/audio are taken from Create Video's schema. That matters practically - when the official format list grows a new container or codec, this node inherits it.
The execution path is the official one, in order. Images and audio get bound into a VideoComponents with the frame rate as an exact fraction (so 29.97-style rates don't drift). bit_depth: auto resolves to 10-bit when you've picked an HDR colorspace, 8-bit otherwise. The format selection unpacks into container + codec + CRF, with auto landing on mp4, or WebM if you chose AV1. Then it writes through ComfyUI's standard save path, so filename_prefix templating works exactly as it does on Save Image, and attaches workflow metadata unless you launched with --disable-metadata.
The inputs that matter
images is the frame batch - the thing a VAE decode hands back. A single image gives you a one-frame video, which looks like a bug and isn't.
fps defaults to 30 and runs 1–120. Set it to the rate your pipeline was actually designed around, not the default. Video models generate a fixed frame count, so fps is what converts that count into duration - drop it and the clip gets longer and slower, raise it and it gets shorter and faster. Guessing here is how you end up with a 5-second clip that plays like a slideshow.
audio is optional, and the trap is that leaving it unwired gives you a silent file with no warning.
filename_prefix behaves like Save Image: it takes %date:yyyy-MM-dd%-style tokens and %NodeName.widget% to pull a live value out of another node, and a slash in it creates a subfolder. bit_depth and color_space should stay on auto and sRGB unless your pipeline genuinely carries HDR - mistagging SDR pixels as HDR PQ is how you get a video that looks grey and washed out in every player. Same with format: auto: it picks sensible mp4 defaults, and you only need to descend into the codec children (codec, encoding mode, CRF) if you're chasing a delivery spec or NVENC.
autoplay is pure UI - the preview starts itself after a run, muted until you hover. Leave it alone.
The single output is video, type VIDEO. It's also an output node, so the file gets written whether or not anything is plugged into it.
When it doesn't show up at all
The most common failure for this node isn't a runtime error - it's the node being absent from the menu entirely. It depends on ComfyUI's V3 video API and the native Create Video / Save Video nodes shipping in your build. On an older install the import fails, and you get this line in the console:
[XB-BOX] 保存视频节点 未加载:...
The rest of the pack loads fine, which is what makes it confusing. Update ComfyUI, restart, recheck the category.
If encoding itself fails, look at PyAV. ComfyUI installs av for its own video nodes, so a fresh install normally has it; an ffmpeg- or PyAV-shaped traceback means your environment doesn't, and pip install av imageio-ffmpeg covers what this pack's requirements list for video I/O.
Install
Manager: search XB_ToolBox, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/wjluoxiao/XB_ToolBox.git
One caveat that will save you an evening: the pack is 141 nodes across audio, OCR, local LLM, ONNX segmentation and music generation, and its requirements.txt is the union of all of that. Don't run pip install -r requirements.txt on a working environment just to save a video - you'll pull EasyOCR, onnxruntime, pythonnet and a pile of audio libraries through your torch install for no reason. This node needs PyAV and a current ComfyUI.
And keep the source file, nodes_save_video.py, in mind. The pack's docs are Chinese-first and it has almost no footprint in English-language threads, so forty lines of Python beats an hour of searching.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | The images to create a video from. | |
| filename_prefix | STRING | video/ComfyUI | The 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. |
| fps | FLOAT | 301–120 | — |
| bit_depth | COMBO | auto | Auto uses 8-bit for sRGB and 10-bit for HDR. Explicit 8-bit and 10-bit choices are independent of colorspace. |
| color_space | COMBO | sRGB | Colorspace of the input images. HDR selects BT.2020/HLG and HDR PQ selects BT.2020/PQ. |
| format | COMBO | auto | The format to save the video as. |
| autoplay | BOOLEAN | true | 开:视频生成后自动播放(默认静音,鼠标悬停在画面上才出声);关:需要手动点击播放。 |
| audioopt | AUDIO | The audio to add to the video. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| video | VIDEO | — |