Open
Conversation
Add a frontend TypeScript guide for working with subgraphs in ComfyUI custom nodes. Covers node ID types, graph traversal, node layers, cleanup/onRemove, events/hooks, and widget promotion. - custom-nodes/js/subgraphs.mdx: main guide (288 lines) - zh-CN/custom-nodes/js/subgraphs.mdx: English stub for zh-CN - docs.json: nav entries for EN and zh-CN Closes #724 Amp-Thread-ID: https://ampcode.com/threads/T-019c3603-c29b-70c4-b6a1-9c2dd385475f
Link Validation Failed❌ zh-CN/custom-nodes/js/subgraphs.mdx
❌ zh-CN/custom-nodes/js/subgraphs.mdx
|
Rewrite custom-nodes/js/subgraphs.mdx to be actionable and snippet-focused:
- Remove all internal module imports (@/utils/*, @/types/*, @/core/*)
- Add copy-paste walkGraph helper for recursive traversal
- Use plain JS with import { app } style matching other JS docs
- Add complete working examples for events, cleanup, widget promotion
- Add known limitations section
Incorporate best parts from PR #751:
- Add custom-nodes/backend/subgraphs.mdx (UNIQUE_ID in subgraphs)
- Add cross-links on expansion.mdx and subgraph.mdx
- Add backend nav entries in docs.json (EN + zh-CN)
- Move JS subgraphs before javascript_examples in nav
Closes #724
Amp-Thread-ID: https://ampcode.com/threads/T-019c3603-c29b-70c4-b6a1-9c2dd385475f
Link Validation Failed❌ zh-CN/custom-nodes/backend/subgraphs.mdx
❌ zh-CN/custom-nodes/backend/subgraphs.mdx
❌ zh-CN/custom-nodes/js/subgraphs.mdx
❌ zh-CN/custom-nodes/js/subgraphs.mdx
❌ zh-CN/custom-nodes/js/subgraphs.mdx
❌ zh-CN/custom-nodes/js/subgraphs.mdx
❌ zh-CN/custom-nodes/js/subgraphs.mdx
|
… links - Add zh-CN counterparts for expansion.mdx and subgraph.mdx edits - Fix zh-CN links to use /zh-CN/ prefix (link validation) - Remove 'internal utils not importable' language — irrelevant to extension authors Amp-Thread-ID: https://ampcode.com/threads/T-019c3603-c29b-70c4-b6a1-9c2dd385475f
christian-byrne
commented
Feb 8, 2026
Contributor
Author
christian-byrne
left a comment
There was a problem hiding this comment.
We can remove all content related to backend subgraphs for this. Just need to explain frontend concepts.
christian-byrne
commented
Feb 8, 2026
- Remove backend subgraphs page (reviewer: frontend concepts only) - Remove top Warning block with GitHub issue reference - Replace locator ID warning with working getLocatorId snippet - Rename walkGraph 'visit' param to 'callback' for clarity - Move widget promotion caveat to Warning near that section - Remove Known Limitations (repeated, incorrect, or N/A items) - Remove Node Expansion from See Also - Fix all zh-CN English links for CI Amp-Thread-ID: https://ampcode.com/threads/T-019c3b30-7aa1-71aa-ba55-e8408869e501
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a frontend TypeScript guide for working with subgraphs in ComfyUI custom nodes.
Closes #724
What's included
New page: custom-nodes/js/subgraphs.mdx covering six topics:
NodeId,NodeExecutionId,NodeLocatorIdwith when to use eachgetNodeById(),locateNode(), iterating nested subgraphs recursivelySubgraphFolderNodeoffsets,computeSortedNodes()onNodeAdded,onNodeRemoved, subgraph-aware canvas eventsSubgraphSlotInfoAll TypeScript function signatures validated against the ComfyUI_frontend source.
Files changed
custom-nodes/js/subgraphs.mdxzh-CN/custom-nodes/js/subgraphs.mdxdocs.json