From 21a2f44d4c15b5d3c4dff489c6c1c41193ec6206 Mon Sep 17 00:00:00 2001 From: Acly Date: Wed, 17 Dec 2025 10:40:58 +0100 Subject: [PATCH] Fix Parameter node min/max being reset to default when it's set to 0 #53 * Use a different default than 0 as workaround * Don't want to change type of min/max as that would break workflows --- js/external_tooling_nodes.js | 2 +- krita.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/external_tooling_nodes.js b/js/external_tooling_nodes.js index 69c6418..f246c6a 100644 --- a/js/external_tooling_nodes.js +++ b/js/external_tooling_nodes.js @@ -96,7 +96,7 @@ function valueMatchesType(value, type, options) { function optionalWidgetValue(widgets, index, fallback) { const result = widgets.length > index ? widgets[index].value : null - return result === null || result === 0 ? fallback : result + return result === null || result === -1e10 || result === 1e10 ? fallback : result } function changeWidgets(node, type, connectedNode, connectedWidget) { diff --git a/krita.py b/krita.py index 70b7836..da3bfc5 100644 --- a/krita.py +++ b/krita.py @@ -217,8 +217,8 @@ class Parameter(io.ComfyNode): io.String.Input("name", default="Parameter"), io.Combo.Input("type", options=_param_types, default="auto"), io.String.Input("default", default=""), - io.Float.Input("min", default=0.0, min=-_fmax, max=_fmax, optional=True), - io.Float.Input("max", default=1.0, min=-_fmax, max=_fmax, optional=True), + io.Float.Input("min", default=-1e10, min=-_fmax, max=_fmax, optional=True), + io.Float.Input("max", default=1e10, min=-_fmax, max=_fmax, optional=True), ], outputs=[io.AnyType.Output(display_name="value")], )