ComfyUI > Nodes > Dir Gir > GIR Loopy Dir

ComfyUI Node: GIR Loopy Dir

Class Name

Dir_Gir_Looper

Category
Dir Gir
Author
AshMartian (Account age: 4909days)
Extension
Dir Gir
Latest Updated
2025-05-04
Github Stars
0.02K

How to Install Dir Gir

Install this extension via the ComfyUI Manager by searching for Dir Gir
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Dir Gir 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

GIR Loopy Dir Description

Facilitates systematic file iteration and management with filtering, sorting, and looping capabilities for AI artists.

GIR Loopy Dir:

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.

GIR Loopy Dir Input Parameters:

directory

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.

filter_type

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.

filter_value

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.

sort_by

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.

sort_order

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.

loop_index

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.

pause_loop

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.

GIR Loopy Dir Output Parameters:

file_count

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.

current_index

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.

current_file

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.

current_file_path

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.

all_files

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.

GIR Loopy Dir Usage Tips:

  • Ensure the directory path is correctly specified to avoid errors in file access.
  • Use the filter_type and filter_value parameters to precisely control which files are included in the iteration, especially when dealing with large directories.
  • Adjust the sort_by and sort_order parameters to match the desired processing sequence, which can be critical for tasks that depend on file order.
  • Utilize the loop_index to resume iterations from a specific point, which is helpful in scenarios where processing is interrupted or needs to be repeated.
  • Consider setting pause_loop to True if you need to manually control the pace of file processing, allowing for interventions or adjustments as needed.

GIR Loopy Dir Common Errors and Solutions:

No files found in directory

  • Explanation: This error occurs when the specified directory does not contain any files that match the filter criteria.
  • Solution: Verify that the directory path is correct and that the filter_type and filter_value parameters are set appropriately to match the desired files.

Index out of bounds

  • Explanation: This error happens when the loop_index is set to a value outside the range of available files.
  • Solution: Ensure that the 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.

Invalid filter type

  • Explanation: This error arises when an unsupported value is provided for the filter_type parameter.
  • Solution: Check that the filter_type is set to either "regex" or "extension", as these are the only supported options.

GIR Loopy Dir Related Nodes

Go back to the extension to check out more related nodes.
Dir Gir
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.