ComfyUI > Nodes > DJZ-Nodes > Load Video Directory V2

ComfyUI Node: Load Video Directory V2

Class Name

LoadVideoDirectoryV2

Category
image/video
Author
DriftJohnson (Account age: 4052days)
Extension
DJZ-Nodes
Latest Updated
2025-04-25
Github Stars
0.04K

How to Install DJZ-Nodes

Install this extension via the ComfyUI Manager by searching for DJZ-Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter DJZ-Nodes in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Load Video Directory V2 Description

Facilitates loading and managing video files from specified directory, offering streamlined approach for handling video data in various modes.

Load Video Directory V2:

The LoadVideoDirectoryV2 node is designed to facilitate the loading and management of video files from a specified directory, offering a streamlined approach for handling video data in various modes. This node is particularly beneficial for AI artists who need to work with video data in a flexible and efficient manner. It allows you to load videos based on different selection modes such as single, incremental, or random, providing versatility in how video data is accessed and utilized. The node ensures that only valid video files are processed, and it can handle video selection dynamically based on user-defined parameters. This capability is essential for tasks that require batch processing of video files or when working with large video datasets, as it simplifies the process of accessing and managing video content.

Load Video Directory V2 Input Parameters:

path

The path parameter specifies the directory path where the video files are located. It is crucial for the node to know where to look for the video files to load. The path must be a valid directory on your system; otherwise, the node will raise an error. There is no default value for this parameter, and it must be provided by the user.

pattern

The pattern parameter allows you to define a specific pattern for matching video files within the directory. This can be useful if you want to filter the files based on certain criteria, such as file extensions or naming conventions. The default value is '*', which means all files will be considered.

index

The index parameter determines which video file to load based on its position in the directory. It is used in conjunction with the mode to select the appropriate video. The default value is 0, and it should be a non-negative integer.

skip_frames

The skip_frames parameter specifies the number of frames to skip at the beginning of the video. This can be useful if you want to start processing the video from a specific point. The default value is 0, meaning no frames are skipped.

max_frames

The max_frames parameter defines the maximum number of frames to load from the video. This allows you to limit the amount of data processed, which can be beneficial for performance reasons. The default value is 0, indicating that all frames will be loaded.

mode

The mode parameter determines the method of video selection. It can be set to single_video, incremental_video, or random, each offering a different approach to selecting videos from the directory. The default mode is single_video.

seed

The seed parameter is used to initialize the random number generator when the mode is set to random. This ensures that the selection of videos is reproducible. The default value is 0.

label

The label parameter allows you to assign a label to the batch of videos being processed. This can be useful for organizational purposes or when managing multiple video batches. The default value is 'Video Batch 001'.

force_rate

The force_rate parameter is used to enforce a specific frame rate when processing videos. This can be important for ensuring consistency across different video files. The default value is 0, which means the original frame rate of the video is used.

meta_batch

The meta_batch parameter is an optional parameter that can be used to pass additional metadata or batch information. This can be useful for advanced processing scenarios where additional context is needed.

unique_id

The unique_id parameter is an optional identifier that can be used to uniquely identify the video batch being processed. This can be helpful in scenarios where multiple batches are being handled simultaneously.

memory_limit_mb

The memory_limit_mb parameter sets a limit on the amount of memory (in megabytes) that can be used during video processing. This can help prevent excessive memory usage and ensure that the node operates within the available system resources. The default value is 0, indicating no specific limit.

vae

The vae parameter is an optional parameter that can be used to specify a Variational Autoencoder (VAE) model for processing the video data. This can be useful for tasks that involve video encoding or transformation.

Load Video Directory V2 Output Parameters:

frames_tensor

The frames_tensor output is a tensor containing the video frames that have been loaded and processed. This tensor is essential for any further processing or analysis of the video data, as it represents the actual visual content in a format that can be easily manipulated.

video_id

The video_id output is an integer that represents the index of the video file that was loaded. This is useful for tracking which video was processed, especially when working with large datasets or in batch processing scenarios.

meta_batch

The meta_batch output is an optional dictionary that contains metadata or additional information about the video batch. This can include details such as processing parameters or contextual information that may be relevant for further analysis.

additional_info

The additional_info output is a dictionary that provides extra information about the video processing, such as any warnings or notes that were generated during the loading process. This can be helpful for debugging or understanding the context of the video data.

filename

The filename output is a string that contains the name of the video file that was loaded. This is important for identifying the source of the video data and for any file management tasks that may be necessary.

Load Video Directory V2 Usage Tips:

  • Ensure that the path parameter is correctly set to a valid directory containing video files to avoid errors.
  • Use the pattern parameter to filter specific video files if you have a large directory with mixed file types.
  • Adjust the skip_frames and max_frames parameters to optimize performance and focus on specific parts of the video.
  • When using the random mode, set a specific seed value to ensure reproducibility of video selection.
  • Consider setting a memory_limit_mb to prevent excessive memory usage, especially when processing high-resolution videos.

Load Video Directory V2 Common Errors and Solutions:

Path does not exist: <path>

  • Explanation: This error occurs when the specified directory path does not exist on the system.
  • Solution: Verify that the path parameter is set to a valid directory and that the directory exists on your system.

Invalid video index: <video_id>

  • Explanation: This error indicates that the specified video index is out of range or invalid.
  • Solution: Ensure that the index parameter is within the valid range of available video files in the directory.

No valid video frames found for index <index>

  • Explanation: This error means that no frames could be loaded from the specified video index.
  • Solution: Check the video file at the specified index to ensure it is a valid video file and that the skip_frames and max_frames parameters are set correctly.

FFmpeg probe error: <error_message>

  • Explanation: This error occurs when there is an issue probing the video file with FFmpeg, possibly due to an unsupported format or corrupted file.
  • Solution: Verify that the video file is not corrupted and is in a supported format. Consider re-encoding the video if necessary.

Load Video Directory V2 Related Nodes

Go back to the extension to check out more related nodes.
DJZ-Nodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.