From 4b140e6512b20f3281edc24d37aced145d145f00 Mon Sep 17 00:00:00 2001 From: mcDandy Date: Tue, 21 Apr 2026 22:35:16 +0200 Subject: [PATCH] Try fix color math ComfyUI itself probably has bug since input does not behave as if connected. --- more_math/ColorMathNode.py | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/more_math/ColorMathNode.py b/more_math/ColorMathNode.py index b0b0370..143ec43 100644 --- a/more_math/ColorMathNode.py +++ b/more_math/ColorMathNode.py @@ -25,30 +25,9 @@ class ColorMathNode(io.ComfyNode): category="More math", display_name="Color math", inputs=[ - io.Autogrow.Input( - id="V", - template=io.Autogrow.TemplatePrefix( - io.Color.Input("values", optional=True), - prefix="V", - min=1, - max=50, - ), - ), - io.Autogrow.Input( - id="F", - template=io.Autogrow.TemplatePrefix( - io.Float.Input( - "float", - default=0.0, - optional=True, - lazy=True, - force_input=True, - ), - prefix="F", - min=1, - max=50, - ), - ), + io.Autogrow.Input(id="V", template=io.Autogrow.TemplatePrefix(io.Color.Input("values"), prefix="V", min=1, max=50)), + io.Autogrow.Input(id="F", template=io.Autogrow.TemplatePrefix(io.Float.Input("float", default=0.0, optional=True, lazy=True, force_input=True), prefix="F", min=1, max=50)), + io.MultiType.Input( io.String.Input("Expression", default="V0", multiline=False), types=[io.String, MrmthParseTree], @@ -111,12 +90,14 @@ class ColorMathNode(io.ComfyNode): stack: dict | None = None, ) -> tuple[str, dict]: """Execute color expression and return resulting color.""" + print(V) + print("---") work_stack = stack if remember_stack else ( copy.deepcopy(stack) if stack is not None else {} ) - if not V: - raise ValueError("At least one color input is required.") + # if not V: + # raise ValueError("At least one color input is required.") variables: dict[str, Any] = {}