From 85a5d1ed5612d02bcafaeec522c74c97359a7a47 Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Tue, 5 Aug 2025 18:29:05 -0400 Subject: [PATCH] Fix inconsistent subgraphNode usage Prior to this commit, subgraphNode inconsistently refers to either the parent graph, or to indicate the current node is a subgraph. This corrects the usage of subgraphNode to consistently refer to the subgraph instance as defined in the constructor. This solves a bug where graph serialization fails due to an incorrectly reported infinite loop. Port of https://github.com/Comfy-Org/litegraph.js/pull/1193 --- src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts b/src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts index a5c5b7087..ca2706216 100644 --- a/src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts +++ b/src/lib/litegraph/src/subgraph/ExecutableNodeDTO.ts @@ -126,11 +126,8 @@ export class ExecutableNodeDTO implements ExecutableLGraphNode { /** Returns either the DTO itself, or the DTOs of the inner nodes of the subgraph. */ getInnerNodes(): ExecutableLGraphNode[] { - return this.subgraphNode - ? this.subgraphNode.getInnerNodes( - this.nodesByExecutionId, - this.subgraphNodePath - ) + return this.node.isSubgraphNode() + ? this.node.getInnerNodes(this.nodesByExecutionId, this.subgraphNodePath) : [this] }