diff --git a/__init__.py b/__init__.py index 010bcb3..4ca8715 100644 --- a/__init__.py +++ b/__init__.py @@ -156,6 +156,21 @@ __all__ = [ "WEB_DIRECTORY", ] +from comfy_api.latest import ComfyExtension, io +from .src.comfyui_ino_nodes.node_helpers.bool_helper import InoBooleanEqual + +class InoNodes(ComfyExtension): + # must be declared as async + async def get_node_list(self) -> list[type[io.ComfyNode]]: + return [ + InoBooleanEqual, + # Add more nodes here + ] + +# can be declared async or not, both will work +async def comfy_entrypoint() -> InoNodes: + return InoNodes() + __author__ = """InoNodes""" __email__ = "contact@inoland.net" __version__ = "1.1.5" diff --git a/src/comfyui_ino_nodes/node_helpers/__init__.py b/src/comfyui_ino_nodes/node_helpers/__init__.py index e69de29..c36339e 100644 --- a/src/comfyui_ino_nodes/node_helpers/__init__.py +++ b/src/comfyui_ino_nodes/node_helpers/__init__.py @@ -0,0 +1,5 @@ +from .bool_helper import InoBooleanEqual + +__all__ = [ + "InoBooleanEqual", +] diff --git a/src/comfyui_ino_nodes/node_helpers/bool_helper.py b/src/comfyui_ino_nodes/node_helpers/bool_helper.py index f07d0a9..84c8a10 100644 --- a/src/comfyui_ino_nodes/node_helpers/bool_helper.py +++ b/src/comfyui_ino_nodes/node_helpers/bool_helper.py @@ -1,26 +1,24 @@ -class InoBooleanEqual: - """ - reverse boolean - """ +from comfy_api.latest import ComfyExtension, io + +class InoBooleanEqual(io.ComfyNode): + @classmethod + def define_schema(cls) -> io.Schema: + return io.Schema( + node_id="InoBooleanEqual", + display_name="Ino Boolean Equal", + category="InoNodes", + inputs=[ + io.Boolean.Input("input",default=True), + io.Boolean.Input("compare", default=True), + ], + outputs=[ + io.Boolean.Output() + ] + ) @classmethod - def INPUT_TYPES(s): - return { - "required": { - "input": ("BOOLEAN", {"default": True}), - "compare": ("BOOLEAN", {"default": True}), - } - } - - RETURN_TYPES = ("BOOLEAN",) - RETURN_NAMES = ("boolean",) - - FUNCTION = "function" - - CATEGORY = "InoNodes" - - def function(self, input, compare): - return (input == compare,) + def execute(cls, input, compare) -> io.NodeOutput: + return io.NodeOutput(input == compare) class InoNotBoolean: """