mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): invalid collect node error w/ control adapters
The graph builders used awaited functions within `Array.prototype.forEach` loops. This doesn't do what you'd think. This caused graphs to be enqueued before they were fully constructed. Changed to `for..of` loops to fix this.
This commit is contained in:
parent
ee3a1a95ef
commit
db12ce95a8
@ -49,7 +49,7 @@ export const addControlNetToLinearGraph = async (
|
||||
},
|
||||
});
|
||||
|
||||
validControlNets.forEach(async (controlNet) => {
|
||||
for (const controlNet of validControlNets) {
|
||||
if (!controlNet.model) {
|
||||
return;
|
||||
}
|
||||
@ -114,7 +114,7 @@ export const addControlNetToLinearGraph = async (
|
||||
field: 'item',
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
upsertMetadata(graph, { controlnets: controlNetMetadata });
|
||||
}
|
||||
};
|
||||
|
@ -42,7 +42,7 @@ export const addIPAdapterToLinearGraph = async (
|
||||
|
||||
const ipAdapterMetdata: CoreMetadataInvocation['ipAdapters'] = [];
|
||||
|
||||
validIPAdapters.forEach(async (ipAdapter) => {
|
||||
for (const ipAdapter of validIPAdapters) {
|
||||
if (!ipAdapter.model) {
|
||||
return;
|
||||
}
|
||||
@ -84,7 +84,7 @@ export const addIPAdapterToLinearGraph = async (
|
||||
field: 'item',
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
upsertMetadata(graph, { ipAdapters: ipAdapterMetdata });
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ export const addT2IAdaptersToLinearGraph = async (
|
||||
|
||||
const t2iAdapterMetadata: CoreMetadataInvocation['t2iAdapters'] = [];
|
||||
|
||||
validT2IAdapters.forEach(async (t2iAdapter) => {
|
||||
for (const t2iAdapter of validT2IAdapters) {
|
||||
if (!t2iAdapter.model) {
|
||||
return;
|
||||
}
|
||||
@ -107,7 +107,7 @@ export const addT2IAdaptersToLinearGraph = async (
|
||||
field: 'item',
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
upsertMetadata(graph, { t2iAdapters: t2iAdapterMetadata });
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user