Offering a series of utility nodes designed to simplify workflows and enhance efficiency
ComfyUI-MieNodes is a plugin for the ComfyUI ecosystem, offering a series of utility nodes designed to simplify workflows and enhance efficiency.
The plugin provides the following utility nodes, with a focus on dataset file management tasks in LoRA training workflows:
.txt
files to match image files..jpg
or .png
).The plugin also provides utility nodes for general-purpose tasks:
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.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:
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:
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:
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.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
or png
).save_original
(bool): Whether to retain the original files after conversion.Before:
After:
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:
Function: Print the input content as a string.
Parameters:
anything
(*): The input content to display.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").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").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).ComfyUI-MieNodes is under active development and will expand its features in future updates. Planned additions include:
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!