Install this extension via the ComfyUI Manager by searching
for ComfyUI-Sub-Nodes
1. Click the Manager button in the main menu
2. Select Custom Nodes Manager button
3. Enter ComfyUI-Sub-Nodes in the search bar
After installation, click the Restart button to
restart ComfyUI. Then, manually
refresh your browser to clear the cache and access
the updated list of nodes.
Visit
ComfyUI Online
for ready-to-use ComfyUI environment
ComfyUI-Sub-Nodes enables the creation and invocation of subgraphs within ComfyUI, streamlining complex workflows by encapsulating and reusing node groups.
ComfyUI-Sub-Nodes Introduction
ComfyUI-Sub-Nodes is an extension designed to enhance the functionality of ComfyUI by allowing users to create and manage subgraphs within their workflows. This extension is particularly useful for AI artists who want to streamline complex workflows, making them more manageable and modular. By using subgraphs, you can break down intricate processes into smaller, reusable components, which can simplify your work and improve efficiency.
How ComfyUI-Sub-Nodes Works
The basic principle behind ComfyUI-Sub-Nodes is the concept of subgraphs. Think of a subgraph as a mini-workflow that can be embedded within a larger workflow. This allows you to encapsulate specific tasks or processes, making your overall workflow cleaner and easier to understand.
Creating Subgraphs
Define Inputs and Outputs: Start by creating a workflow and use the nodes VIV_Subgraph_Inputs and VIV_Subgraph_Outputs to define the inputs and outputs of your subgraph. These nodes act as the entry and exit points for data within your subgraph.
Save Your Subgraph: Create a folder named subnodes in the root directory of your ComfyUI installation (next to folders like custom_nodes and models). Use the normal Save button to save your workflow in this folder. Note that while you can also use the API format export, it may lose some information and not load correctly in the editor.
Special Keys: The extension adds extra keys to the save output to facilitate running the subgraph. This means that workflows saved previously won't work as subgraphs unless you open them and add the input/output nodes.
Calling Subgraphs
Create a Subgraph Node: Use the VIV_Subgraph node to call your subgraph. You might need to hit the "Refresh" button to see your newly created subgraph.
Automatic Population: The input and output fields will be populated automatically. Resize the node a bit, and it should snap to a good size.
Progress and Previews: Any progress bars and previews within the subgraph will show on the subgraph node, although image previews won't be displayed.
ComfyUI-Sub-Nodes Features
Modular Workflows
Reusability: Subgraphs can be reused across different projects, saving you time and effort.
Simplification: Break down complex workflows into smaller, more manageable parts.
Customization
Flexible Inputs and Outputs: Any object can be passed between subgraphs, giving you the flexibility to design your workflow as needed.
Automatic Resizing: Nodes automatically resize to fit the content, making the interface cleaner and more intuitive.
Enhanced Visualization
Progress Bars: See the progress of tasks within your subgraph directly on the subgraph node.
Previews: While image previews won't show, other types of previews will be visible, helping you monitor the workflow.
Troubleshooting ComfyUI-Sub-Nodes
Common Issues and Solutions
Subgraph Not Appearing: If your subgraph doesn't appear in the VIV_Subgraph node, try hitting the "Refresh" button.
Incorrect Loading: If a subgraph doesn't load correctly, ensure it was saved with the extra keys added by the extension. Older workflows need to be updated with input/output nodes.
Missing Previews: Image previews won't show on the subgraph node. This is a known limitation.
Frequently Asked Questions
Why can't I see my subgraph?
Ensure it is saved in the subnodes folder and hit "Refresh" in the VIV_Subgraph node.
Can I use old workflows as subgraphs?
Only if you update them with the necessary input/output nodes and save them again.
Learn More about ComfyUI-Sub-Nodes
For additional resources, tutorials, and community support, consider visiting the following:
ComfyUI Documentation
Community Forums
Video Tutorials
These resources are tailored to help AI artists get the most out of ComfyUI-Sub-Nodes, providing step-by-step guides, troubleshooting tips, and a platform to ask questions and share experiences.