Visit ComfyUI Online for ready-to-use ComfyUI environment
Specialized node for navigating and retrieving video files with search, sort, and randomization options for efficient organization.
The VidDirIterator
is a specialized node designed to facilitate the navigation and retrieval of video files from a specified directory. Its primary purpose is to streamline the process of accessing video files by allowing you to specify search patterns, sorting preferences, and randomization options. This node is particularly beneficial for users who need to manage large collections of video files, as it provides a systematic approach to locate and select videos based on various criteria such as modification date, file name, or size. By leveraging this node, you can efficiently organize and access video content, making it an essential tool for projects that involve video processing or analysis.
The directory_path
parameter specifies the location of the directory where the video files are stored. It is crucial for the node to know where to look for the video files, and this parameter provides that information. The directory path should be a valid path on your file system. There are no specific minimum or maximum values, but it must be a valid directory path.
The glob_patterns
parameter allows you to define patterns to match specific video files within the directory. This is useful for filtering files based on their extensions or naming conventions. For example, you can use patterns like *.mp4
or *.mov
to target specific file types. There are no strict minimum or maximum values, but the patterns should be valid glob patterns.
The video_index
parameter determines which video file to select from the list of files that match the specified patterns. This index is zero-based, meaning an index of 0 corresponds to the first file in the sorted list. The index wraps around using modulo, so it will always return a valid file even if the index exceeds the number of files.
The sort_by
parameter specifies the criterion used to sort the video files. Options include date_modified
, name
, size
, and random
. This parameter affects the order in which files are listed and subsequently selected. The default value is typically date_modified
, but you can choose any of the available options based on your needs.
The sort_order
parameter determines whether the sorting should be in ascending or descending order. This affects how the files are organized after sorting by the specified criterion. The options are ascending
or descending
, with ascending
being the default.
The randomize_final_list
parameter is a boolean that, when set to true, randomizes the entire list of video files after sorting. This can be useful if you want to introduce an element of randomness in the selection process. The default value is typically false.
The video_file_path
output parameter provides the path to the selected video file based on the input criteria. This output is crucial as it allows you to access the specific video file that meets your search and sorting conditions. The path is returned as a string and can be used in subsequent nodes or processes that require video file input.
glob_patterns
to filter out only the video files you are interested in, which can save time and resources when dealing with large directories.sort_by
and sort_order
settings to organize your video files in a way that best suits your project needs, such as prioritizing the most recently modified files.randomize_final_list
if you want to introduce variability in your video selection process, which can be particularly useful for creative projects that benefit from randomness.glob_patterns
.directory_path
is correct and that the glob_patterns
accurately reflect the file types you are trying to access. Double-check the directory for the presence of video files.directory_path
provided is not a valid path on the file system.video_index
exceeds the number of available video files.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.