Ai-tools

ComfyUI Workflow Basics — Building Your First Image Pipeline

Published 2026-07-23 ~496 words Tags: comfyui, stable-diffusion, image-generation

ComfyUI is the most powerful interface for Stable Diffusion, but it has a learning curve. Unlike automatic1111's all-in-one approach, ComfyUI gives you raw node-based control over every step of the generation process. This guide walks through building a basic text-to-image workflow from scratch.

Why ComfyUI?

If you're serious about image generation, you eventually hit the limits of AUTO1111. Custom attention masking, multi-stage pipelines, precise control over latent operations — ComfyUI unlocks all of this. It's also significantly more memory-efficient because you only load the nodes you need.

Getting Started

First, install ComfyUI:

git clone https://github.com/comfyanonymous/ComfyUI
cd ComfyUI
pip install -r requirements.txt

On a dual RTX 3080 Ti setup, you'll want to start with the --highvram flag to split models across both GPUs:

python main.py --highvram --force-fp16

Your First Workflow

A basic text-to-image workflow needs only four nodes:

  1. Checkpoint Loader — Loads your SD model
  2. CLIP Text Encoder — Converts your prompt into tokens
  3. KSampler — The diffusion engine
  4. VAE Decode — Converts latents back to pixels

Connect them in order: Checkpoint → CLIP → KSampler → VAE → Save Image.

The Checkpoint Loader

This node loads your model file (.safetensors). Most modern models use the SDXL architecture, so make sure your checkpoint is SDXL-compatible. Popular picks right now:

  • RealVisXL — Photorealistic
  • Juggernaut XL — Versatile generalist
  • Pony Diffusion XL — Stylized/anime

The CLIP Text Encoder

SDXL actually has two CLIP encoders — one for the main prompt, one for a secondary "style" prompt. In ComfyUI, you'll see two CLIP inputs on the KSampler. Connect both, but you can leave the secondary one empty or use a generic "high quality" prompt.

The KSampler

This is where the magic happens. Key settings:

  • Steps: 20-30 for SDXL. More steps = more detail, but diminishing returns past 30.
  • CFG: 3.5-7.0. Lower = more creative, higher = more prompt-adherent.
  • Sampler: euler or dpmpp_2m are reliable defaults.
  • Scheduler: karras gives better contrast.

The Unofficial Tricks

Here's what the official docs won't tell you:

Refiner pass. In SDXL, you can chain a second KSampler at a lower denoise (0.2-0.4) with a different checkpoint. This "refiner" pass adds finer details without changing composition. ComfyUI makes this trivial — just route the first KSampler's latent output into a second one.

ControlNet for precision. Want a specific pose or composition? Drop a ControlNet node between the CLIP and KSampler. OpenPose for poses, Canny for edge detection, Depth for spatial structure. It's a single node connection that dramatically improves consistency.

Batch generation looping. Instead of generating one image at a time, set the KSampler's batch_size to 4 or 8. With dual GPUs, this barely increases per-image time.

Performance Tips

  • Use --force-fp16 for 30-40% speedup with minimal quality loss
  • Disable the VAE tiling for single images — it only helps with high-res (2K+)
  • Queue multiple workflows before clicking "Generate" — ComfyUI batches efficiently

ComfyUI rewards experimentation. Start simple, then add nodes as you need them. The interface looks intimidating, but every node is just a tool in your pipeline.