Visit ComfyUI Online for ready-to-use ComfyUI environment
Retrieve list of files from directory based on pattern for efficient batch processing and file management.
The io-util-file-list-get
node is designed to help you retrieve a list of files from a specified directory that match a given pattern. This node is particularly useful for organizing and managing files, especially when you need to process or analyze multiple files at once. By specifying a directory and a pattern, you can easily filter and obtain the filenames or their absolute paths, depending on your needs. This functionality is essential for tasks that involve batch processing of files, such as reading multiple text files, processing images, or any other file-based operations. The node simplifies the process of file retrieval, making it more efficient and less error-prone.
The path
parameter specifies the directory from which you want to retrieve the files. It is a string input where you provide the path to the directory. The default value is an empty string, which means you need to specify the directory path for the node to function correctly. This parameter is crucial as it determines the location from which the files will be listed.
The pattern
parameter allows you to define the type of files you want to retrieve from the specified directory. It is a string input where you can use wildcard characters to match specific file types. The default value is *.txt
, which means it will list all text files in the directory. You can change this pattern to match other file types, such as *.jpg
for images or *.csv
for CSV files. This parameter helps in filtering the files based on their extensions or naming patterns.
The mode
parameter determines how the file paths will be returned. It offers two options: filename
and abspath
. If you choose filename
, the node will return only the names of the files. If you choose abspath
, it will return the absolute paths of the files. This parameter is important as it allows you to control the format of the output based on your specific requirements. The default value is filename
.
The output parameter STRING
contains the list of files that match the specified pattern in the given directory. The files are returned as a single string, with each filename or absolute path separated by a newline character. This output is useful for further processing or analysis, as it provides a consolidated list of the files that meet your criteria.
path
parameter is correctly specified to avoid errors in file retrieval.pattern
parameter to filter the files you need.mode
parameter based on whether you need just the filenames or the full paths of the files.path
parameter does not exist.pattern
parameter does not match any files in the directory.© Copyright 2024 RunComfy. All Rights Reserved.