ComfyUI > Nodes > ComfyUI_MieNodes > Copy Files 🐑

ComfyUI Node: Copy Files 🐑

Class Name

CopyFiles|Mie

Category
🐑 MieNodes/🐑 File Operations
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

Copy Files 🐑 Description

Efficiently copy and manage files based on patterns, with options for simulation, deletion, and detailed logs.

Copy Files 🐑| Copy Files 🐑:

The CopyFiles| Copy Files 🐑 node is designed to facilitate the efficient transfer of files from one directory to another, based on specific file patterns. This node is particularly useful for organizing and managing large collections of files by allowing you to specify which files to copy using pattern matching. It offers the flexibility to either perform actual file operations or simulate them, providing a safe way to test the process before execution. Additionally, it can delete the original files after copying, helping to streamline file management tasks. This node is an essential tool for users who need to automate file handling tasks, ensuring that files are copied accurately and efficiently while providing detailed logs of the operations performed.

Copy Files 🐑| Copy Files 🐑 Input Parameters:

source_directory

The source_directory parameter specifies the path to the directory from which files will be copied. It is crucial as it defines the starting point for the file transfer operation. The default value is "X://path/to/source", and it should be set to the directory containing the files you wish to copy. This parameter does not have a minimum or maximum value but must be a valid directory path.

destination_directory

The destination_directory parameter indicates the path to the directory where the files will be copied. It is essential for determining the target location for the copied files. The default value is "X://path/to/destination", and like the source directory, it must be a valid directory path. This parameter ensures that the copied files are organized in the desired location.

pattern

The pattern parameter allows you to specify a file pattern to match, such as "*.txt". This parameter is vital for filtering which files should be copied based on their names or extensions. The default value is "*.txt", but it can be adjusted to match any file pattern you need. This parameter helps in selectively copying files that meet specific criteria.

delete_origin

The delete_origin parameter is a boolean that determines whether the original files should be deleted after they are copied. The default value is False, meaning the original files will remain in the source directory unless this parameter is set to True. This option is useful for freeing up space in the source directory once the files have been successfully copied.

mock

The mock parameter is a boolean that, when set to True, simulates the file copying process without actually performing any file operations. The default value is False, meaning the node will execute the file operations unless this parameter is enabled. This feature is beneficial for testing and verifying the file transfer process without making any changes to the file system.

Copy Files 🐑| Copy Files 🐑 Output Parameters:

copied_file_count

The copied_file_count output parameter returns an integer representing the number of files that were successfully copied. This output is crucial for verifying the success of the file transfer operation and ensuring that the expected number of files have been processed.

log

The log output parameter provides a detailed log message of the operations performed during the file copying process. This log includes information about each file copied, any errors encountered, and the overall success of the operation. It is an essential tool for tracking the process and diagnosing any issues that may arise.

Copy Files 🐑| Copy Files 🐑 Usage Tips:

  • Use the pattern parameter to filter files by type or name, ensuring only the desired files are copied.
  • Enable the mock parameter to test the file copying process without making any changes to your file system, allowing you to verify the operation before execution.
  • Set delete_origin to True if you want to automatically clean up the source directory after copying, which can help manage disk space efficiently.

Copy Files 🐑| Copy Files 🐑 Common Errors and Solutions:

Failed to copy files: <error_message>

  • Explanation: This error occurs when there is an issue during the file copying process, such as a missing source or destination directory, or insufficient permissions.
  • Solution: Ensure that both the source and destination directories exist and that you have the necessary permissions to read from the source and write to the destination. Check for any typos in the directory paths.

No files matching '<pattern>' found in <source_directory>.

  • Explanation: This message indicates that no files in the source directory match the specified pattern.
  • Solution: Verify that the pattern is correct and matches the files you intend to copy. Check the source directory to ensure the files exist and are named according to the pattern.

Copy 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.