Comfy-Org / Comfy-Org/ComfyUI_frontend
feat: make resolveNode recursive for nested subgraphs (depth > 1)
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
The `resolveNode` utility in `src/utils/litegraphUtil.ts` currently iterates only over `graph.subgraphs.values()` at depth 1. This means nodes nested inside subgraphs that are themselves inside other subgraphs (depth > 1) will not be found.
## Background
This limitation was identified in PR #10009 (comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10009), which expanded the usage of `resolveNode` to fix image copy/paste and display for nodes inside subgraphs. The single-level limitation is pre-existing and was not introduced by that PR.
## Current Behavior
`resolveNode` searches the root graph first, then iterates `graph.subgraphs.values()` — but only one level deep. Nodes inside a subgraph that is itself nested inside another subgraph will not be resolved.
## Expected Behavior
`resolveNode` should recursively search all subgraphs at any depth so that nodes at any level of nesting are found.
## Impact
- Image copy/paste and display for nodes inside nested subgraphs (depth > 1) will silently fail.
- Any other call site using `resolveNode` will also miss deeply-nested nodes.
## Follow-up
This should be addressed when nested subgraphs become more common or when deeper nesting is officially supported.
Requested by @christian-byrne in PR #10009.
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10178-feat-make-resolveNode-recursive-for-nested-subgraphs-depth-1-3266d73d3650815f8067d3628eb17d23) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.