ComfyUI > Nodes > ComfyUI_MieNodes > Batch Rename Files 🐑

ComfyUI Node: Batch Rename Files 🐑

Class Name

BatchRenameFiles|Mie

Category
🐑 MieNodes/🐑 Caption Tools
Author
mie (Account age: 1888days)
Extension
ComfyUI_MieNodes
Latest Updated
2025-04-17
Github Stars
0.05K

How to Install ComfyUI_MieNodes

Install this extension via the ComfyUI Manager by searching for ComfyUI_MieNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_MieNodes in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Batch Rename Files 🐑 Description

Automate file renaming with prefix, numbering, and caption updates for efficient organization and productivity.

Batch Rename Files 🐑| Batch Rename Files 🐑:

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.

Batch Rename Files 🐑| Batch Rename Files 🐑 Input Parameters:

directory

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.

file_extension

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.

numbering_format

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.

update_caption_as_well

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.

prefix

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.

Batch Rename Files 🐑| Batch Rename Files 🐑 Output Parameters:

updated_count

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.

log

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.

Batch Rename Files 🐑| Batch Rename Files 🐑 Usage Tips:

  • Ensure that the directory path is correct and accessible to avoid errors during the renaming process.
  • Use a consistent numbering_format to maintain an organized file structure, especially when dealing with large numbers of files.
  • Consider enabling update_caption_as_well if you are working with paired files, such as images and their corresponding captions, to keep them synchronized.

Batch Rename Files 🐑| Batch Rename Files 🐑 Common Errors and Solutions:

No files found in directory

  • Explanation: This error occurs when the specified directory does not contain any files with the given file extension.
  • Solution: Verify that the directory path is correct and that it contains files with the specified file_extension.

Permission denied

  • Explanation: This error may occur if the node does not have the necessary permissions to rename files in the specified directory.
  • Solution: Ensure that you have the appropriate permissions to modify files in the directory, or try running the operation with elevated privileges.

Invalid file extension

  • Explanation: This error arises when the file_extension parameter is not a valid or recognized file extension.
  • Solution: Double-check the file_extension parameter to ensure it matches the file types you intend to rename.

Batch Rename Files 🐑 Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_MieNodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

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.