mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-10 21:42:37 +08:00
Allow input/widget conversion for type "combo."
ComfyWidgets.COMBO creates widgets with "combo" as type. Custom widget will want to have that widget/input conversion.
This commit is contained in:
parent
3bf5fdbc9a
commit
37f834e7b5
@ -92,7 +92,10 @@ app.registerExtension({
|
||||
if (type in ComfyWidgets) {
|
||||
widget = (ComfyWidgets[type](this, "value", inputData, app) || {}).widget;
|
||||
} else {
|
||||
widget = this.addWidget(type, "value", null, () => { }, {});
|
||||
if (type == "combo")
|
||||
widget = this.addWidget("combo", "value", null, () => {}, { values: inputData[1]?.values || [] });
|
||||
else
|
||||
widget = this.addWidget(type, "value", null, () => {}, {});
|
||||
}
|
||||
|
||||
if (node?.widgets && widget) {
|
||||
@ -154,7 +157,12 @@ app.registerExtension({
|
||||
|
||||
for (const k in config1[1]) {
|
||||
if (k !== "default" && k !== 'forceInput') {
|
||||
if (config1[1][k] !== config2[1][k]) {
|
||||
const lhs = config1[1][k];
|
||||
const rhs = config2[1][k];
|
||||
if (lhs instanceof Array && rhs instanceof Array) {
|
||||
if (lhs.length != rhs.length || !lhs.reduce((state, value, index) => state && value === rhs[index], true))
|
||||
return false;
|
||||
} else if (lhs !== rhs) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user