Merge branch 'fix-combo-primitive' of https://github.com/pythongosssss/ComfyUI

This commit is contained in:
comfyanonymous 2023-04-15 11:07:03 -04:00
commit 7f23353d63
1 changed files with 14 additions and 1 deletions

View File

@ -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") {