From 6e06828aa498a1b8194d7c514bd0af8c0c1a3cc0 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Sun, 28 Jan 2024 17:24:11 +0900 Subject: [PATCH] update scanner.py update DB --- custom-node-list.json | 33 +++++++++++++++++++++++++++-- extension-node-map.json | 32 +++++++++++++++++++++++++++- node_db/new/custom-node-list.json | 30 ++++++++++++++++++++++++++ node_db/new/extension-node-map.json | 32 +++++++++++++++++++++++++++- scanner.py | 25 ++++++++++++++++++++++ 5 files changed, 148 insertions(+), 4 deletions(-) diff --git a/custom-node-list.json b/custom-node-list.json index b332c90..fcc2525 100644 --- a/custom-node-list.json +++ b/custom-node-list.json @@ -4664,9 +4664,38 @@ "install_type": "git-clone", "description": "Transcribe audio and add subtitles to videos using Whisper in ComfyUI" }, + { + "author": "blepping", + "title": "ComfyUI-bleh", + "reference": "https://github.com/blepping/ComfyUI-bleh", + "files": [ + "https://github.com/blepping/ComfyUI-bleh" + ], + "install_type": "git-clone", + "description": "Better TAESD previews, BlehHyperTile." + }, + { + "author": "JerryOrbachJr", + "title": "ComfyUI-RandomSize", + "reference": "https://github.com/JerryOrbachJr/ComfyUI-RandomSize", + "files": [ + "https://github.com/JerryOrbachJr/ComfyUI-RandomSize" + ], + "install_type": "git-clone", + "description": "A ComfyUI custom node that randomly selects a height and width pair from a list in a config file" + }, + { + "author": "jamal-alkharrat", + "title": "ComfyUI_rotate_image", + "reference": "https://github.com/jamal-alkharrat/ComfyUI_rotate_image", + "files": [ + "https://github.com/jamal-alkharrat/ComfyUI_rotate_image" + ], + "install_type": "git-clone", + "description": "ComfyUI Custom Node to Rotate Images, Img2Img node." + }, + - - { "author": "Ser-Hilary", diff --git a/extension-node-map.json b/extension-node-map.json index f31a65a..9fd051b 100644 --- a/extension-node-map.json +++ b/extension-node-map.json @@ -886,6 +886,7 @@ [ "ReActorFaceSwap", "ReActorLoadFaceModel", + "ReActorRestoreFace", "ReActorSaveFaceModel" ], { @@ -1090,6 +1091,18 @@ "title_aux": "Rembg Background Removal Node for ComfyUI" } ], + "https://github.com/JerryOrbachJr/ComfyUI-RandomSize": [ + [ + "JOJR_RandomSize" + ], + { + "author": "JerryOrbachJr", + "description": "A ComfyUI custom node that randomly selects a height and width pair from a list in a config file", + "nickname": "Random Size", + "title": "Random Size", + "title_aux": "ComfyUI-RandomSize" + } + ], "https://github.com/Jordach/comfy-plasma": [ [ "JDC_AutoContrast", @@ -3449,6 +3462,14 @@ "title_aux": "CLIPSeg" } ], + "https://github.com/blepping/ComfyUI-bleh": [ + [ + "BlehHyperTile" + ], + { + "title_aux": "ComfyUI-bleh" + } + ], "https://github.com/bmad4ever/comfyui_ab_samplercustom": [ [ "AB SamplerCustom (experimental)" @@ -5073,6 +5094,14 @@ "title_aux": "Efficiency Nodes for ComfyUI Version 2.0+" } ], + "https://github.com/jamal-alkharrat/ComfyUI_rotate_image": [ + [ + "RotateImage" + ], + { + "title_aux": "ComfyUI_rotate_image" + } + ], "https://github.com/jamesWalker55/comfyui-various": [ [], { @@ -5342,6 +5371,7 @@ ], "https://github.com/komojini/komojini-comfyui-nodes": [ [ + "BatchCreativeInterpolationNodeDynamicSettings", "CachedGetter", "DragNUWAImageCanvas", "FlowBuilder", @@ -6407,6 +6437,7 @@ "AreaToMask", "CLIPSeg", "CLIPSeg_", + "CenterImage", "CharacterInText", "ChatGPTOpenAI", "CkptNames_", @@ -6473,7 +6504,6 @@ "https://github.com/shiimizu/ComfyUI-PhotoMaker-Plus": [ [ "PhotoMakerEncodePlus", - "PhotoMakerLoader", "PhotoMakerStyles", "PrepImagesForClipVisionFromPath" ], diff --git a/node_db/new/custom-node-list.json b/node_db/new/custom-node-list.json index 746c900..f71fcf9 100644 --- a/node_db/new/custom-node-list.json +++ b/node_db/new/custom-node-list.json @@ -10,6 +10,36 @@ }, + { + "author": "jamal-alkharrat", + "title": "ComfyUI_rotate_image", + "reference": "https://github.com/jamal-alkharrat/ComfyUI_rotate_image", + "files": [ + "https://github.com/jamal-alkharrat/ComfyUI_rotate_image" + ], + "install_type": "git-clone", + "description": "ComfyUI Custom Node to Rotate Images, Img2Img node." + }, + { + "author": "JerryOrbachJr", + "title": "ComfyUI-RandomSize", + "reference": "https://github.com/JerryOrbachJr/ComfyUI-RandomSize", + "files": [ + "https://github.com/JerryOrbachJr/ComfyUI-RandomSize" + ], + "install_type": "git-clone", + "description": "A ComfyUI custom node that randomly selects a height and width pair from a list in a config file" + }, + { + "author": "blepping", + "title": "ComfyUI-bleh", + "reference": "https://github.com/blepping/ComfyUI-bleh", + "files": [ + "https://github.com/blepping/ComfyUI-bleh" + ], + "install_type": "git-clone", + "description": "Better TAESD previews, BlehHyperTile." + }, { "author": "yuvraj108c", "title": "ComfyUI Whisper", diff --git a/node_db/new/extension-node-map.json b/node_db/new/extension-node-map.json index f31a65a..9fd051b 100644 --- a/node_db/new/extension-node-map.json +++ b/node_db/new/extension-node-map.json @@ -886,6 +886,7 @@ [ "ReActorFaceSwap", "ReActorLoadFaceModel", + "ReActorRestoreFace", "ReActorSaveFaceModel" ], { @@ -1090,6 +1091,18 @@ "title_aux": "Rembg Background Removal Node for ComfyUI" } ], + "https://github.com/JerryOrbachJr/ComfyUI-RandomSize": [ + [ + "JOJR_RandomSize" + ], + { + "author": "JerryOrbachJr", + "description": "A ComfyUI custom node that randomly selects a height and width pair from a list in a config file", + "nickname": "Random Size", + "title": "Random Size", + "title_aux": "ComfyUI-RandomSize" + } + ], "https://github.com/Jordach/comfy-plasma": [ [ "JDC_AutoContrast", @@ -3449,6 +3462,14 @@ "title_aux": "CLIPSeg" } ], + "https://github.com/blepping/ComfyUI-bleh": [ + [ + "BlehHyperTile" + ], + { + "title_aux": "ComfyUI-bleh" + } + ], "https://github.com/bmad4ever/comfyui_ab_samplercustom": [ [ "AB SamplerCustom (experimental)" @@ -5073,6 +5094,14 @@ "title_aux": "Efficiency Nodes for ComfyUI Version 2.0+" } ], + "https://github.com/jamal-alkharrat/ComfyUI_rotate_image": [ + [ + "RotateImage" + ], + { + "title_aux": "ComfyUI_rotate_image" + } + ], "https://github.com/jamesWalker55/comfyui-various": [ [], { @@ -5342,6 +5371,7 @@ ], "https://github.com/komojini/komojini-comfyui-nodes": [ [ + "BatchCreativeInterpolationNodeDynamicSettings", "CachedGetter", "DragNUWAImageCanvas", "FlowBuilder", @@ -6407,6 +6437,7 @@ "AreaToMask", "CLIPSeg", "CLIPSeg_", + "CenterImage", "CharacterInText", "ChatGPTOpenAI", "CkptNames_", @@ -6473,7 +6504,6 @@ "https://github.com/shiimizu/ComfyUI-PhotoMaker-Plus": [ [ "PhotoMakerEncodePlus", - "PhotoMakerLoader", "PhotoMakerStyles", "PrepImagesForClipVisionFromPath" ], diff --git a/scanner.py b/scanner.py index 07809ae..8b8d4de 100644 --- a/scanner.py +++ b/scanner.py @@ -1,3 +1,4 @@ +import ast import re import os import json @@ -22,6 +23,28 @@ if not os.path.exists(temp_dir): print(f"TEMP DIR: {temp_dir}") +def extract_nodes(code_text): + try: + parsed_code = ast.parse(code_text) + + assignments = (node for node in parsed_code.body if isinstance(node, ast.Assign)) + + for assignment in assignments: + if isinstance(assignment.targets[0], ast.Name) and assignment.targets[0].id == 'NODE_CLASS_MAPPINGS': + node_class_mappings = assignment.value + break + else: + node_class_mappings = None + + if node_class_mappings: + s = set([key.s.strip() for key in node_class_mappings.keys if key is not None]) + return s + else: + return set() + except: + return set() + + # scan def scan_in_file(filename, is_builtin=False): global builtin_nodes @@ -39,6 +62,8 @@ def scan_in_file(filename, is_builtin=False): nodes = set() class_dict = {} + nodes |= extract_nodes(code) + pattern2 = r'^[^=]*_CLASS_MAPPINGS\["(.*?)"\]' keys = re.findall(pattern2, code) for key in keys: