diff --git a/web/extensions/core/widgetInputs.js b/web/extensions/core/widgetInputs.js index ff9227d28..11beb5c02 100644 --- a/web/extensions/core/widgetInputs.js +++ b/web/extensions/core/widgetInputs.js @@ -271,10 +271,20 @@ app.registerExtension({ } let widget; - if (type in ComfyWidgets) { - widget = (ComfyWidgets[type](this, "value", inputData, app) || {}).widget; + + // ComfyWidgets allows a subtype of widgets which is defined by ":" + // common example is "INT:seed" + // so let's check for those first + let combinedWidgetType = type + ":" + widgetName; + if (combinedWidgetType in ComfyWidgets) { + widget = (ComfyWidgets[combinedWidgetType](this, "value", inputData, app) || {}).widget; } else { - widget = this.addWidget(type, "value", null, () => {}, {}); + // we did not find a subtype, so proceed with "" only + if (type in ComfyWidgets) { + widget = (ComfyWidgets[type](this, "value", inputData, app) || {}).widget; + } else { + widget = this.addWidget(type, "value", null, () => {}, {}); + } } if (node?.widgets && widget) { @@ -284,10 +294,6 @@ app.registerExtension({ } } - if (widget.type === "number") { - addRandomizeWidget(this, widget, "Random after every gen"); - } - // When our value changes, update other widgets to reflect our changes // e.g. so LoadImage shows correct image const callback = widget.callback;