Visit ComfyUI Online for ready-to-use ComfyUI environment
Automate file renaming with prefix, numbering, and caption updates for efficient organization and productivity.
The BatchRenameFiles| Batch Rename Files 🐑
node is designed to streamline the process of renaming multiple files within a specified directory. This node is particularly useful for AI artists and content creators who need to organize large collections of files, such as images or text documents, by applying a consistent naming convention. By allowing you to add a prefix and a numbering format to file names, this node helps maintain order and clarity in your file management. Additionally, it offers the option to update associated caption files, ensuring that all related files are renamed in tandem. This functionality is essential for maintaining consistency across different file types, especially when dealing with paired image and text files. The node's primary goal is to enhance productivity by automating the tedious task of manual file renaming, thus allowing you to focus more on creative tasks.
The directory
parameter specifies the path to the folder containing the files you wish to rename. It is crucial as it determines the location where the node will search for files to process. There are no specific minimum or maximum values, but it should be a valid directory path on your system.
The file_extension
parameter defines the type of files to be renamed, such as .jpg
or .txt
. This parameter ensures that only files with the specified extension are targeted, allowing for precise control over which files are affected by the renaming process. There are no specific minimum or maximum values, but it should be a valid file extension.
The numbering_format
parameter dictates the format of the numbering sequence appended to the file names. For example, ###
indicates a three-digit numbering system. This parameter is essential for maintaining a consistent and organized file naming structure. The format should include hash symbols (#
) to represent the number of digits.
The update_caption_as_well
parameter is a boolean that determines whether associated caption files (e.g., .txt
files with the same base name as the target files) should also be renamed. This is particularly useful when working with image-caption pairs, ensuring that both files remain synchronized. The default value is False
.
The prefix
parameter allows you to add a specific string at the beginning of each file name. This can be used to categorize or label files according to a particular project or theme. There are no specific minimum or maximum values, but it should be a valid string.
The updated_count
output parameter indicates the number of files that were successfully renamed during the operation. This provides a quick summary of the node's activity and helps verify that the intended files were processed.
The log
output parameter provides a detailed message about the renaming operation, including any relevant information such as the time of execution and any issues encountered. This log is useful for tracking the node's performance and diagnosing any potential problems.
directory
path is correct and accessible to avoid errors during the renaming process.numbering_format
to maintain an organized file structure, especially when dealing with large numbers of files.update_caption_as_well
if you are working with paired files, such as images and their corresponding captions, to keep them synchronized.directory
path is correct and that it contains files with the specified file_extension
.file_extension
parameter is not a valid or recognized file extension.file_extension
parameter to ensure it matches the file types you intend to rename.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.