Skip to main content
If you have reusable subgraph components associated with your custom nodes, ComfyUI can make these available to users as global subgraph blueprints. Subgraph blueprints allow users to quickly add pre-built node groups from the subgraph menu. All you have to do as a node developer is create a 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

Under ComfyUI-MyCustomNodeModule/subgraphs/ directory:
  • My_upscale_subgraph.json
  • My_effects_subgraph.json
In this example, ComfyUI’s subgraph browser shows blueprints from 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:
  1. Build your subgraph in ComfyUI
  2. Select the nodes you want to include
  3. Convert them to a subgraph
  4. Export the subgraph as JSON
  5. Place the JSON file in your subgraphs/ folder

See also