update to v3 node schema
This commit is contained in:
+10
-2
@@ -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"]
|
||||
|
||||
+14
-19
@@ -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 🧮"
|
||||
}
|
||||
@classmethod
|
||||
def execute(cls) -> io.NodeOutput:
|
||||
return io.NodeOutput()
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "ComfyUI-Calculator"
|
||||
description = "Calculator"
|
||||
version = "1.0.0"
|
||||
version = "1.1.0"
|
||||
license = {file = "LICENSE"}
|
||||
|
||||
[project.urls]
|
||||
|
||||
Reference in New Issue
Block a user