Skip to main content
The subgraph feature requires ComfyUI frontend version 1.24.3 or later. If you don’t see this feature, please refer to: How to Update ComfyUI
  • Images in this document are made with nightly version frontend, please refer to the actual interface
  • Some features like converting subgraph back to nodes will be supported in the future
A subgraph is a powerful ComfyUI feature that lets you package complex workflows into a single reusable subgraph node, making them easier to manage and share. Subgraph Think of a subgraph as a “folder” for your workflow – you can group related nodes together and use the entire collection as one unified subgraph node. Use subgraphs to:
  • Simplify complex workflows
  • Reuse common node combinations
  • Build more efficient workflows with modular components

Creating a Subgraph

1

Select nodes

Select the nodes you want to group in ComfyUI
2

Click the subgraph icon

Subgraph iconFind the subgraph icon in the toolbar
3

Subgraph created

Workflow using subgraphComfyUI automatically creates a subgraph based on your selected nodes’ inputs and outputs
4

Customize your subgraph

Refer to Editing Subgraphs, you can edit and organize the subgraph to create a fully functional nodeWorkflow using subgraph

Working with Subgraphs

Basic Operations

Subgraphs work just like regular nodes. You can:
  • Change colors and names
  • Use bypass to disable
  • Apply all standard node operations

Editing Subgraphs

To enter edit mode:
  • Double-click the empty area inside the subgraph (not on widgets), or
  • Click the subgraph edit button
Subgraph editing mode In edit mode you’ll see:
  1. Navigation bar: Exit the current subgraph and return to the parent level
  2. Input slots: Internal node inputs exposed to the outside
    • Connect outputs to slots like normal nodes
    • Right-click connection points to rename/delete exposed slots
  3. Output slots: Outputs exposed to the outside (same functionality as input slots)
Subgraph slots Working with slots:
  1. Default slot (labeled 1): Use this to add new input/output connections
  2. Right-click existing slots to rename, delete, or disconnect from original nodes
Note: Slot connections follow standard data type validation rules

Nested Subgraphs

Create even more complex workflows by nesting subgraphs within subgraphs. Nested subgraph The navigation bar shows your current level and lets you easily move between nested subgraphs. Nested subgraph navigation

Unpack Subgraphs to Nodes

When you’re done creating a subgraph, you can convert it back to nodes if you need to. Subgraph to node
  1. You can select the subgraph node then use right-click menu “Unpack subgraph” to convert it back to nodes.
  2. Click the “Unpack subgraph” button in the select toolbox to convert it back to nodes.

Subgraph Blueprint

With ComfyUI frontend version 1.27.7 or later, you can publish your subgraph to the node library. This feature allows you to convert a subgraph to a Subgraph Blueprints node, which means it’s a reusable subgraph node.

Publish Subgraph to Node Library

Publish Subgraph Currently, you have two ways to publish subgraph to node library, both are in the selection toolbox:
  1. Click the book(publish) icon on the selection toolbox
  2. Open the selection toolbox menu, use the Add Subgraph to Library menu to publish subgraph
After you click on the book(publish) icon or Add Subgraph to Library menu, you will see the following dialog: Subgraph naming By default, the subgraph will use the name of the subgraph node as the name of the subgraph blueprint. After publishing, you will see the subgraph blueprint node in the node library. Subgraph blueprint node Now, you can drag or search the subgraph just like a normal node. The new subgraph node that has been added from Subgraph Blueprints is still isolated, which means after adding it to the workflow, it can be edited independently, they will not affect each other.

Edit Subgraph Blueprint

If you want to edit the subgraph blueprint, you can click the edit button just like the image below, you can delete it as well. Edit Subgraph Blueprint This will enable the subgraph editing mode Subgraph editing mode After editing the subgraph blueprint, you can go to the parent level to preview the subgraph. Update Subgraph Blueprint If you want to save the updated subgraph blueprint, you can click the save button or use the shortcut key Ctrl + S.
I