To support dynamic custom loading, separate the node registration

process based on the defs in the registerNodes function.
This commit is contained in:
ltdrdata 2023-05-31 22:01:25 +09:00
parent 606446d030
commit 1f34bf08f0
1 changed files with 5 additions and 2 deletions

View File

@ -1010,6 +1010,11 @@ export class ComfyApp {
const app = this;
// Load node definitions from the backend
const defs = await api.getNodeDefs();
this.registerNodesFromDefs(defs);
await this.#invokeExtensionsAsync("registerCustomNodes");
}
async registerNodesFromDefs(defs) {
await this.#invokeExtensionsAsync("addCustomNodeDefs", defs);
// Generate list of known widgets
@ -1082,8 +1087,6 @@ export class ComfyApp {
LiteGraph.registerNodeType(nodeId, node);
node.category = nodeData.category;
}
await this.#invokeExtensionsAsync("registerCustomNodes");
}
/**