1.4 KiB
title
| title |
|---|
| Subgraph blueprints |
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.jsonMy_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:
- 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