ComfyUI > Nodes > ComfyUI_MieNodes > Batch Delete Files 🐑

ComfyUI Node: Batch Delete Files 🐑

Class Name

BatchDeleteFiles|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 Delete Files 🐑 Description

Streamline file removal in specified directory by extension and prefix, automating deletion for organized storage space.

Batch Delete Files 🐑| Batch Delete Files 🐑:

The BatchDeleteFiles| Batch Delete Files 🐑 node is designed to streamline the process of removing unwanted files from a specified directory. This node is particularly useful for managing large collections of files by allowing you to delete files based on their extension and an optional prefix. By automating the deletion process, it helps maintain an organized file system, freeing up storage space and reducing clutter. The node is capable of handling various file types, making it versatile for different use cases, such as cleaning up temporary files, removing outdated documents, or managing media libraries. Its primary goal is to provide a simple yet effective solution for batch file deletion, ensuring that only the files you specify are removed, thus minimizing the risk of accidental data loss.

Batch Delete Files 🐑| Batch Delete Files 🐑 Input Parameters:

directory

The directory parameter specifies the path to the folder where the files you want to delete are located. This parameter is crucial as it defines the scope of the deletion operation. The node will only search for and delete files within this directory. There are no specific minimum or maximum values for this parameter, but it must be a valid directory path on your system.

file_extension

The file_extension parameter determines the type of files to be deleted by specifying their extension, such as .jpg or .txt. This parameter is essential for targeting specific file types, ensuring that only files with the given extension are considered for deletion. There are no default values, and it must be a valid file extension.

prefix

The prefix parameter is optional and allows you to further refine the deletion criteria by specifying a prefix that the file names should start with. This is useful for deleting files that follow a particular naming convention. If no prefix is provided, the node will consider all files with the specified extension. There are no default values, and it can be an empty string if not needed.

trigger_signal

The trigger_signal parameter is optional and can be used to initiate the deletion process based on an external event or condition. This parameter is not mandatory for the node to function, and its use depends on the specific requirements of your workflow.

Batch Delete Files 🐑| Batch Delete Files 🐑 Output Parameters:

deleted_count

The deleted_count output parameter provides the number of files that were successfully deleted during the operation. This count is useful for verifying the effectiveness of the deletion process and ensuring that the intended files were removed.

log_message

The log_message output parameter offers a detailed log of the deletion operation, including the number of files deleted and the directory from which they were removed. This log is valuable for record-keeping and troubleshooting, as it provides a timestamped account of the action taken.

Batch Delete Files 🐑| Batch Delete Files 🐑 Usage Tips:

  • Ensure that the directory path is correct and accessible to avoid errors during the deletion process.
  • Use the file_extension and prefix parameters to precisely target the files you want to delete, minimizing the risk of accidental data loss.
  • Consider using the trigger_signal parameter to automate the deletion process as part of a larger workflow, such as cleaning up temporary files after a batch processing task.

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

FileNotFoundError

  • Explanation: This error occurs when the specified directory does not exist or is not accessible.
  • Solution: Verify that the directory path is correct and that you have the necessary permissions to access it.

PermissionError

  • Explanation: This error arises when the node does not have the required permissions to delete files in the specified directory.
  • Solution: Ensure that you have the appropriate permissions to modify the contents of the directory, or run the node with elevated privileges.

ValueError: Invalid file extension

  • Explanation: This error is triggered when the file_extension parameter is not a valid file extension format.
  • Solution: Check that the file_extension is correctly formatted, starting with a dot (e.g., .txt, .jpg).

No files deleted

  • Explanation: This situation occurs when no files match the specified file_extension and prefix criteria.
  • Solution: Double-check the file_extension and prefix parameters to ensure they match the files you intend to delete.

Batch Delete 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.