subgraphs folder in your custom node directory and place the .json files there.
Under the hood, ComfyUI scans all custom node directories for subgraph files and serves them via the /global_subgraphs API endpoint.
Example
UnderComfyUI-MyCustomNodeModule/subgraphs/ directory:
My_upscale_subgraph.jsonMy_effects_subgraph.json
ComfyUI-MyCustomNodeModule that users can add to their workflows.
Creating a subgraph JSON file
Subgraph JSON files use the same format as workflow JSON files. The easiest way to create one:- Build your subgraph in ComfyUI
- Select the nodes you want to include
- Convert them to a subgraph
- Export the subgraph as JSON
- Place the JSON file in your
subgraphs/folder
See also
- Subgraphs (User Guide) - How users interact with subgraphs
- Subgraph Developer Guide - Frontend extension development for subgraphs
- Workflow templates - Adding example workflows to your custom nodes