mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-19 02:43:30 +00:00
Allow combo primitive to connect to multiple inputs
This commit is contained in:
parent
04d9bc13af
commit
901a890199
@ -258,7 +258,7 @@ app.registerExtension({
|
|||||||
const input = theirNode.inputs[link.target_slot];
|
const input = theirNode.inputs[link.target_slot];
|
||||||
if (!input) return;
|
if (!input) return;
|
||||||
|
|
||||||
|
|
||||||
var _widget;
|
var _widget;
|
||||||
if (!input.widget) {
|
if (!input.widget) {
|
||||||
if (!(input.type in ComfyWidgets)) return;
|
if (!(input.type in ComfyWidgets)) return;
|
||||||
@ -333,7 +333,20 @@ app.registerExtension({
|
|||||||
const config1 = this.outputs[0].widget.config;
|
const config1 = this.outputs[0].widget.config;
|
||||||
const config2 = input.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]) {
|
for (const k in config1[1]) {
|
||||||
if (k !== "default") {
|
if (k !== "default") {
|
||||||
|
Loading…
Reference in New Issue
Block a user