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:
@@ -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) {
|
||||
|
||||
@@ -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")],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user