XB-BOX - 🎬 视频加载器(修复预览BUG)
Load any video into frames with VHS compatibility — and the preview bug is actually fixed
- meta_batch
- vae
- IMAGE
- frame_count
- audio
- video_info
Most of ComfyUI's video pipelines start with one question: "can I get this video into frames?" XB_VideoLoader answers it the way VideoHelperSuite does - the node is, in the author's own words, code "搬运自 VHS" (ported from VHS's utils.py and nodes.py) - so you get the familiar VHS behavior: pick a file from ComfyUI/input, get IMAGE frames, frame count, audio, and video info out the other side. The display name even advertises the one thing the author bothered to change: "视频加载器(修复预览BUG)" - the video loader with the preview bug fixed.
That's the honest story of this node: it's a VHS clone, and the differentiation is a repaired thumbnail/preview in the node UI plus a format hint so downstream video-VAE nodes know what they're looking at.
How it works and what you set
The video dropdown lists every supported file (webm, mp4, mkv, gif, mov) in your input directory. The rest are the load controls you've seen in VHS:
- force_rate - retime the video to this FPS (0 = keep the source rate).
- custom_width / custom_height - resize on load; set one to 0 to scale proportionally. 0/0 keeps the source size.
- frame_load_cap - stop after N frames. Your first move when VRAM is tight.
- skip_first_frames - chop the head off the video.
- select_every_nth - take every Nth frame. The poor man's frame skip for long clips.
Optional inputs: meta_batch (a VHS_BatchManager, for batch workflows), vae (plug in a VAE and the IMAGE output becomes a LATENT instead), and format - a hint dropdown (None, AnimateDiff, Mochi, LTXV, Hunyuan, Cosmos, Wan) that tells the loading code which frame layout convention to follow for video-VAE workflows. Set it to Wan when you're feeding a Wan 2.2 pipeline.
Outputs: IMAGE, frame_count (INT), audio (AUDIO), and video_info (VHS_VIDEOINFO). Wire the IMAGE into your VAE encoder or a sampler; the audio feeds a VideoCombine later if you want the soundtrack back.
Where people stumble
The audio path uses PyAV (import av), so if you cloned the pack manually and skipped its requirements, loading a video with sound errors out where VHS would just work. Let ComfyUI Manager install the pack's requirements (av, opencv-python, imageio-ffmpeg) and you're fine. The frame loader itself uses OpenCV's VideoCapture, which is why opencv-python is a hard need - most ComfyUI environments already have it.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git
restart, or search "XB_ToolBox" in ComfyUI Manager. After cloning, run pip install -r requirements.txt in your ComfyUI environment if Manager isn't doing it for you - the av and opencv-python bits are the ones this node actually touches.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| video | COMBO | 0 options: | |
| force_rate | FLOAT | 00–60 | — |
| custom_width | INT | 00–8192 | — |
| custom_height | INT | 00–8192 | — |
| frame_load_cap | INT | 00–9007199254740991 | — |
| skip_first_frames | INT | 00–9007199254740991 | — |
| select_every_nth | INT | 11–9007199254740991 | — |
| meta_batchopt | VHS_BatchManager | — | |
| vaeopt | VAE | — | |
| formatopt | COMBO | AnimateDiff | 7 options: None, AnimateDiff, Mochi, LTXV, Hunyuan, Cosmos, +1 |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| frame_count | INT | — |
| audio | AUDIO | — |
| video_info | VHS_VIDEOINFO | — |