Skip to content

Commit 7f23353

Browse files
Merge branch 'fix-combo-primitive' of https://github.com/pythongosssss/ComfyUI
2 parents 04b14bc + 887ea0b commit 7f23353

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

web/extensions/core/widgetInputs.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,20 @@ app.registerExtension({
333333
const config1 = this.outputs[0].widget.config;
334334
const config2 = input.widget.config;
335335

336-
if (config1[0] !== config2[0]) return false;
336+
if (config1[0] instanceof Array) {
337+
// These checks shouldnt actually be necessary as the types should match
338+
// but double checking doesn't hurt
339+
340+
// New input isnt a combo
341+
if (!(config2[0] instanceof Array)) return false;
342+
// New imput combo has a different size
343+
if (config1[0].length !== config2[0].length) return false;
344+
// New input combo has different elements
345+
if (config1[0].find((v, i) => config2[0][i] !== v)) return false;
346+
} else if (config1[0] !== config2[0]) {
347+
// Configs dont match
348+
return false;
349+
}
337350

338351
for (const k in config1[1]) {
339352
if (k !== "default") {

0 commit comments

Comments
 (0)