From 901a8901998cd789c5c03d0e57c9f2110632748c Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Sat, 15 Apr 2023 10:53:30 +0100 Subject: [PATCH 1/2] Allow combo primitive to connect to multiple inputs --- web/extensions/core/widgetInputs.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/web/extensions/core/widgetInputs.js b/web/extensions/core/widgetInputs.js index 2b360341..cb6ebf09 100644 --- a/web/extensions/core/widgetInputs.js +++ b/web/extensions/core/widgetInputs.js @@ -258,7 +258,7 @@ app.registerExtension({ const input = theirNode.inputs[link.target_slot]; if (!input) return; - + var _widget; if (!input.widget) { if (!(input.type in ComfyWidgets)) return; @@ -333,7 +333,20 @@ app.registerExtension({ const config1 = this.outputs[0].widget.config; const config2 = input.widget.config; - if (config1[0] !== config2[0]) return false; + if (config1[0] instanceof Array) { + // These checks shouldnt actually be necessary as the types should match + // but double checking doesn't hurt + + // New input isnt a combo + if (!(config2[0] instanceof Array)) return false; + // New imput combo has a different size + if (config1[0].length !== config2[0].length) return false; + // New input combo has different elements + if (config1[0].find((v, i) => config2[0][i] !== v)) return false; + } else if (config1[0] !== config2[0]) { + // Configs dont match + return false; + } for (const k in config1[1]) { if (k !== "default") { From 887ea0ba83efdb2cfdb506fdaef10481abf85643 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Sat, 15 Apr 2023 10:55:19 +0100 Subject: [PATCH 2/2] style --- web/extensions/core/widgetInputs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/extensions/core/widgetInputs.js b/web/extensions/core/widgetInputs.js index cb6ebf09..67a59fb3 100644 --- a/web/extensions/core/widgetInputs.js +++ b/web/extensions/core/widgetInputs.js @@ -258,7 +258,7 @@ app.registerExtension({ const input = theirNode.inputs[link.target_slot]; if (!input) return; - + var _widget; if (!input.widget) { if (!(input.type in ComfyWidgets)) return;