Visit ComfyUI Online for ready-to-use ComfyUI environment
Automates batch processing by iterating over files in a directory based on a pattern, ensuring orderly and consistent processing.
The "For Each Filename" node is designed to streamline the process of iterating over files within a specified directory that match a given pattern. This node is particularly useful for batch processing tasks where you need to apply the same operation to multiple files, such as images or videos. By automating the file selection and iteration process, it saves you time and effort, allowing you to focus on the creative aspects of your project. The node ensures that each file is processed in sequence, maintaining a state to track which files have been processed and which are yet to be handled. This functionality is essential for tasks that require consistent and orderly processing of multiple files.
This parameter is a unique identifier for the iteration process. It helps in maintaining the state of the files being processed, ensuring that each file is handled only once. The id
should be a string that uniquely identifies the current batch processing task.
This parameter specifies the directory where the files to be processed are located. It should be a string representing the path to the directory. The default value is set to the input directory defined in the comfy_paths
configuration. Ensure that the directory path is correctly specified and exists, as the node will check for its validity.
This parameter defines the pattern used to match the filenames within the specified directory. It should be a string representing the file pattern, such as *.jpg
for JPEG images. The default value is *.jpg
. This pattern helps in filtering the files that need to be processed, allowing you to target specific file types or naming conventions.
This output parameter provides the full path of the current file being processed. It is a string that can be used in subsequent nodes to access or manipulate the file.
This output parameter gives the name of the current file without its extension. It is a string that can be useful for logging, naming outputs, or other identification purposes.
This output parameter is a state file that keeps track of the files processed and those yet to be processed. It is used internally by the node to manage the iteration process and ensure that each file is handled in sequence.
directory
parameter points to a valid directory containing the files you want to process. Double-check the path to avoid errors.pattern
parameter to filter the files accurately. For example, use *.png
for PNG images or *.mp4
for MP4 videos.id
parameter to differentiate between multiple batch processing tasks. This helps in maintaining separate states for different tasks.<directory_path>
directory
parameter is correctly set to a valid directory path. Ensure that the directory exists and is accessible.pattern
parameter to ensure it correctly matches the files you intend to process. Also, verify that the directory contains files that match the pattern.© Copyright 2024 RunComfy. All Rights Reserved.