Skip to content

Copies a model from ComfyUI's /models/ directory to the /output/ directory so it can be downloaded from a remote instance

License

Notifications You must be signed in to change notification settings

apeirography/ModelCopyNode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Model Copy Node for ComfyUI

A simple ComfyUI custom node that copies model files from the models/ folder to the output/ folder.

Author

Daïm Al-Yad (@daimalyad)

License

MIT License

Installation

  1. Copy the ModelCopyNode folder to your ComfyUI custom_nodes/ directory
  2. Restart ComfyUI
  3. The node will appear in the node menu under the "file_operations" category

Usage

Inputs

  • file_path (STRING): The relative path to the file within the models folder
    • Example: checkpoint/model.safetensors
    • Example: loras/my_lora.safetensors
    • Example: embeddings/textual_inversion.pt

Outputs

  • success (BOOLEAN): Whether the copy operation was successful
  • output_path (STRING): The full path where the file was copied to
  • error_message (STRING): Error message if the copy failed (empty string if successful)

Example Workflow

  1. Add the "Model Copy Node" to your workflow
  2. Connect a text input or use the text field directly
  3. Enter the relative path to your file (e.g., checkpoint/model.safetensors)
  4. Execute the workflow
  5. Check the outputs to verify success

Features

  • Automatically creates output directories if they don't exist
  • Preserves file metadata using shutil.copy2
  • Comprehensive error handling and validation
  • Only copies the file name to the output folder (not the full directory structure)
  • Safe file operations with proper path validation

Notes

  • The node expects a models/ folder in your ComfyUI root directory
  • Files are copied to the output/ folder in your ComfyUI root directory
  • Only the filename is preserved in the output folder (not the subdirectory structure)
  • The node will create any necessary subdirectories in the output folder

Error Handling

The node handles various error conditions:

  • Empty or invalid file paths
  • Source file not found
  • Permission errors
  • OS-level errors
  • General exceptions

All errors are returned as descriptive messages in the error_message output.

About

Copies a model from ComfyUI's /models/ directory to the /output/ directory so it can be downloaded from a remote instance

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages