Comfy-Org / Comfy-Org/ComfyUI_frontend

[Bug] Subgraphs detect circular reference in graph with no cycles

Open
#4,686 2 comments 1 reaction 0 assignees View on GitHub
area:subgraph
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

I might be wrong but I don't think this graph has any cycles:

[circular-reference-issue.json](https://github.com/user-attachments/files/21604702/circular-reference-issue.json)

Nevertheless, the safety checks in litegraph report a circular reference which prevents executing the graph and exporting the workflow. Strangely, you can still save the workflow just not export it.

The error:

```
useErrorHandling.ts:12 RecursionError: Circular reference detected while resolving input 0 of node 10 (New Subgraph). This creates an infinite loop in link resolution. UniqueID: [07f47584-73dc-4cd5-8985-5ab35e8aa820:10[I]0]
at ExecutableNodeDTO.resolveInput (ExecutableNodeDTO.ts:137:13)
at ExecutableNodeDTO.resolveInput (ExecutableNodeDTO.ts:182:30)
at graphToPrompt (executionUtil.ts:118:34)
at async Object.exportWorkflow (workflowService.ts:69:15)
at async function (useCoreCommands.ts:121:9)
at async useErrorHandling.ts:39:16
at async Proxy.execute (commandStore.ts:96:7)
```

Related:

- https://github.com/Comfy-Org/litegraph.js/pull/1160

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-4686-Bug-Subgraphs-detect-circular-reference-in-graph-with-no-cycles-2466d73d365081948043eb5ef482fd02) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.