Visit ComfyUI Online for ready-to-use ComfyUI environment
Efficiently tally files in a directory based on specified patterns for streamlined asset management.
The File Count [Dream] node is designed to help you quickly determine the number of files within a specified directory that match given patterns. This node is particularly useful for managing and organizing large collections of images or other files, as it allows you to easily count files based on specific criteria. By providing a directory path and file patterns, you can efficiently tally the total number of files that meet your requirements, making it easier to manage your assets and streamline your workflow.
The directory_path
parameter specifies the path to the directory where the files you want to count are located. This parameter is a string and should be the full path to the directory. If the directory does not exist, the node will return a count of zero. This parameter does not have a minimum or maximum value, but it defaults to an empty string.
The patterns
parameter allows you to define the types of files you want to count within the specified directory. This parameter is a string that can include multiple file patterns separated by a pipe (|
) character. For example, you can use *.jpg|*.png|*.jpeg
to count all JPEG and PNG files. This parameter also defaults to *.jpg|*.png|*.jpeg
and does not have a minimum or maximum value.
The TOTAL
output parameter provides the total number of files that match the specified patterns within the given directory. This output is an integer value representing the count of files found. It is useful for understanding the volume of files that meet your criteria and can help in further processing or organizing your data.
directory_path
is correctly specified and points to an existing directory to avoid getting a count of zero.patterns
parameter to narrow down the count to only the files you are interested in. For example, use *.png
if you only want to count PNG files.|
) character to count different types of files in one go, such as *.jpg|*.png|*.gif
.directory_path
does not point to an existing directory.patterns
parameter to ensure it correctly specifies the file types you want to count. Adjust the patterns if necessary to match the files in the directory.patterns
parameter is not formatted correctly.|
) character if multiple patterns are used. For example, use *.jpg|*.png
for counting both JPEG and PNG files.© Copyright 2024 RunComfy. All Rights Reserved.