mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-07 15:52:32 +08:00
Merge branch 'master' into master
This commit is contained in:
commit
5313ce1dd1
@ -901,6 +901,31 @@ class ComfyApp {
|
|||||||
}
|
}
|
||||||
this.extensions.push(extension);
|
this.extensions.push(extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Refresh combo list on whole nodes
|
||||||
|
*/
|
||||||
|
async refreshComboInNodes() {
|
||||||
|
const defs = await api.getNodeDefs();
|
||||||
|
|
||||||
|
for(let nodeNum in this.graph._nodes) {
|
||||||
|
const node = this.graph._nodes[nodeNum];
|
||||||
|
|
||||||
|
const def = defs[node.type];
|
||||||
|
|
||||||
|
for(const widgetNum in node.widgets) {
|
||||||
|
const widget = node.widgets[widgetNum]
|
||||||
|
|
||||||
|
if(widget.type == "combo" && def["input"]["required"][widget.name] !== undefined) {
|
||||||
|
widget.options.values = def["input"]["required"][widget.name][0];
|
||||||
|
|
||||||
|
if(!widget.options.values.includes(widget.value)) {
|
||||||
|
widget.value = widget.options.values[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const app = new ComfyApp();
|
export const app = new ComfyApp();
|
||||||
|
|||||||
@ -380,6 +380,7 @@ export class ComfyUI {
|
|||||||
}),
|
}),
|
||||||
$el("button", { textContent: "Load", className: "comfy-load-btn", onclick: () => fileInput.click() }),
|
$el("button", { textContent: "Load", className: "comfy-load-btn", onclick: () => fileInput.click() }),
|
||||||
$el("button", { textContent: "Clear", className: "comfy-clear-btn", onclick: () => app.graph.clear() }),
|
$el("button", { textContent: "Clear", className: "comfy-clear-btn", onclick: () => app.graph.clear() }),
|
||||||
|
$el("button", { textContent: "Refresh", className: "comfy-refresh-btn" onclick: () => app.refreshComboInNodes() }),
|
||||||
$el("button", { textContent: "Load Default", className: "comfy-load-default-btn", onclick: () => app.loadGraphData() }),
|
$el("button", { textContent: "Load Default", className: "comfy-load-default-btn", onclick: () => app.loadGraphData() }),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user