diff --git a/execution.py b/execution.py index a1a7c75c8..e7a1a5579 100644 --- a/execution.py +++ b/execution.py @@ -431,7 +431,7 @@ def validate_inputs(prompt, item, validated): o_id = val[0] o_class_type = prompt[o_id]['class_type'] r = nodes.NODE_CLASS_MAPPINGS[o_class_type].RETURN_TYPES - if r[val[1]] != type_input: + if r[val[1]] != type_input and type_input != "*": received_type = r[val[1]] details = f"{x}, {received_type} != {type_input}" error = { diff --git a/web/extensions/core/widgetInputs.js b/web/extensions/core/widgetInputs.js index f1d4a9dd1..7ab780990 100644 --- a/web/extensions/core/widgetInputs.js +++ b/web/extensions/core/widgetInputs.js @@ -2,7 +2,7 @@ import { ComfyWidgets, addValueControlWidget } from "../../scripts/widgets.js"; import { app } from "../../scripts/app.js"; const CONVERTED_TYPE = "converted-widget"; -const VALID_TYPES = ["STRING", "combo", "number", "BOOLEAN"]; +const VALID_TYPES = ["STRING", "combo", "number", "BOOLEAN", "*"]; function isConvertableWidget(widget, config) { return VALID_TYPES.includes(widget.type) || VALID_TYPES.includes(config[0]); @@ -169,8 +169,8 @@ app.registerExtension({ const input = this.inputs[slot]; if (!input.widget || !input[ignoreDblClick]) { // Not a widget input or already handled input - if (!(input.type in ComfyWidgets) && !(input.widget.config?.[0] instanceof Array)) { - return r; //also Not a ComfyWidgets input or combo (do nothing) + if (!(input.type in ComfyWidgets) && input.type != "*" && !(input.widget.config?.[0] instanceof Array)) { + return r; //also Not a ComfyWidgets input, 'ANY' or combo (do nothing) } } @@ -287,7 +287,7 @@ app.registerExtension({ if (!input) return; - var _widget; + let _widget; if (!input.widget) { if (!(input.type in ComfyWidgets)) return; _widget = { "name": input.name, "config": [input.type, {}] }//fake widget @@ -315,6 +315,8 @@ app.registerExtension({ let widget; if (type in ComfyWidgets) { widget = (ComfyWidgets[type](this, "value", inputData, app) || {}).widget; + } else if (type == "*") { + widget = (ComfyWidgets.STRING(this, "value", ["STRING", {"default": ""}], app) || {}).widget; } else { widget = this.addWidget(type, "value", null, () => { }, {}); } diff --git a/web/scripts/app.js b/web/scripts/app.js index 40156abc3..a3d8343e5 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -1155,6 +1155,9 @@ export class ComfyApp { } else if (type in widgets) { // Standard type widgets Object.assign(config, widgets[type](this, inputName, inputData, app) || {}); + } else if (type == "*") { + // 'ANY' type widgets + Object.assign(config, widgets.STRING(this, inputName, ["STRING", {}], app) || {}); } else { // Node connection inputs this.addInput(inputName, type);