Skip to content

Conversation

@christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented Aug 27, 2025

Summary

Fixes issue where "Refresh Node Definitions" doesn't update combo widget options for nodes inside subgraphs.

  • The refreshComboInNodes() function was only iterating over top-level nodes (this.graph.nodes)
  • Nodes inside subgraphs were never being refreshed, so new model files wouldn't appear in their dropdown lists
  • Users had to create completely new nodes to see refreshed values

Changes

  • Replace for (const node of this.graph.nodes) with forEachNode(this.graph, (node) => {...})
  • Import forEachNode utility from @/utils/graphTraversalUtil
  • Change continue to return for callback function compatibility
  • Add comment explaining the hierarchical traversal

Technical Details

The forEachNode utility recursively traverses the graph hierarchy:

  • Processes nodes at current level
  • Recursively enters subgraphs via node.subgraph property
  • Ensures all nodes receive the refresh treatment

Test Plan

  • Create a subgraph with nodes that have combo widgets (e.g., file selection)
  • Add new model files to ComfyUI
  • Run "Refresh Node Definitions" (Ctrl+R or button)
  • Verify combo widgets in subgraph nodes now show new files
  • Test with nested subgraphs (subgraphs inside subgraphs)

Fixes #5196

🤖 Generated with Claude Code

┆Issue is synchronized with this Notion page by Unito

The refreshComboInNodes function was only iterating over top-level nodes,
missing nodes inside subgraphs. This caused file lists and combo widget
options to not update properly when new models were added, unless users
created completely new nodes.

Changes:
- Replace graph.nodes iteration with forEachNode() for hierarchical traversal
- Import forEachNode utility from graphTraversalUtil
- Change early continue to early return for callback function

Fixes #5196

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@christian-byrne christian-byrne requested a review from a team as a code owner August 27, 2025 02:24
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 27, 2025
@github-actions
Copy link

github-actions bot commented Aug 27, 2025

🎭 Playwright Test Results

All tests passed across all browsers!

⏰ Completed at: 08/27/2025, 02:48:28 AM UTC

📊 Test Reports by Browser


🎉 Your tests are passing across all browsers!

@christian-byrne christian-byrne merged commit cd444b6 into main Aug 27, 2025
18 checks passed
@christian-byrne christian-byrne deleted the fix/refresh-subgraph-nodes branch August 27, 2025 02:59
@christian-byrne christian-byrne mentioned this pull request Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:subgraph size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On "Refresh Node Definitions", reload state of nodes in subgraphs

3 participants