Objective
This article explores the transformative impact of the new Subgraphs (Group Nodes) feature in ComfyUI, demonstrating how it enhances workflow clarity and modularity. Through three practical tests, we compare workflows before and after implementing Subgraphs to showcase their benefits.
Sources
ComfyUI Blog: Subgraphs Are Coming to ComfyUI!
Understanding Subgraphs
Subgraphs in ComfyUI allow users to encapsulate sections of a workflow into a single node, simplifying complex workflows and promoting reusability. They are fully editable, support nesting, and can expose specific parameters through widgets, making workflows more organized and user-friendly.
Before starting
You need to update comfyUI to the last version
In my examples I use flux1-schnell-fp8.safetensors checkpoint, but you can use the ones that you prefer.
You can find all the workflow in this article attached in json format.
Test: Basic Text-to-Image Workflow
Before Subgraphs:
After Implementing Subgraphs:
Encapsulated the entire sequence into a single subgraph node.
Exposed key parameters like prompt text and sampler settings via widgets.
Outcome:
Significant reduction in visual complexity.
Easier to adjust parameters without navigating through multiple nodes.
Manage Group nodes
If you clic to your "Group Node" with right button of mouse you can ten select "Manage Group Node"
You can decide which input and output to expose
For example I remove the "Negative Text" because Flux doesn't use it.
Also you can sort the nodes input in order to have the best option for your needs.
Here I set the Positive prompt on top
Here is the output.
If you want to convert to nodes, just clic on the group with right-clic and clic on convert to nodes
Then, If you select all and clic on "Convert to Group Node"
Confirm the name
Then you have a single node to do all the job.
Attention
I notice that when you group and ungroup some settings reset, so you have to set them back.
Conclusion
The introduction of Subgraphs in ComfyUI marks a significant advancement in workflow management. By encapsulating complex node sequences into modular, reusable components, users can achieve cleaner, more organized, and efficient workflows. Whether working on simple text-to-image tasks or intricate multi-stage processes, Subgraphs offer a powerful tool to enhance productivity and maintainability in ComfyUI.