Commit 8ee04736 authored by comfyanonymous's avatar comfyanonymous
Browse files

Merge branch 'parallel-extensions-load' of https://github.com/NoCrypt/ComfyUI

parents e9469e73 81ccacaa
......@@ -1026,18 +1026,21 @@ export class ComfyApp {
}
/**
* Loads all extensions from the API into the window
* Loads all extensions from the API into the window in parallel
*/
async #loadExtensions() {
const extensions = await api.getExtensions();
this.logging.addEntry("Comfy.App", "debug", { Extensions: extensions });
for (const ext of extensions) {
try {
await import(api.apiURL(ext));
} catch (error) {
console.error("Error loading extension", ext, error);
}
}
const extensions = await api.getExtensions();
this.logging.addEntry("Comfy.App", "debug", { Extensions: extensions });
const extensionPromises = extensions.map(async ext => {
try {
await import(api.apiURL(ext));
} catch (error) {
console.error("Error loading extension", ext, error);
}
});
await Promise.all(extensionPromises);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment