Visit ComfyUI Online for ready-to-use ComfyUI environment
Facilitates systematic file iteration and management with filtering, sorting, and looping capabilities for AI artists.
The Dir_Gir_Looper node, also known as LoopyDir, is designed to facilitate the iteration through files within a specified directory, providing a systematic way to access and manage files based on user-defined criteria. This node is particularly useful for AI artists who need to process or analyze a series of files, such as images or datasets, in a structured manner. By allowing you to filter files using regular expressions or file extensions, and sort them by name or date, the Dir_Gir_Looper offers flexibility in how files are selected and ordered. Additionally, it supports looping through files with options to pause or resume, making it an efficient tool for batch processing tasks. The node's ability to handle dynamic file lists ensures that any new files added to the directory are automatically included in the iteration, providing a seamless and up-to-date file management experience.
This parameter specifies the path to the directory containing the files you wish to iterate through. It is a required input and must be provided as a string. The directory path should be accurate to ensure the node can access the files within it. There is no default value, and it must be explicitly set by the user.
This parameter determines the method used to filter files within the directory. You can choose between "regex" for regular expression matching or "extension" for filtering by file extension. The default option is "extension". This choice impacts which files are included in the iteration process, allowing for precise control over file selection.
This parameter is used in conjunction with filter_type
to specify the exact filter criteria. For "regex", it should be a valid regular expression pattern, and for "extension", it should be the desired file extension (e.g., .jpg
). The default value is an empty string, and it must be set according to the filtering needs.
This parameter allows you to define how the files should be sorted before iteration. Options include "name", "date_modified", and "date_created", with "name" being the default. This sorting affects the order in which files are processed, which can be crucial for tasks that depend on file sequence.
This parameter specifies the order in which the sorted files should be arranged. You can choose "asc" for ascending, "desc" for descending, or "random" for a shuffled order. The default is "asc". This setting influences the sequence of file access during iteration.
This integer parameter sets the starting index for file iteration. It allows you to resume from a specific point in the file list. The default value is 0, and it should be within the bounds of the file list to avoid errors.
This boolean parameter controls whether the iteration should be paused. When set to True
, the loop will not advance to the next file, allowing for manual control over the iteration process. The default value is False
.
This output provides the total number of files that match the specified filter criteria within the directory. It is an integer value that helps you understand the scope of the iteration task.
This integer output indicates the current position in the file list, showing which file is currently being accessed. It is useful for tracking progress through the directory.
This output returns the name of the file currently being accessed. It is a string value that identifies the specific file in the iteration process.
This output provides the full path to the current file, combining the directory path with the file name. It is a string value that can be used for direct file access or processing.
This output is a list of all files that match the filter criteria, sorted according to the specified parameters. It provides a comprehensive view of the files available for iteration.
filter_type
and filter_value
parameters to precisely control which files are included in the iteration, especially when dealing with large directories.sort_by
and sort_order
parameters to match the desired processing sequence, which can be critical for tasks that depend on file order.loop_index
to resume iterations from a specific point, which is helpful in scenarios where processing is interrupted or needs to be repeated.pause_loop
to True
if you need to manually control the pace of file processing, allowing for interventions or adjustments as needed.filter_type
and filter_value
parameters are set appropriately to match the desired files.loop_index
is set to a value outside the range of available files.loop_index
is within the bounds of the file list. You can reset it to 0 or adjust it to a valid index based on the number of matched files.filter_type
parameter.filter_type
is set to either "regex" or "extension", as these are the only supported options.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.