mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-22 20:30:25 +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
|
* Refresh file list on whole nodes
|
||||||
*/
|
*/
|
||||||
async refreshNodes() {
|
async refreshNodes() {
|
||||||
const defs = await api.getNodeDefs();
|
const defs = await api.getNodeDefs();
|
||||||
|
|
||||||
for(let nodeNum in this.graph._nodes) {
|
for(let nodeNum in this.graph._nodes) {
|
||||||
const node = this.graph._nodes[nodeNum];
|
const node = this.graph._nodes[nodeNum];
|
||||||
|
|
||||||
const def = defs[node.type];
|
const def = defs[node.type];
|
||||||
|
|
||||||
|
if(def.refresh_list == undefined) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
for(const i in def.refresh_list) {
|
for(const i in def.refresh_list) {
|
||||||
const item = def.refresh_list[i];
|
const item = def.refresh_list[i];
|
||||||
const filelist = def.input["required"][item];
|
const filelist = def.input["required"][item];
|
||||||
const w = node.widgets.find((w) => w.name === item);
|
const w = node.widgets.find((w) => w.name === item);
|
||||||
w.options.values = filelist[0];
|
w.options.values = filelist[0];
|
||||||
w.value = w.options.values[0];
|
w.value = w.options.values[0];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user