Subgraph Official Release! Making Complex Workflows Clean and Efficient
ComfyUI Subgraph: Package complex workflows into reusable nodes. Transform chaos into simple, modular components.
After months of careful development and testing, we're thrilled to announce: Subgraph feature is officially here in ComfyUI!
What is Subgraph?
Imagine you have a complex workflow with dozens or even hundreds of nodes, and you want to use a group of them together as one package. Now you can "package" related nodes into a single, clean subgraph node, turning them into "LEGO" blocks to construct complicated workflows!
Subgraph is:
A package of selected nodes with complete Input/Output
Looks and functions like one single "super-node"
Feels like a folder - you can dive inside and edit
A reusable module of your workflow, easy to copy and paste
How to Create Subgraph?
1. Box-select the nodes you want to combine
2. Click the Subgraph button on the selection toolbox
It’s done! Complex workflows become clean instantly!
Editing Subgraph
Want your subgraph to work like a regular node with complete widgets and input/output controls? No problem!
Click the icon on the subgraph node to enter edit mode. Inside the subgraph, there are special slots:
Input slots: Handle data coming from outside
Output slots: Handle data going outside
Simply connect inputs or outputs to these slots to expose them externally
One more Feature: Partial Execution
Besides subgraph, there's another super useful feature: Partial Execution!
Want to test just one branch of your workflow instead of running the entire workflow? When you click on any output node at the end of a branch and the green play icon in the selection-toolbox is activated, click it to run just that branch!
It’s a great tool to streamline your workflow testing and speed up iterations.
Get Started
1. Download ComfyUI or update (to the latest commit, a stable version will be available in a few days): https://www.comfy.org/download
2. Select some nodes, click the subgraph button
3. Start simplifying your workflows!
---
Check out documentation for more details:
http://docs.comfy.org/interface/features/subgraph
http://docs.comfy.org/interface/features/partial-execution
As alway, enjoy creating!
This is good!
But are there plans to implement the ability to expand back created subgraphs?
It would be very convenient to be able to return nodes from a subgraph back.
There is a discussion on GitHub about this issue:
https://github.com/Comfy-Org/ComfyUI_frontend/issues/4166