From d3f544189993ad41934fd0f4a1e94012492f72ff Mon Sep 17 00:00:00 2001 From: "dr.lt.data" Date: Wed, 6 Sep 2023 17:22:50 +0900 Subject: [PATCH] fix: scanner.py update DB --- custom-node-list.json | 2 +- extension-node-map.json | 3 -- model-list.json | 60 +++++++++++++++++++++++++++++ node_db/new/custom-node-list.json | 2 +- node_db/new/extension-node-map.json | 3 -- node_db/new/model-list.json | 60 +++++++++++++++++++++++++++++ scanner.py | 6 +-- 7 files changed, 125 insertions(+), 11 deletions(-) diff --git a/custom-node-list.json b/custom-node-list.json index f01acebe..c1b8e2d8 100644 --- a/custom-node-list.json +++ b/custom-node-list.json @@ -1618,7 +1618,7 @@ "https://github.com/mav-rik/facerestore_cf" ], "install_type": "git-clone", - "description": "This is a copy of facerestore custom node with a bit of a change to support CodeFormer Fidelity parameter. These ComfyUI nodes can be used to restore faces in images similar to the face restore option in AUTOMATIC1111 webui." + "description": "This is a copy of facerestore custom node with a bit of a change to support CodeFormer Fidelity parameter. These ComfyUI nodes can be used to restore faces in images similar to the face restore option in AUTOMATIC1111 webui.
NOTE: To use this node, you need to download the face restoration model and face detection model from the 'Install models' menu." }, { "author": "braintacles", diff --git a/extension-node-map.json b/extension-node-map.json index 16c053a9..7ed2b74d 100644 --- a/extension-node-map.json +++ b/extension-node-map.json @@ -2069,7 +2069,6 @@ "IterativeLatentUpscale", "KSamplerAdvancedProvider", "KSamplerProvider", - "LatentCompositeMasked", "LatentPixelScale", "LatentReceiver", "LatentSender", @@ -2135,13 +2134,11 @@ ], "https://github.com/ltdrdata/ComfyUI-Inspire-Pack": [ [ - "Canny", "Canny_Preprocessor_Provider_for_SEGS //Inspire", "KSampler //Inspire", "LoraBlockInfo //Inspire", "LoraLoaderBlockWeight //Inspire", "OpenPose_Preprocessor_Provider_for_SEGS //Inspire", - "OpenposePreprocessor", "XY Input: Lora Block Weight //Inspire" ], { diff --git a/model-list.json b/model-list.json index efed3b4c..2cc0cda7 100644 --- a/model-list.json +++ b/model-list.json @@ -1092,6 +1092,66 @@ "reference": "https://huggingface.co/furusu/PFG", "filename": "pfg-wd15beta2-n10.pt", "url": "https://huggingface.co/furusu/PFG/resolve/main/pfg-wd15beta2-n10.pt" + }, + { + "name": "GFPGANv1.4.pth", + "type": "GFPGAN", + "base": "GFPGAN", + "save_path": "facerestore_models", + "description": "Face Restoration Models. Download the model required for using the 'Facerestore CF (Code Former)' custom node.", + "reference": "https://github.com/TencentARC/GFPGAN/releases", + "filename": "GFPGANv1.4.pth", + "url": "https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/GFPGANv1.4.pth" + }, + { + "name": "codeformer.pth", + "type": "CodeFormer", + "base": "CodeFormer", + "save_path": "facerestore_models", + "description": "Face Restoration Models. Download the model required for using the 'Facerestore CF (Code Former)' custom node.", + "reference": "https://github.com/sczhou/CodeFormer/releases", + "filename": "codeformer.pth", + "url": "https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/codeformer.pth" + }, + { + "name": "detection_Resnet50_Final.pth", + "type": "facexlib", + "base": "facexlib", + "save_path": "facerestore_models", + "description": "Face Detection Models. Download the model required for using the 'Facerestore CF (Code Former)' custom node.", + "reference": "https://github.com/xinntao/facexlib", + "filename": "detection_Resnet50_Final.pth", + "url": "https://github.com/xinntao/facexlib/releases/download/v0.1.0/detection_Resnet50_Final.pth" + }, + { + "name": "detection_mobilenet0.25_Final.pth", + "type": "facexlib", + "base": "facexlib", + "save_path": "facerestore_models", + "description": "Face Detection Models. Download the model required for using the 'Facerestore CF (Code Former)' custom node.", + "reference": "https://github.com/xinntao/facexlib", + "filename": "detection_mobilenet0.25_Final.pth", + "url": "https://github.com/xinntao/facexlib/releases/download/v0.1.0/detection_mobilenet0.25_Final.pth" + }, + { + "name": "yolov5l-face.pth", + "type": "facexlib", + "base": "facexlib", + "save_path": "facedetection", + "description": "Face Detection Models. Download the model required for using the 'Facerestore CF (Code Former)' custom node.", + "reference": "https://github.com/xinntao/facexlib", + "filename": "yolov5l-face.pth", + "url": "https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/yolov5l-face.pth" + }, + { + "name": "yolov5n-face.pth", + "type": "facexlib", + "base": "facexlib", + "save_path": "facedetection", + "description": "Face Detection Models. Download the model required for using the 'Facerestore CF (Code Former)' custom node.", + "reference": "https://github.com/xinntao/facexlib", + "filename": "yolov5n-face.pth", + "url": "https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/yolov5n-face.pth" } ] } diff --git a/node_db/new/custom-node-list.json b/node_db/new/custom-node-list.json index 892e8dfa..0eb148b0 100644 --- a/node_db/new/custom-node-list.json +++ b/node_db/new/custom-node-list.json @@ -39,7 +39,7 @@ "https://github.com/mav-rik/facerestore_cf" ], "install_type": "git-clone", - "description": "This is a copy of facerestore custom node with a bit of a change to support CodeFormer Fidelity parameter. These ComfyUI nodes can be used to restore faces in images similar to the face restore option in AUTOMATIC1111 webui." + "description": "This is a copy of facerestore custom node with a bit of a change to support CodeFormer Fidelity parameter. These ComfyUI nodes can be used to restore faces in images similar to the face restore option in AUTOMATIC1111 webui.
NOTE: To use this node, you need to download the face restoration model and face detection model from the 'Install models' menu." }, { "author": "ArtBot2023", diff --git a/node_db/new/extension-node-map.json b/node_db/new/extension-node-map.json index 16c053a9..7ed2b74d 100644 --- a/node_db/new/extension-node-map.json +++ b/node_db/new/extension-node-map.json @@ -2069,7 +2069,6 @@ "IterativeLatentUpscale", "KSamplerAdvancedProvider", "KSamplerProvider", - "LatentCompositeMasked", "LatentPixelScale", "LatentReceiver", "LatentSender", @@ -2135,13 +2134,11 @@ ], "https://github.com/ltdrdata/ComfyUI-Inspire-Pack": [ [ - "Canny", "Canny_Preprocessor_Provider_for_SEGS //Inspire", "KSampler //Inspire", "LoraBlockInfo //Inspire", "LoraLoaderBlockWeight //Inspire", "OpenPose_Preprocessor_Provider_for_SEGS //Inspire", - "OpenposePreprocessor", "XY Input: Lora Block Weight //Inspire" ], { diff --git a/node_db/new/model-list.json b/node_db/new/model-list.json index c359743e..ae4d361c 100644 --- a/node_db/new/model-list.json +++ b/node_db/new/model-list.json @@ -1,5 +1,65 @@ { "models": [ + { + "name": "GFPGANv1.4.pth", + "type": "GFPGAN", + "base": "GFPGAN", + "save_path": "facerestore_models", + "description": "Face Restoration Models. Download the model required for using the 'Facerestore CF (Code Former)' custom node.", + "reference": "https://github.com/TencentARC/GFPGAN/releases", + "filename": "GFPGANv1.4.pth", + "url": "https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/GFPGANv1.4.pth" + }, + { + "name": "codeformer.pth", + "type": "CodeFormer", + "base": "CodeFormer", + "save_path": "facerestore_models", + "description": "Face Restoration Models. Download the model required for using the 'Facerestore CF (Code Former)' custom node.", + "reference": "https://github.com/sczhou/CodeFormer/releases", + "filename": "codeformer.pth", + "url": "https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/codeformer.pth" + }, + { + "name": "detection_Resnet50_Final.pth", + "type": "facexlib", + "base": "facexlib", + "save_path": "facerestore_models", + "description": "Face Detection Models. Download the model required for using the 'Facerestore CF (Code Former)' custom node.", + "reference": "https://github.com/xinntao/facexlib", + "filename": "detection_Resnet50_Final.pth", + "url": "https://github.com/xinntao/facexlib/releases/download/v0.1.0/detection_Resnet50_Final.pth" + }, + { + "name": "detection_mobilenet0.25_Final.pth", + "type": "facexlib", + "base": "facexlib", + "save_path": "facerestore_models", + "description": "Face Detection Models. Download the model required for using the 'Facerestore CF (Code Former)' custom node.", + "reference": "https://github.com/xinntao/facexlib", + "filename": "detection_mobilenet0.25_Final.pth", + "url": "https://github.com/xinntao/facexlib/releases/download/v0.1.0/detection_mobilenet0.25_Final.pth" + }, + { + "name": "yolov5l-face.pth", + "type": "facexlib", + "base": "facexlib", + "save_path": "facedetection", + "description": "Face Detection Models. Download the model required for using the 'Facerestore CF (Code Former)' custom node.", + "reference": "https://github.com/xinntao/facexlib", + "filename": "yolov5l-face.pth", + "url": "https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/yolov5l-face.pth" + }, + { + "name": "yolov5n-face.pth", + "type": "facexlib", + "base": "facexlib", + "save_path": "facedetection", + "description": "Face Detection Models. Download the model required for using the 'Facerestore CF (Code Former)' custom node.", + "reference": "https://github.com/xinntao/facexlib", + "filename": "yolov5n-face.pth", + "url": "https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/yolov5n-face.pth" + }, { "name": "ip-adapter-plus_sd15.bin
(install to IPAdapter-ComfyUI)", "type": "IP-Adapter", diff --git a/scanner.py b/scanner.py index f7dd4360..1f774b2d 100644 --- a/scanner.py +++ b/scanner.py @@ -20,12 +20,12 @@ def scan_in_file(filename): nodes = set() class_dict = {} - pattern2 = r'_CLASS_MAPPINGS\["(.*?)"\]' + pattern2 = r'^[^=]*_CLASS_MAPPINGS\["(.*?)"\]' keys = re.findall(pattern2, code) for key in keys: nodes.add(key.strip()) - pattern3 = r'_CLASS_MAPPINGS\[\'(.*?)\'\]' + pattern3 = r'^[^=]*_CLASS_MAPPINGS\[\'(.*?)\'\]' keys = re.findall(pattern3, code) for key in keys: nodes.add(key.strip()) @@ -147,7 +147,7 @@ def clone_or_pull_git_repository(git_url): print(f"Pulling {repo_name} failed: {e}") else: try: - repo = Repo.clone_from(git_url, repo_dir, recursive=True) + Repo.clone_from(git_url, repo_dir, recursive=True) print(f"Cloning {repo_name}...") except Exception as e: print(f"Cloning {repo_name} failed: {e}")