mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-11 06:40:48 +08:00
robust patch for refresh feature
This commit is contained in:
parent
d1c48064e7
commit
bdfca3b4b6
@ -808,15 +808,20 @@ class ComfyApp {
|
||||
* Refresh file list on whole nodes
|
||||
*/
|
||||
async refreshNodes() {
|
||||
const defs = await api.getNodeDefs();
|
||||
const defs = await api.getNodeDefs();
|
||||
|
||||
for(let nodeNum in this.graph._nodes) {
|
||||
const node = this.graph._nodes[nodeNum];
|
||||
|
||||
const def = defs[node.type];
|
||||
|
||||
if(def.refresh_list == undefined) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for(const i in def.refresh_list) {
|
||||
const item = def.refresh_list[i];
|
||||
const filelist = def.input["required"][item];
|
||||
const item = def.refresh_list[i];
|
||||
const filelist = def.input["required"][item];
|
||||
const w = node.widgets.find((w) => w.name === item);
|
||||
w.options.values = filelist[0];
|
||||
w.value = w.options.values[0];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user