ComfyUI > Nodes > DJZ-Nodes > Load Video Directory

ComfyUI Node: Load Video Directory

Class Name

LoadVideoDirectory

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 Description

Facilitates loading and processing video files from specified directory for efficient management and access in creative and analytical tasks.

Load Video Directory:

The LoadVideoDirectory node is designed to facilitate the loading and processing of video files from a specified directory. Its primary purpose is to enable you to efficiently manage and access video content for various creative and analytical tasks. By leveraging this node, you can easily navigate through a collection of videos, select specific files based on different modes, and extract frames for further processing. This node is particularly beneficial for AI artists and developers who need to work with large video datasets, as it provides a streamlined approach to handling video files, ensuring that you can focus on your creative endeavors without getting bogged down by the complexities of file management. The node supports different modes of operation, allowing you to select videos sequentially, incrementally, or randomly, thus offering flexibility in how you access and utilize your video resources.

Load Video Directory 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 you want to process. 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 you.

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 in the directory will be considered.

index

The index parameter determines which video file to select from the directory. It is an integer value that corresponds to the position of the video in the sorted list of files. The default value is 0, which selects the first video. This parameter is particularly useful when you want to access a specific video directly.

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, rather than from the very beginning. The default value is 0, meaning no frames are skipped.

max_frames

The max_frames parameter defines the maximum number of frames to extract 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, which means all frames will be extracted.

mode

The mode parameter determines the method of video selection. It can be set to 'single_video', 'incremental_video', or 'random'. The 'single_video' mode selects a specific video based on the index, 'incremental_video' mode cycles through videos incrementally, and 'random' mode selects a video randomly. 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 random selection of videos is reproducible. The default value is 0.

label

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

Load Video Directory Output Parameters:

frames_tensor

The frames_tensor output is a collection of video frames extracted from the selected video. This tensor is crucial for any subsequent processing or analysis tasks you wish to perform on the video content. It provides a structured representation of the video data, making it easier to manipulate and analyze.

filename

The filename output provides the name of the video file from which the frames were extracted. This is important for keeping track of which video the frames originated from, especially when working with multiple videos. It helps in maintaining a clear association between the processed data and its source.

Load Video Directory Usage Tips:

  • Ensure that the path parameter is correctly set to the directory containing your video files to avoid errors related to non-existent paths.
  • Use the pattern parameter to filter specific types of video files, such as only .mp4 files, by setting it to '*.mp4'.
  • When using the 'random' mode, set the seed parameter to a fixed value if you want to achieve consistent results across different runs.
  • Adjust the skip_frames and max_frames parameters to optimize performance, especially when dealing with large video files, by limiting the number of frames processed.

Load Video Directory Common Errors and Solutions:

Path does not exist: <path>

  • Explanation: This error occurs when the specified directory path does not exist on your system.
  • Solution: Double-check the path parameter to ensure it points to a valid directory containing your video files.

Invalid video index: <video_id>

  • Explanation: This error is raised when the index parameter is set to a value that is out of range for the available video files.
  • Solution: Verify that the index is within the range of available videos in the directory. Adjust the index value accordingly.

No valid video frames found for index <index>

  • Explanation: This error indicates that no frames could be extracted from the video at the specified index.
  • Solution: Check the video file at the given index to ensure it is not corrupted and contains valid frames. Adjust the index, skip_frames, or max_frames parameters if necessary.

Load Video Directory 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.