From 3007e6294df8da2b3291cadc4e53a5ca369a9328 Mon Sep 17 00:00:00 2001 From: pants007 Date: Sun, 13 Aug 2023 14:02:06 +0200 Subject: [PATCH] remove interrogate node Signed-off-by: pants007 --- README.md | 2 -- __init__.py | 6 ++---- nodes/interrogate_node.py | 31 ------------------------------- 3 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 nodes/interrogate_node.py diff --git a/README.md b/README.md index fee27f7..0da142b 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ This repo contains a number of QoL nodes I made for myself that I figured I may ## Nodes - Make Square Node - Will pad an image to make it square with a chosen filling strategy. Sort of like "Resize and fill" from a1111. -- Interrogate Node - - Feed clip-interrogator an image and get its output as a string - TextEncodeAIO - Tried to hack StylePile-like (the A1111 extension, shoutout btw) behavior into a ClipTextEncode node, but I'm not sure I'm even doing it right. ## Installation diff --git a/__init__.py b/__init__.py index ca5bd7b..c8b06ac 100644 --- a/__init__.py +++ b/__init__.py @@ -1,6 +1,4 @@ -from custom_nodes.comfy_pants.nodes import square_image_node, text_encode_aio, interrogate_node +from .nodes import square_image_node, text_encode_aio NODE_CLASS_MAPPINGS = { **square_image_node.NODE_CLASS_MAPPINGS, - **text_encode_aio.NODE_CLASS_MAPPINGS, - **interrogate_node.NODE_CLASS_MAPPINGS -} + **text_encode_aio.NODE_CLASS_MAPPINGS} diff --git a/nodes/interrogate_node.py b/nodes/interrogate_node.py deleted file mode 100644 index e07b754..0000000 --- a/nodes/interrogate_node.py +++ /dev/null @@ -1,31 +0,0 @@ -from clip_interrogator import Config, Interrogator -import numpy as np -from PIL import Image - - -class CLIPInterrogator: - @classmethod - def INPUT_TYPES(s): - return {"required": {"image": ("IMAGE",)}} - RETURN_TYPES = ("STRING",) - FUNCTION = "interrogate" - - CATEGORY = "STRING" - - def interrogate(self, image): - img_np = image.squeeze(0).numpy() - ci = Interrogator( - Config(chunk_size=512, clip_model_name="ViT-L-14/openai")) - img = Image.fromarray((img_np * 255).astype(np.uint8)).convert("RGB") - res = ci.interrogate(img) - return (res,) - - -NODE_CLASS_MAPPINGS = { - "CLIPInterrogator": CLIPInterrogator, -} - -# A dictionary that contains the friendly/humanly readable titles for the nodes -NODE_DISPLAY_NAME_MAPPINGS = { - "CLIPInterrogator Node": "CLIPInterrogator Node" -}