Load Video Directory V2
The video batch loader that actually gives you a frame count and audio
- meta_batch
- vae
- frames
- frame_count
- audio
- video_info
- filename_text
If you've ever tried to run a video-to-video workflow on a folder of clips, you know the pain: the core Load Video node wants one file, and you end up building silly chains to iterate over a directory. LoadVideoDirectoryV2 is DJZ-Nodes' answer - it points at a folder, picks a video (or steps through them), and hands you frames plus the metadata you actually need downstream. It's the V2 of the pack's original LoadVideoDirectory, and the upgrades are the whole reason to use it.
What V2 adds over V1
The plain LoadVideoDirectory returns just frames and a filename. V2 gives you five outputs: frames (IMAGE), frame_count (INT), audio (AUDIO), video_info (VHS_VIDEOINFO), and filename_text (STRING). That audio output is the big one - it pulls the soundtrack out of the video via ffmpeg and hands you a waveform tensor that plugs into audio-aware pipeline nodes. It also adds two optional inputs that V1 doesn't have: meta_batch (a VHS_BatchManager from VideoHelperSuite, letting it cooperate with VHS batch iteration instead of fighting it) and vae, plus memory_limit_mb and force_rate controls.
The inputs that matter
Most of the required fields are set once and forgotten:
- mode -
single_video(use theindexfield),incremental_video(walk through the folder one run at a time), orrandom(picks usingseed). For training-style batch jobs,incremental_videois your friend. - path - the folder to scan. This one throws a
ValueErrorif the path doesn't exist, so double-check it before you queue. - pattern - a glob filter, default
*, so you can grab only*.mp4or a specific naming scheme. It's sanitized against..traversal, so it won't escape the base directory. - skip_frames / max_frames - trim the head and cap the length, handy when you only want every clip's first 24 frames.
- memory_limit_mb - 0 means "auto," and it will estimate how many frames fit in RAM rather than OOMing your box on a 4K clip.
Under the hood it scans the folder with glob, sorts the results, and reads frames with OpenCV (cv2.VideoCapture), converting BGR to RGB and normalizing to 0-1 float tensors. The audio side uses ffmpeg-python to extract 44.1kHz stereo PCM.
Installing it
This is one node in the big DJZ-Nodes pack by Drift Johnson (MushroomFleet), so you install the whole thing:
cd ComfyUI/custom_nodes
git clone https://github.com/MushroomFleet/DJZ-Nodes
cd DJZ-Nodes
pip install -r requirements.txt
Or search "DJZ-Nodes" in ComfyUI Manager and let it handle it. The pack's requirements pull in opencv-python and ffmpeg-python (among a lot of others), and the audio extraction needs a real ffmpeg binary on your system - the Python package just wraps it, so install ffmpeg separately if ComfyUI's portable build doesn't include it.
Where people get burned
The AUDIO output shows up as a missing socket if you don't have the audio node to consume it - that's fine, leave it unplugged. And if your clips are gigantic, skip the vae/audio niceties and set max_frames; the memory limiter will only protect you from the worst of it. Start with a folder of short clips and one mode, confirm the frame_count output is sane, then scale up.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | 3 options: single_video, incremental_video, random | |
| seed | INT | 00–18446744073709550000 | — |
| index | INT | 00–150000 | — |
| skip_frames | INT | 00–999999 | — |
| max_frames | INT | 00–999999 | — |
| memory_limit_mb | INT | 00–128000 | — |
| force_rate | INT | 00–60 | — |
| label | STRING | Video Batch 001 | — |
| path | STRING | — | |
| pattern | STRING | * | — |
| meta_batchopt | VHS_BatchManager | — | |
| vaeopt | VAE | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| frames | IMAGE | — |
| frame_count | INT | — |
| audio | AUDIO | — |
| video_info | VHS_VIDEOINFO | — |
| filename_text | STRING | — |