Nodes Browser
ComfyDeploy: How ComfyUI_MieNodes works in ComfyUI?
What is ComfyUI_MieNodes?
Offering a series of utility nodes designed to simplify workflows and enhance efficiency
How to install it in ComfyDeploy?
Head over to the machine page
- Click on the "Create a new machine" button
- Select the
Edit
build steps - Add a new step -> Custom Node
- Search for
ComfyUI_MieNodes
and select it - Close the build step dialig and then click on the "Save" button to rebuild the machine
ComfyUI-MieNodes
ComfyUI-MieNodes is a plugin for the ComfyUI ecosystem, offering a series of utility nodes designed to simplify workflows and enhance efficiency.
Current Features
LoRA Training Caption Preparation Features
The plugin provides the following utility nodes, with a focus on dataset file management tasks in LoRA training workflows:
- Batch edit caption files (Insert/Append/Replace operations).
- Batch rename files, add prefixes, and format file numbering for specific file types.
- Synchronize image and caption files, with support for automatically creating or removing
.txt
files to match image files. - Batch read caption files, with support for extracting all file contents for analysis and summarization by large language models.
- Batch convert image files, enabling conversion of all image files to a specified format (
.jpg
or.png
). - Batch delete files with the specified extension and optional prefix.
- Remove duplicated (same content) image files in the specified directory.
- Save any data as a file in TOML, JSON, or TXT format.
- Compare two files (in TOML or JSON format) and return the differences.
Common Features
The plugin also provides utility nodes for general-purpose tasks:
- Display any input as a string.
- Download files from huggingface, hf-mirror, github or anywhere to models folder.
Nodes
BatchRenameFiles
Function: Batch rename files and add a prefix and numbering.
Parameters:
directory
(str): Path to the directory.file_extension
(str): File extension to operate on (e.g.,.jpg
,.txt
).numbering_format
(str): Numbering format (###
means three digits).update_caption_as_well
(bool): Whether to also rename.txt
files with the same name.prefix
(str, optional): Prefix to add to the file name.
BatchDeleteFiles
Function: Batch delete files with the specified extension and optional prefix.
Parameters:
directory
(str): Path to the directory.file_extension
(str): File extension to delete (e.g.,.jpg
,.txt
).prefix
(str, optional): Prefix to check before deleting files.
Before:
After:
BatchEditTextFiles
Function: Perform operations on text files (Insert, Append, Replace, or Remove).
Parameters:
directory
(str): Path to the directory.operation
(str): Type of operation (insert
,append
,replace
,remove
).file_extension
(str, optional): File extension to operate on (e.g.,.txt
).target_text
(str, optional): Text to replace or remove (only used for Replace or Remove operations).new_text
(str, optional): New content to insert, append, or replace.
Before:
After:
BatchSyncImageCaptionFiles
Function: Add caption files (.txt
files with the same name) for image files in a directory.
Parameters:
directory
(str): Path to the directory.caption_content
(str): Content to populate in the caption file (e.g.,"nazha,"
).
Before:
After:
SummaryTextFiles
Function: Summarize the content of all text files in a directory.
Parameters:
directory
(str): Path to the directory.add_separator
(bool): Whether to add a separator between file contents.save_to_file
(bool): Whether to save the summarized content to a file.file_extension
(str, optional): File extension to operate on (e.g.,.txt
).summary_file_name
(str, optional): Name of the file to save the summary.
BatchConvertImageFiles
Function: Convert all images in a specified directory to the target format.
Parameters:
directory
(str): Path to the directory.target_format
(str): Target image format (jpg
orpng
).save_original
(bool): Whether to retain the original files after conversion.
Before:
After:
DedupImageFiles
Function: Remove duplicate image files in a specific directory.
Parameters:
directory
(str): Path to the directory.max_distance_threshold
(int): Maximum Hamming distance threshold for identifying duplicates.
Before:
After:
ShowAnythingMie
Function: Print the input content as a string.
Parameters:
anything
(*): The input content to display.
SaveAnythingAsFile
Function: Save data to a file in either TOML, JSON, or TXT format.
Parameters:
data
(*): The data to save.directory
(str): The directory to save the file in.file_name
(str): The name of the output file.save_format
(str): The format to save the data in ("json", "toml", or "txt").
CompareFiles
Function: Compare two files and return the differences. Parameter:
file1_path
(str): The path to the first file.file2_path
(str): The path to the second file.file_format
(str): The format of the files ("json" or "toml").
ModelDownloader
Function: Download files from Hugging Face, hf-mirror, GitHub, or any other source to the models folder. Parameters:
url
(str): The URL of the file to download.save_path
(str): The path to save the downloaded file.override
(bool): Whether to override the existing file if it already exists.use_hf_mirror
(bool): Whether to use the Hugging Face mirror URL.rename_to
(str, optional): The new name for the downloaded file (optional).hf_token
(str, optional): The Hugging Face token for authentication (optional).trigger_signal
(*, optional): A signal to trigger the download (optional).
Future Plans
ComfyUI-MieNodes is under active development and will expand its features in future updates. Planned additions include:
- Automatic reverse caption generation for images.
- Support for complex node chaining to improve data flow integration.
As the author is a content creator, the plugin will also include many practical tools developed to address specific video production needs. Stay tuned for more updates!
Contact Me
- Bilibili: @黎黎原上咩
- YouTube: @SweetValberry