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
This commit is contained in:
Acly
2025-12-17 10:40:58 +01:00
parent 0220252912
commit 21a2f44d4c
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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) {
+2 -2
View File
@@ -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")],
)