From ff1021e6c817e352fcec8e499c74a5de78afd9b7 Mon Sep 17 00:00:00 2001 From: BobRandomNumber <189914665+BobRandomNumber@users.noreply.github.com> Date: Fri, 13 Feb 2026 20:14:25 -0500 Subject: [PATCH] update to v3 node schema --- __init__.py | 12 ++++++++++-- calculator.py | 33 ++++++++++++++------------------- pyproject.toml | 2 +- 3 files changed, 25 insertions(+), 22 deletions(-) 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]