Visit ComfyUI Online for ready-to-use ComfyUI environment
Scan specified folder for files matching pattern, useful for managing large collections, supports recursive searches and log file saving.
The FolderSearch node is designed to scan a specified folder for files that match a given pattern. This node is particularly useful for AI artists who need to manage and organize large collections of files, such as images or datasets, by automating the search process. By specifying a folder path and a search mask, you can efficiently locate files that meet your criteria. The node supports recursive searches, allowing you to include subfolders in your scan, and can return either the full file paths or just the filenames. Additionally, you can choose to save the search results to a log file for further processing. This node simplifies file management tasks, making it easier to handle large volumes of data without manual intervention.
This parameter specifies the directory you wish to scan. You can set it to an absolute path or a relative path from ComfyUI's root folder. The folder_path determines the starting point of the search. The default value is /
.
This parameter defines the pattern used to match files. The pattern can include wildcards such as *
to match any number of characters, ?
to match a single character, and #
to match a single numeric character. You can also use brackets to specify character sets or ranges, such as [a-z]
. The default value is *.*
.
This boolean parameter determines how the search results are returned. If set to True, the node returns the entire list of matching files. If set to False, it returns one file at a time with each execution until all files are processed. The default value is False.
This boolean parameter specifies whether the search should include subfolders within the main directory. If set to True, the node will scan all subfolders recursively. The default value is True.
This boolean parameter indicates whether directories should be included in the search results. If set to True, both files and directories that match the search mask will be returned. The default value is False.
This boolean parameter determines whether the full file paths should be returned or just the filenames and extensions. If set to True, the full paths are returned. The default value is False.
This boolean parameter specifies whether the filenames should be returned relative to the search directory. If set to True, the filenames will include their parent folder relative to the search directory. The default value is False.
This optional parameter allows you to specify a file path where the search results will be saved. If provided, the node will write the search results to this log file. The default value is an empty string, meaning no log file is created.
This output parameter returns the search results based on the output_type setting. If output_type is True, it returns a list of all matching files. If output_type is False, it returns one file at a time until all files are processed. If no files are found, it returns an empty string.
folder_path
to the desired directory and search_mask
to *.*
.recursive
parameter to include subfolders in your search, which is useful for deeply nested directories.return_full_path
to True if you need the complete file paths for further processing or logging.save_output_to
parameter to save the search results to a log file, which can be helpful for auditing or batch processing tasks.© Copyright 2024 RunComfy. All Rights Reserved.