What are Subgraphs?
It is a function that aggregates multiple nodes into a single node. Not only does it tidy up the appearance, but it can also be saved as a reusable module (Blueprint) and treated like a new node.
It is possible to combine all nodes into one, but a feature of ComfyUI is that the image generation pipeline can be divided into small modules.
Personally, I think it is a function for creating "reusable modules" rather than just tidying up the appearance.
Creating Subgraphs
-
- Select multiple nodes you want to group
-
- Click
🕸️(Convert Selection to Subgraph) in theNode Selection Toolbox
- Click
Editing Subgraphs
Double-click the subgraph or click the icon in the upper right to enter edit mode.
Basic operations are the same as usual, but parameters exchanged with the outside must be connected to the input/output slots (left/right ends) of the subgraph.
Exposing Parameters
You can expose parameters within a subgraph as widgets on the subgraph node. You will be able to change values without entering edit mode every time.
-
- Select the subgraph
-
- Click
Edit Subgraph Widgetsin theNode Selection Toolbox
- Click
-
- Check the parameters you want to expose
Saving and Reusing Subgraphs
If you save the created subgraph, you can reuse it as a unique node.
-
- Select the subgraph
-
- Click
📖(Publish Subgraph) in theNode Selection Toolbox
- Click
-
- Enter a name and
Confirm
- Enter a name and
After saving, you can search for and call it just like a normal node (double-click).
You can also check it from the node library in the sidebar, and delete or edit Blueprints from there.