no message

This commit is contained in:
iMac
2024-12-19 17:06:02 +08:00
parent cedfd7b608
commit bd34e56f59
19 changed files with 30 additions and 121 deletions
-8
View File
@@ -30,14 +30,6 @@ ComfyUI-Addoor 是一个为 ComfyUI 设计的自定义节点插件包,提供
- 输出:加载的图片、图片路径、图片名称(带后缀)、图片名称和数量。
- 注意:支持多种图片格式,包括 jpg、jpeg、png、bmp、gif 和 webp。
3. 🌻 删除本地任意文件 (AD_DeleteLocalAny)
- 删除指定的文件或目录。
- 输入:
- Any:要删除的文件或目录路径。
- File_Name:可选的特定文件名,用于在目录中删除。
- 输出:操作状态和已删除的文件路径。
- 注意:请谨慎使用,因为删除操作是永久性的。
4. 🌻 文本列表转字符串 (AD_TextListToString)
- 从目录加载文本文件并合并其内容。
- 输入:
+15 -21
View File
@@ -18,7 +18,6 @@
## ✨ Features
- 🔄 CSV reading and processing
- 📁 Batch image loading and file operations
- 🗜️ ZIP file creation
- 💾 Image and text saving
- 🧮 Training step calculation
@@ -33,17 +32,17 @@
1. Make sure you have ComfyUI installed.
2. Clone this repository into the `custom_nodes` directory of ComfyUI:
```sh
\`\`\`sh
cd ComfyUI/custom_nodes
git clone https://github.com/Eagle-CN/ComfyUI-Addoor.git
```
\`\`\`
3. Install the dependencies:
```sh
\`\`\`sh
cd ComfyUI-Addoor
pip install -r requirements.txt
```
\`\`\`
4. Restart ComfyUI, and the ComfyUI-Addoor nodes will appear in the node list.
@@ -53,18 +52,17 @@ ComfyUI-Addoor adds several new nodes to ComfyUI, each with specific functionali
1. **CSV Reader**: Read and process CSV files.
2. **Batch Image Load**: Load images in batch from a specified directory.
3. **Delete Local Any**: Delete specified files or directories.
4. **Text List To String**: Convert a list of text files to a string.
5. **Any File List**: List files in a directory with various filtering options.
6. **Zip Save**: Create ZIP archive files.
7. **Image Saver**: Save images to a specified directory.
8. **Flux Train Step Math**: Calculate training steps for machine learning models.
9. **Text Saver**: Save text content to a file.
10. **Prompt Replace**: Replace specific content in text.
11. **Hugging Face Download**: Download models or datasets from Hugging Face.
12. **Image Color Filter**: Apply various color adjustments and filter effects.
13. **CSV Prompt Styler**: Style prompts using styles from a CSV file.
14. **Txt To CSV Combiner**: Combine multiple text files into a single CSV file.
3. **Text List To String**: Convert a list of text files to a string.
4. **Any File List**: List files in a directory with various filtering options.
5. **Zip Save**: Create ZIP archive files.
6. **Image Saver**: Save images to a specified directory.
7. **Flux Train Step Math**: Calculate training steps for machine learning models.
8. **Text Saver**: Save text content to a file.
9. **Prompt Replace**: Replace specific content in text.
10. **Hugging Face Download**: Download models or datasets from Hugging Face.
11. **Image Color Filter**: Apply various color adjustments and filter effects.
12. **CSV Prompt Styler**: Style prompts using styles from a CSV file.
13. **Txt To CSV Combiner**: Combine multiple text files into a single CSV file.
Each node can be found in the ComfyUI interface and can be connected with other nodes to create complex workflows.
@@ -78,10 +76,6 @@ Each node can be found in the ComfyUI interface and can be connected with other
- Description: Loads multiple images from a specified directory.
- Note: Supports various image formats including jpg, jpeg, png, bmp, gif, and webp.
3. **Delete Local Any (AD_DeleteLocalAny)**
- Description: Deletes specified files or directories.
- Note: Use with caution as deletions are permanent.
4. **Text List To String (AD_TextListToString)**
- Description: Loads text files and combines their contents.
- Note: Supports txt and csv files.
-3
View File
@@ -1,5 +1,4 @@
from .classes.AD_BatchImageLoadFromDir import AD_BatchImageLoadFromDir, N_CLASS_MAPPINGS as BATCH_CLASS_MAPPINGS, N_DISPLAY_NAME_MAPPINGS as BATCH_DISPLAY_MAPPINGS
# from .classes.AD_DeleteLocalAny import AD_DeleteLocalAny, N_CLASS_MAPPINGS as DELETE_CLASS_MAPPINGS, N_DISPLAY_NAME_MAPPINGS as DELETE_DISPLAY_MAPPINGS
from .classes.AD_TextListToString import AD_TextListToString, N_CLASS_MAPPINGS as TEXT_CLASS_MAPPINGS, N_DISPLAY_NAME_MAPPINGS as TEXT_DISPLAY_MAPPINGS
from .classes.AD_AnyFileList import AD_AnyFileList, N_CLASS_MAPPINGS as ANY_CLASS_MAPPINGS, N_DISPLAY_NAME_MAPPINGS as ANY_DISPLAY_MAPPINGS
from .classes.AD_ZipSave import AD_ZipSave, N_CLASS_MAPPINGS as ZIP_CLASS_MAPPINGS, N_DISPLAY_NAME_MAPPINGS as ZIP_DISPLAY_MAPPINGS
@@ -15,7 +14,6 @@ from .classes.AD_TxtToCSVCombiner import AD_TxtToCSVCombiner, N_CLASS_MAPPINGS a
NODE_CLASS_MAPPINGS = {
**BATCH_CLASS_MAPPINGS,
# **DELETE_CLASS_MAPPINGS, == Be deprecated ==
**TEXT_CLASS_MAPPINGS,
**ANY_CLASS_MAPPINGS,
**ZIP_CLASS_MAPPINGS,
@@ -32,7 +30,6 @@ NODE_CLASS_MAPPINGS = {
NODE_DISPLAY_NAME_MAPPINGS = {
**BATCH_DISPLAY_MAPPINGS,
# **DELETE_DISPLAY_MAPPINGS, == Be deprecated ==
**TEXT_DISPLAY_MAPPINGS,
**ANY_DISPLAY_MAPPINGS,
**ZIP_DISPLAY_MAPPINGS,
-11
View File
@@ -33,17 +33,6 @@
"Count": "数量"
}
},
"AD_DeleteLocalAny": {
"title": "🌻 删除本地任意文件",
"widgets": {
"Any": "任意文件/目录",
"File_Name": "文件名"
},
"outputs": {
"Tips": "提示",
"Deleted_Paths": "已删除路径"
}
},
"AD_TextListToString": {
"title": "🌻 文本列表转字符串",
"widgets": {
+1 -1
View File
@@ -24,7 +24,7 @@ class AD_AnyFileList:
FUNCTION = "process_files"
OUTPUT_NODE = True
OUTPUT_IS_LIST = (False, True, True, True, True, True, False, False)
CATEGORY = "🌻 葵花宝典/批量操作"
CATEGORY = "🌻 Addoor/Batch Operations"
def process_files(self, Directory, Load_Cap, Skip_Frame, Filter_By, Extension, Deep_Search, seed):
file_extensions = {
+1 -1
View File
@@ -20,7 +20,7 @@ class AD_BatchImageLoadFromDir:
FUNCTION = "load_images"
OUTPUT_NODE = True
OUTPUT_IS_LIST = (True, True, True, True, False)
CATEGORY = "🌻 葵花宝典/批量操作"
CATEGORY = "🌻 Addoor/Batch Operations"
def load_images(self, Directory, Load_Cap, Skip_Frame):
image_extensions = ['.jpg', '.jpeg', '.png', '.bmp', '.gif', '.webp']
+1 -1
View File
@@ -24,7 +24,7 @@ class AD_CSVPromptStyler:
RETURN_NAMES = ("styled_positive", "styled_negative", "selected_style")
FUNCTION = "apply_style"
OUTPUT_NODE = True
CATEGORY = "🌻 葵花宝典/CSV控制器"
CATEGORY = "🌻 Addoor/CSV Controller"
@staticmethod
def get_styles(csv_path):
+1 -1
View File
@@ -18,7 +18,7 @@ class AD_CSVReader:
RETURN_NAMES = ("File_Path", "Seed", "Increment", "Full_Content", "Lines", "Total_Lines", "Selected_Line")
FUNCTION = "read_csv"
OUTPUT_NODE = True
CATEGORY = "🌻 葵花宝典/CSV控制器"
CATEGORY = "🌻 Addoor/CSV Controller"
OUTPUT_IS_LIST = (False, False, False, False, True, False, False)
def __init__(self):
-63
View File
@@ -1,63 +0,0 @@
import os
class AD_DeleteLocalAny:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"Any": ("STRING", {"forceInput": True}),
"File_Name": ("STRING", {"default": ""})
},
}
INPUT_IS_LIST = True
RETURN_TYPES = ("STRING", "STRING")
RETURN_NAMES = ("Tips", "Deleted_Paths")
OUTPUT_NODE = True
FUNCTION = "delete_files"
CATEGORY = "🌻 葵花宝典/批量操作"
def delete_files(self, Any, File_Name):
if not isinstance(Any, list):
Any = [Any]
if isinstance(File_Name, list):
File_Name = File_Name[0] if File_Name else ""
elif File_Name is None:
File_Name = ""
tips = []
deleted_paths = []
for item in Any:
if os.path.isdir(item):
for root, dirs, files in os.walk(item):
for file in files:
if not File_Name or file.startswith(File_Name):
file_path = os.path.join(root, file)
try:
os.remove(file_path)
tips.append(f"Deleted file: {file_path}")
deleted_paths.append(file_path)
except Exception as e:
tips.append(f"Error deleting {file_path}: {str(e)}")
elif os.path.isfile(item):
try:
os.remove(item)
tips.append(f"Deleted file: {item}")
deleted_paths.append(item)
except Exception as e:
tips.append(f"Error deleting {item}: {str(e)}")
else:
tips.append(f"'{item}' is not a valid file or directory path")
return ('\n'.join(tips), '\n'.join(deleted_paths))
N_CLASS_MAPPINGS = {
"AD_DeleteLocalAny": AD_DeleteLocalAny,
}
N_DISPLAY_NAME_MAPPINGS = {
"AD_DeleteLocalAny": "🌻 Delete Local Any",
}
+1 -1
View File
@@ -16,7 +16,7 @@ class AD_FluxTrainStepMath:
RETURN_TYPES = ("INT", "INT")
RETURN_NAMES = ("Total_Training_Steps", "Steps_Per_Epoch")
FUNCTION = "calculate"
CATEGORY = "🌻 葵花宝典/实用工具"
CATEGORY = "🌻 Addoor/Utilities"
def calculate(self, Material_Count, Training_Times_Per_Image, Epoch, equation):
operators = {ast.Add: op.add, ast.Sub: op.sub, ast.Mult: op.mul,
+1 -1
View File
@@ -32,7 +32,7 @@ class AD_HFDownload:
RETURN_NAMES = ("Download_Path", "Status")
FUNCTION = "download_from_hf"
OUTPUT_NODE = True
CATEGORY = "🌻 葵花宝典/实用工具"
CATEGORY = "🌻 Addoor/Utilities"
def parse_hf_url(self, url):
"""Parse Hugging Face URL to extract repository info."""
+1 -1
View File
@@ -23,7 +23,7 @@ class AD_ImageColorFilter:
RETURN_TYPES = ("IMAGE",)
FUNCTION = "apply_filter"
CATEGORY = "🌻 葵花宝典/实用工具"
CATEGORY = "🌻 Addoor/Utilities"
def apply_filter(self, image, exposure, clarity, highlights, shadows, contrast, saturation, vibrance, temperature, sharpness):
# Ensure image is in the correct format
+1 -1
View File
@@ -25,7 +25,7 @@ class AD_ImageSaver:
RETURN_NAMES = ("Output_Directory",)
FUNCTION = "save_images"
OUTPUT_NODE = True
CATEGORY = "🌻 葵花宝典/输出保存"
CATEGORY = "🌻 Addoor/Output Saving"
def save_images(self, Images, Directory, Filename_Prefix, Open_Output_Directory, prompt=None, extra_pnginfo=None):
try:
+1 -1
View File
@@ -19,7 +19,7 @@ class AD_PromptReplace:
RETURN_TYPES = ("STRING", "INT")
RETURN_NAMES = ("Replaced_Text", "new_seed")
FUNCTION = "replace_prompt"
CATEGORY = "🌻 葵花宝典/实用工具"
CATEGORY = "🌻 Addoor/Utilities"
def replace_prompt(self, Content: str, Match: str, Replace: str, seed: int, Increment: int):
content_lines = Content.split('\n')
+1 -1
View File
@@ -18,7 +18,7 @@ class AD_TextListToString:
FUNCTION = "load_text_files"
OUTPUT_NODE = True
OUTPUT_IS_LIST = (True, True, True, True, False, False)
CATEGORY = "🌻 葵花宝典/批量操作"
CATEGORY = "🌻 Addoor/Batch Operations"
def load_text_files(self, Directory, Load_Cap, Skip_Frame):
text_extensions = ['.txt', '.csv']
+1 -1
View File
@@ -23,7 +23,7 @@ class AD_TextSaver:
RETURN_NAMES = ("File_Path",)
FUNCTION = "save_text_file"
OUTPUT_NODE = True
CATEGORY = "🌻 葵花宝典/输出保存"
CATEGORY = "🌻 Addoor/Output Saving"
def save_text_file(self, text, directory, filename_prefix='ComfyUI', filename_delimiter='_', filename_number_padding=4, file_extension='.txt', encoding='utf-8'):
directory = self.parse_tokens(directory)
+1 -1
View File
@@ -19,7 +19,7 @@ class AD_TxtToCSVCombiner:
RETURN_NAMES = ("output_csv_path",)
FUNCTION = "combine_txt_to_csv"
OUTPUT_NODE = True
CATEGORY = "🌻 葵花宝典/CSV控制器"
CATEGORY = "🌻 Addoor/CSV Controller"
def combine_txt_to_csv(self, input_directory, output_directory, output_filename, add_header, sort_by_filename):
if not os.path.exists(input_directory):
+1 -1
View File
@@ -17,7 +17,7 @@ class AD_ZipSave:
RETURN_NAMES = ("Zip_Path", "Status")
FUNCTION = "zip_and_save"
OUTPUT_NODE = True
CATEGORY = "🌻 葵花宝典/输出保存"
CATEGORY = "🌻 Addoor/Output Saving"
def zip_and_save(self, Input_Directory: str, Output_Directory: str, Zip_Filename: str) -> tuple[str, str]:
if not os.path.exists(Input_Directory):
+2 -2
View File
@@ -380,7 +380,7 @@ Style: Baga,"Baga style {prompt} . African, mask, spiritual, highly detailed","n
电影: 醉乡民谣,"Inside Llewyn Davis {prompt} . Drama, folk music, 1960s, highly detailed","action, pop music, modern day, undetailed"
电影: 亡命驾驶,"Drive {prompt} . Action, neon, 1980s aesthetic, highly detailed","romantic comedy, daylight, modern aesthetic, undetailed"
电影: 霓虹恶魔,"The Neon Demon {prompt} . Horror, fashion, Los Angeles, highly detailed","romantic comedy, construction, New York, undetailed"
电影: 它在身后,"It Follows {prompt} . Horror, supernatural, suburbia, highly detailed","romantic comedy, natural, city, undetailed"
电影: 它��身后,"It Follows {prompt} . Horror, supernatural, suburbia, highly detailed","romantic comedy, natural, city, undetailed"
电影: 敦刻尔克,"Dunkirk {prompt} . War, World War II, beach, highly detailed","romantic comedy, peace, city, undetailed"
电影: 她,"Her {prompt} . Romance, sci-fi, artificial intelligence, highly detailed","action, reality, human intelligence, undetailed"
电影: 荒野猎人,"The Revenant {prompt} . Drama, survival, wilderness, highly detailed","romantic comedy, luxury, city, undetailed"
@@ -480,7 +480,7 @@ Style: 辛普森一家,"The Simpsons {prompt} . Animation, satire, family themes
Style: 恶搞之家,"Family Guy {prompt} . Animation, adult humor, satirical themes, cartoonish designs, highly detailed","anime, manga, Disney, Pixar, black and white"
Style: 开心汉堡店,"Bob's Burgers {prompt} . Animation, family themes, humor, quirky characters, highly detailed","anime, manga, Disney, Pixar, black and white"
Style: 怪诞小镇,"Gravity Falls {prompt} . Cartoon, mystery, fantasy themes, unique character designs, highly detailed","anime, manga, Disney, Pixar, black and white"
Style: 宇宙小子,"Steven Universe {prompt} . Cartoon, LGBTQ+ themes, fantasy, vibrant colors, unique character designs, highly detailed","anime, manga, Disney, Pixar, black and white"
Style: 宇宙���子,"Steven Universe {prompt} . Cartoon, LGBTQ+ themes, fantasy, vibrant colors, unique character designs, highly detailed","anime, manga, Disney, Pixar, black and white"
Style: 海贼王,"One Piece {prompt} . Manga, adventure, pirates, dynamic battles, unique character designs, highly detailed","cartoon, realism, Disney, Pixar, black and white"
Style: 进击的巨人,"Attack on Titan {prompt} . Anime, dystopian, giants, dynamic battles, highly detailed","cartoon, realism, Disney, Pixar, black and white"
Style: 我的英雄学院,"My Hero Academia {prompt} . Anime, superhero, high school, dynamic battles, unique character designs, highly detailed","cartoon, realism, Disney, Pixar, black and white"
1 name prompt negative_prompt
380 电影: 亡命驾驶 Drive {prompt} . Action, neon, 1980s aesthetic, highly detailed romantic comedy, daylight, modern aesthetic, undetailed
381 电影: 霓虹恶魔 The Neon Demon {prompt} . Horror, fashion, Los Angeles, highly detailed romantic comedy, construction, New York, undetailed
382 电影: 它在身后 电影: 它��身后 It Follows {prompt} . Horror, supernatural, suburbia, highly detailed romantic comedy, natural, city, undetailed
383 电影: 敦刻尔克 Dunkirk {prompt} . War, World War II, beach, highly detailed romantic comedy, peace, city, undetailed
384 电影: 她 Her {prompt} . Romance, sci-fi, artificial intelligence, highly detailed action, reality, human intelligence, undetailed
385 电影: 荒野猎人 The Revenant {prompt} . Drama, survival, wilderness, highly detailed romantic comedy, luxury, city, undetailed
386 电影: 爆裂鼓手 Whiplash {prompt} . Drama, music, drumming, highly detailed action, silence, no music, undetailed
480 Style: 开心汉堡店 Bob's Burgers {prompt} . Animation, family themes, humor, quirky characters, highly detailed anime, manga, Disney, Pixar, black and white
481 Style: 怪诞小镇 Gravity Falls {prompt} . Cartoon, mystery, fantasy themes, unique character designs, highly detailed anime, manga, Disney, Pixar, black and white
482 Style: 宇宙小子 Style: 宇宙���子 Steven Universe {prompt} . Cartoon, LGBTQ+ themes, fantasy, vibrant colors, unique character designs, highly detailed anime, manga, Disney, Pixar, black and white
483 Style: 海贼王 One Piece {prompt} . Manga, adventure, pirates, dynamic battles, unique character designs, highly detailed cartoon, realism, Disney, Pixar, black and white
484 Style: 进击的巨人 Attack on Titan {prompt} . Anime, dystopian, giants, dynamic battles, highly detailed cartoon, realism, Disney, Pixar, black and white
485 Style: 我的英雄学院 My Hero Academia {prompt} . Anime, superhero, high school, dynamic battles, unique character designs, highly detailed cartoon, realism, Disney, Pixar, black and white
486 Style: 火影忍者 Naruto {prompt} . Anime, ninjas, coming-of-age, dynamic battles, unique character designs, highly detailed cartoon, realism, Disney, Pixar, black and white