Fix subgraph connections

This commit is contained in:
space-nuko
2023-05-17 11:40:19 -05:00
parent 51d8e17f49
commit 88ca25c97c
5 changed files with 10 additions and 91 deletions

View File

@@ -40,8 +40,14 @@ export default class ComfyGraph extends LGraph {
this.eventBus.emit("afterExecute");
}
/*
* NOTE: This function will also be called by child subgraphs on their
* parent graphs. So we have to be sure the node that receives the callback
* is a root graph (this._is_subgraph is false). If a subgraph calls this
* then options.subgraphsh will have the list of subgraphs down the chain.
*/
override onNodeAdded(node: LGraphNode, options: LGraphAddNodeOptions) {
// Don't add detached subgraphs
// Don't add nodes in subgraphs
if (node.getRootGraph() == null || this._is_subgraph)
return;