If your ComfyUI workflows are starting to look like spaghetti, subgraphs are about to become your best friend. In this guide, I’ll walk you through how to take a cluttered workflow and convert it into a neat, reusable subgraph. This not only tidies up your canvas but also lets you create pre-built mini-systems—like the Z Image Turbo setup we’re using in this example.

What a Finished Subgraph Looks Like

Before we begin, here’s the type of result we’re aiming for: a single clean node where you only need to plug in your model, CLIP, VAE, and enter your prompt + settings.

Starting With a Standard Workflow

We begin with a typical image generation workflow containing:

  • Model Loader
  • CLIP
  • VAE
  • Sampler
  • Positive/Negative prompts
  • Image size
  • KSampler
  • VAE Decode

[INSERT IMAGE: Screenshot of the original full workflow]

Step 1: Select the Nodes to Combine

Highlight all the nodes you want to merge into a subgraph—essentially your entire generation chain excluding external model inputs.

Once selected:

  1. Click Subgraph
  2. ComfyUI will automatically wrap the nodes into a single reusable unit

Note: If your UI looks different, update to the latest ComfyUI build. I’m also using the new Modern Node Design interface, which you can enable in the settings.


Step 2: Understanding the New Subgraph Node

After creating the subgraph, you’ll see input ports like:

  • Seed
  • Model
  • CLIP
  • VAE
  • Positive Prompt
  • Negative Prompt

This is where you choose which internal settings to expose externally.

Step 3: Expose Additional Controls

Inside the subgraph editor, you can expose extra parameters such as:

  • Steps
  • Sampler Name
  • Scheduler
  • Denoise

Just click a parameter, select Expose, and ComfyUI will create a new input on the subgraph node.

To allow vertical, horizontal, or custom sizes, also expose: Width, Height and Batch Size

Step 5: Returning to the Main Workflow

After exiting the subgraph, your workflow now shows a single clean node containing all the essential inputs:

  • Prompts
  • Steps
  • Sampler
  • Scheduler
  • Seed
  • Width & Height

At this point, rename it something like Turbo Sampler.

Bonus: Reordering and Organizing Subgraph Parameters

Inside the subgraph editor, you can also reorder your controls for a more professional layout. For example:

  • Positive Prompt at the top
  • Negative Prompt below it
  • Seed placed above Width/Height

You can also hide optional settings or mark them as visible.

Final Thoughts

Subgraphs are a fantastic way to streamline your ComfyUI workflows. With just a few clicks, you can turn long chains of interconnected nodes into clean, organized, reusable modules. This not only helps with complex builds but also makes your workflow demonstrations look more polished.

If you have any questions, feel free to comment below. Thanks for reading, and I’ll see you in the next one!

If you'd like to support our site please consider buying us a Ko-fi, grab a product or subscribe. Need a faster GPU, get access to fastest GPUs for less than $1 per hour with RunPod.io