diff --git a/__init__.py b/__init__.py index cfe1498..e2ecd13 100644 --- a/__init__.py +++ b/__init__.py @@ -1,5 +1,13 @@ -from .calculator import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS +from comfy_api.latest import ComfyExtension +from .calculator import Calculator + +class CalculatorExtension(ComfyExtension): + async def get_node_list(self): + return [Calculator] + +async def comfy_entrypoint(): + return CalculatorExtension() WEB_DIRECTORY = "./js" -__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS', 'WEB_DIRECTORY'] +__all__ = ["comfy_entrypoint", "WEB_DIRECTORY"] diff --git a/calculator.py b/calculator.py index 67bd519..b8c8dc4 100644 --- a/calculator.py +++ b/calculator.py @@ -1,21 +1,16 @@ -class Calculator: +from comfy_api.latest import io + +class Calculator(io.ComfyNode): @classmethod - def INPUT_TYPES(s): - return { - "required": {}, - } + def define_schema(cls) -> io.Schema: + return io.Schema( + node_id="Calculator", + display_name="Calculator 🧮", + category="Calculator 🧮", + inputs=[], + outputs=[] + ) - RETURN_TYPES = () - FUNCTION = "Calculator" - CATEGORY = "Calculator 🧮" - - def Calculator(self): - return () - -NODE_CLASS_MAPPINGS = { - "Calculator": Calculator -} - -NODE_DISPLAY_NAME_MAPPINGS = { - "Calculator": "Calculator 🧮" -} \ No newline at end of file + @classmethod + def execute(cls) -> io.NodeOutput: + return io.NodeOutput() diff --git a/pyproject.toml b/pyproject.toml index 6800c45..4584ec2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "ComfyUI-Calculator" description = "Calculator" -version = "1.0.0" +version = "1.1.0" license = {file = "LICENSE"} [project.urls]