mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-25 16:59:45 +00:00
Fix a bug that prevented subgraph reuse (#1103)
This commit is contained in:
@@ -278,7 +278,7 @@ export class SubgraphNode extends LGraphNode implements BaseLGraph {
|
|||||||
/** The list of nodes to add to. */
|
/** The list of nodes to add to. */
|
||||||
nodes: ExecutableLGraphNode[] = [],
|
nodes: ExecutableLGraphNode[] = [],
|
||||||
/** The set of visited nodes. */
|
/** The set of visited nodes. */
|
||||||
visited = new WeakSet<SubgraphNode>(),
|
visited = new Set<SubgraphNode>(),
|
||||||
/** The path of subgraph node IDs. */
|
/** The path of subgraph node IDs. */
|
||||||
subgraphNodePath: readonly NodeId[] = [],
|
subgraphNodePath: readonly NodeId[] = [],
|
||||||
): ExecutableLGraphNode[] {
|
): ExecutableLGraphNode[] {
|
||||||
@@ -289,7 +289,7 @@ export class SubgraphNode extends LGraphNode implements BaseLGraph {
|
|||||||
|
|
||||||
for (const node of this.subgraph.nodes) {
|
for (const node of this.subgraph.nodes) {
|
||||||
if ("getInnerNodes" in node) {
|
if ("getInnerNodes" in node) {
|
||||||
node.getInnerNodes(nodes, visited, subgraphInstanceIdPath)
|
node.getInnerNodes(nodes, new Set(visited), subgraphInstanceIdPath)
|
||||||
} else {
|
} else {
|
||||||
// Create minimal DTOs rather than cloning the node
|
// Create minimal DTOs rather than cloning the node
|
||||||
const aVeryRealNode = new ExecutableNodeDTO(node, subgraphInstanceIdPath, this)
|
const aVeryRealNode = new ExecutableNodeDTO(node, subgraphInstanceIdPath, this)
|
||||||
|
|||||||
Reference in New Issue
Block a user