diff --git a/more_math/minimal_test.py b/more_math/minimal_test.py new file mode 100644 index 0000000..f327a0d --- /dev/null +++ b/more_math/minimal_test.py @@ -0,0 +1,36 @@ +"""Color math node using integer color representation.""" + +from __future__ import annotations + + +from comfy_api.latest import io + + + +class mintest(io.ComfyNode): + """Apply expression math to Color values converted to packed RGB integers.""" + + @classmethod + def define_schema(cls) -> io.Schema: + """Define node schema.""" + return io.Schema( + node_id="mrmth_ag_mintest", + category="More math", + display_name="Minimal test", + inputs=[ + io.Autogrow.Input(id="V", template=io.Autogrow.TemplatePrefix(io.Color.Input("values"), prefix="V", min=1, max=50)), + ], + outputs=[ + io.Color.Output(id="color"), + ], + ) + + + @classmethod + def execute( + cls, + V + ): + """Execute color expression and return resulting color.""" + print(V) + return V["V0"] diff --git a/more_math/nodes.py b/more_math/nodes.py index ff5b320..4e8b0b7 100644 --- a/more_math/nodes.py +++ b/more_math/nodes.py @@ -32,6 +32,8 @@ from .SelectiveGuiderMathNode import SelectiveGuiderMathNode from .ScriptTextWindow import ScriptTextInput +from .minimal_test import mintest + from comfy_api.latest import ComfyExtension, io @@ -174,7 +176,8 @@ class MoreMathExtension(ComfyExtension): StringMathNode, ScriptTextInput, SelectiveGuiderMathNode, - ColorMathNode + ColorMathNode, + mintest ]