Build Better ComfyUI workflows
Organize complex workflows and reduce node duplication
Published: 2026-02-27
Clean ComfyUI Workflows: Subgraphs, Data Lists & Batches
ComfyUI workflows get messy fast. What begins as a clean, minimal node graph quickly balloons into a dense, hard-to-traverse layout. Worse, manual node duplication creates configuration overhead: every copy-pasted node becomes an independent instance, forcing you to manually propagate simple changes across the entire graph.
In this post, I share three features that have made a real difference for us: Subgraphs to organize complexity, Data Lists and Batches to reduce repetition, and a quick note on the ComfyUI Manager as the gateway to extensions.
ComfyUI Manager: Gateway to Extensions
ComfyUI-Manager is now bundled with ComfyUI as an extension but requires the --enable-manager flag to activate. Once enabled, it streamlines installing and updating custom nodes, browsing node libraries, and downloading and managing models.
The ComfyUI community extends the core with additional features:
- Workflow Templates: start and expand your workflows with community-shared templates, ensuring access to the latest advancements in Generative AI.
- Custom Nodes: extend ComfyUI with new features, integrations, and tools via community-developed node libraries.
- Partner Integrations: organizations like ByteDance, Gemini, Grok, OpenAI, and others have contributed libraries to make it easier to use their models and infrastructure.
Data Lists and Batches: "vectorize" your workflow
ComfyUI loops over the values of Data Lists and Batches in your workflow. List values are iterated over sequentially, and batch values are processed in one go.
So, when you need to repeat a step in your workflow, you can:
- Duplicate the workflow section as many times as needed, or
- Use Data Lists or Batches to loop over values, streamlining your process and reducing clutter.
# Batches
Images, Masks, and Latents are represented as 4D PyTorch tensors, with the first dimension having a length of 1. A batch is a set of images, masks, or latents concatenated in the first dimension of the tensor.
A batch of 4 images has shape [4, H, W, C] — all 4 images in the same tensor. Note that when two batches are input to a node, they must have the same number of items in the first dimension.
# Data Lists
Data Lists are Python lists of values, with the items processed one at a time by a node. The outputs of the node are lists of the same length. When multiple lists are input to a node, the node iterates over the longest list and reuses the last value of the shorter list(s).
Processing a list of images uses less memory than a batch, as images are processed sequentially rather than simultaneously. The calculation time does increase though.
Some useful nodes that create Lists are:
Comfy Core-Create List: Accepts any number of inputs and outputs them as a single Data List.EasyUse-PromptList: Define up to 5 prompts directly in the node's widgets.WebApp API-Combine lists: Combine up to 5 input lists into one or more output lists using one of the 7 available methods.

# Combining Lists and Batches
When you combine Data Lists and Batches as node inputs, you get a list of batches as output, with each image in the input batch being combined with each value in the input list. This eases performing parameter sweeps during development and creating a larger variety of results during use.
By applying this to one of our larger workflows, we replaced 15+ duplicated nodes with a single parameterized section. Adding a new variant now means appending to a list instead of copying and adjusting nodes.
Rule of thumb: Use Batches for simultaneous processing when all items have the same shape and you have enough VRAM. Use Data Lists for sequential processing when items differ in size, or when VRAM is constrained.
Memory trade-off: A batch of 4 images loads all 4 into VRAM at once. A list of 4 images loads one at a time. For large images or limited VRAM, lists can be the difference between a successful run and an OOM error.
Subgraphs: Apply Hierarchy
Managing complex workflows in ComfyUI can be challenging, often requiring reliance on the minimap to maintain an overview and the use of EasyUse - Bookmark nodes for quick navigation.

Subgraphs offer a practical solution by allowing you to hide nodes behind one subgraph node, reducing unnecessary complexity at the top level, easing navigation, and improving readability.
# How to Use Subgraphs
- Select a set of nodes and click the
Convert to subgraphoption in the toolbar or right-click menu. - Link necessary inputs and outputs of the nodes to the subgraph's input and output slots.
By dividing the large workflow above into step-based subgraphs, we clarified its functionality and simplified navigation and maintenance.

Inputs and outputs of your subgraph appear as widgets and output slots on the subgraph node. Note that input slots remain input slots on the subgraph node.
From the right-click menu, you can promote an input widget from your subgraph to the subgraph node, without drawing a link. The promoted widget is marked with a purple border (visible in the screenshot above).
When you subgraph your entire workflow, you create a one-node interface for your workflow. Anyone using your workflow from the server will be presented with just the inputs necessary for running it without being overwhelmed by the complexity underneath.
For our workflow a one-node interface with the necessary inputs looks like this:

# Subgraph Blueprints
If you need a subgraph multiple times, create a subgraph blueprint. Blueprints let you add the subgraph to any workflow like a regular node — no copying required.
Custom node library maintainers can provide subgraph blueprints for common node combinations, making it easier for users to get started. If you build reusable workflow patterns, consider sharing them as blueprints too.

# Exporting Workflows
When you export a workflow with subgraphs, their definitions are stored in the definitions - subgraphs list. For workflow API exports, subgraphs are unpacked, making all nodes (normal and subgraphed) available in the same list.
Conclusion
Subgraphs and Data Lists/Batches are two of ComfyUI's most underused features. Subgraphs turn sprawling node canvases into clean, navigable interfaces. Data Lists and Batches replace node duplication with parameterized loops. Together, they make workflows easier to maintain, share, and extend.
If you're working with complex ComfyUI workflows, try subgraphing one section and see how much easier it is to navigate.