ai tools

How to Use ComfyUI: A Complete Step-by-Step Tutorial

From first install to FLUX workflows, ControlNet, and custom node pipelines — everything you need to go from zero to production.

Updated July 2026·intermediate·~35 min read·11 steps

What is ComfyUI? It's a free, open-source node-based interface for Stable Diffusion and FLUX AI models. Instead of hiding the image generation process behind a single "Generate" button, ComfyUI exposes every step as a visual block you can inspect, modify, and rewire — giving you complete control over how your AI outputs are made. Think of it as the Blender of AI image tools: steeper curve than simpler apps, unlimited ceiling.

Watch — ComfyUI in 20 Minutes: Absolute Beginner Guide
Step 01

Download & Install ComfyUI

~15 minutes · one-time setup

ComfyUI is free and open-source (GPL-3.0). Run it locally with zero subscription cost, or use the cloud version if you don't have a GPU. Two paths:

🖥 Comfy Desktop

One-click installer, auto-updates, works on Windows / Mac / Linux. Recommended for beginners.

comfy.org/download →

☁️ Comfy Cloud

Zero setup. Runs in any browser. Pay per GPU-minute. Good for testing before committing to local.

cloud.comfy.org →

Local desktop install (step by step)

  1. Go to comfy.org/download and grab the installer for your OS.
  2. Extract the archive to a short path on an SSD — e.g. C:\ComfyUI\. Long paths or slow HDDs cause model-loading errors on Windows.
  3. Run the launcher for your hardware: run_nvidia_gpu.bat for Nvidia GPU on Windows, run_cpu.bat for CPU only (very slow). On Mac: the Desktop app handles this automatically via Metal.
  4. Your browser opens at http://127.0.0.1:8188 — this is your local server. Keep the terminal window open while using ComfyUI.
Hardware minimums

Nvidia GPU with 6+ GB VRAM — recommended for SDXL. 4 GB works for SD 1.5. FLUX models need 8–12+ GB. Apple Silicon (M1–M4) is supported via Metal. CPU-only works but expect 5–20 minutes per image instead of seconds.

Manual install via GitHub (advanced)

# Clone the official repo
git clone https://github.com/comfy-org/comfyui
cd comfyui

# Install Python dependencies
pip install -r requirements.txt

# Launch with Nvidia GPU
python main.py --cuda-device 0

# Launch CPU-only
python main.py --cpu

# Launch with low VRAM optimizations
python main.py --lowvram
Step 02

Explore the Interface

~5 minutes · orientation

ComfyUI loads a dark canvas in your browser. This is your node graph workspace — a visual programming environment where AI processing steps are wired together like a circuit board.

A default text-to-image graph looks roughly like this on the canvas:

  • Load Checkpoint (left) outputs MODEL, CLIP, and VAE connections
  • CLIP Text Encode nodes (top middle) turn your positive and negative prompts into CONDITIONING
  • KSampler (middle) takes MODEL, CONDITIONING, and a LATENT image and runs the diffusion steps (steps, cfg, seed, sampler, scheduler)
  • VAE Decode (right) turns the sampled LATENT into a pixel IMAGE
  • A Control Panel on the right holds Queue Prompt, Save, Load, and Load Default, plus a queue/running status readout
Keyboard shortcuts you'll use daily

Double-click canvas → add node · Ctrl+Enter → queue prompt · Ctrl+Z → undo · Ctrl+D → load default workflow · H → fit to canvas · Ctrl+A → select all · Right-click node → bypass / delete / copy

Step 03

Download Your First AI Model

~20 minutes · depends on connection speed

ComfyUI is the interface — the intelligence comes from a checkpoint model, a 2–12 GB file trained on billions of images. Without one, nothing generates. Here's exactly which model to start with and where to get it.

Which model to start with

Level 4 — Power user
SD 1.5 (2 GB — 4 GB VRAM)

Best for: Beginners, fast iteration, older hardware. Standard 512×512 generation. Hugging Face →

Level 4 — Power user
SDXL 1.0 (6.5 GB — 6–8 GB VRAM)

Best for: Native 1024×1024 output, superior composition and prompt following. Hugging Face →

Level 4 — Power user
FLUX.1 Schnell (11 GB — 8–12 GB VRAM)

Best for: Extremely fast generation (4 steps). Apache 2.0 commercial license. Hugging Face →

Level 4 — Power user
FLUX.1 Dev FP8 (8 GB — 8–10 GB VRAM)

Best for: Quantized Dev model — near-identical quality to full precision but fits on standard hardware. Hugging Face →

Recommended starting point by hardware

6 GB VRAM: SDXL 1.0 via Civitai (community fine-tunes are excellent). 8–10 GB: FLUX.1 Dev FP8 — best quality per VRAM dollar. 12+ GB: FLUX.1 Dev full precision.

Where to put the files

# Checkpoint models
ComfyUI/models/checkpoints/your-model.safetensors

# LoRA fine-tunes
ComfyUI/models/loras/your-lora.safetensors

# Upscale models (RealESRGAN etc.)
ComfyUI/models/upscale_models/RealESRGAN_x4plus.pth

# ControlNet models
ComfyUI/models/controlnet/control_v11p_sd15_canny.pth

# VAE (optional, some models need separate VAE)
ComfyUI/models/vae/vae-ft-mse-840000-ema-pruned.safetensors

After placing a file, click Refresh in the control panel. It will appear in the relevant node's dropdown instantly.

Step 04

Generate Your First Image

~10 minutes · your first output

Press Ctrl+D to load the default Text-to-Image workflow. You'll get a pre-wired graph — model loader, text encoders, sampler, VAE decoder, image saver. Ready to run.

  1. Click the Load Checkpoint node dropdown → pick your downloaded .safetensors file.
  2. Positive prompt (top CLIP Text Encode): be specific. "a majestic snow leopard on a mountain peak at golden hour, ultra-detailed fur, photorealistic, dramatic lighting"
  3. Negative prompt (bottom CLIP Text Encode): "blurry, low quality, deformed, watermark, text, extra limbs, bad anatomy"
  4. Resolution in Empty Latent Image node: 1024×1024 for SDXL · 512×512 for SD 1.5 · 1024×1024 for FLUX.
  5. Press Queue Prompt or Ctrl+Enter. A green border sweeps through each node as it processes. Your image appears in the Save Image node output.
KSampler settings decoded

Steps (20–30) — more steps = higher quality, slower. CFG Scale (7–12) — how literally the model follows your prompt. High CFG = oversaturated. Sampler: DPM++ 2M Karras is the community default for quality. Seed: fix it while testing so you isolate one variable at a time. Set to -1 for random.

Watch — How to Use ComfyUI — Step-by-Step Tutorial
Step 05

Understand Nodes & Data Flow

~15 minutes · the mental model that unlocks everything

This is the most important section. Once you understand data flow, you can build any workflow — not just copy them. Each wire carries one data type. Mismatch types and ComfyUI won't let you connect them — it's a built-in type system.

MODEL
The neural network weights. Flows from Load Checkpoint → KSampler.
CONDITIONING
Text prompt as embeddings. Positive + negative both flow into KSampler.
LATENT
The image in compressed math space — not pixels yet. Created by Empty Latent, decoded by VAE.
IMAGE
Decoded pixels. Goes to Save Image, upscalers, or ControlNet preprocessors.
CLIP
The text encoder. From Load Checkpoint → CLIP Text Encode nodes.

Standard text-to-image node flow

  1. Load Checkpoint outputs MODEL, CLIP, and VAE.
  2. CLIP feeds two CLIP Text Encode nodes — one for the positive prompt, one for the negative prompt — each producing CONDITIONING.
  3. An Empty Latent Image node produces a blank LATENT at your chosen resolution.
  4. KSampler takes MODEL, the positive and negative CONDITIONING, and the LATENT, and outputs a sampled LATENT.
  5. VAE Decode takes the sampled LATENT plus VAE and outputs a pixel IMAGE.
  6. Save Image takes the IMAGE and writes it to disk.
Connecting nodes

Click-drag from an output pin (right side) to an input pin (left side) of the same color. ComfyUI enforces type safety — mismatched types won't connect. Right-click any wire to delete it. Right-click a node → Bypass to disable it without breaking the graph.

Step 06

Add Upscaling — Before & After

~10 minutes · 4× resolution boost

Your base generation might be 512px or 1024px. An upscale node takes that output and runs it through a dedicated super-resolution model — producing a 2048–4096px result with recovered fine detail that the base model couldn't render at small scale.

Before
512 × 512 px
Base generation
512–1024px output direct from KSampler. Soft edges, visible pixel structure at 100% zoom.
After
2048 × 2048 px
After RealESRGAN ×4
2048–4096px output. Sharp edges, fine texture detail, print-ready quality.

Add the upscaling nodes

  1. Download RealESRGAN_x4plus.pth from xinntao/Real-ESRGAN releases. Place it in ComfyUI/models/upscale_models/.
  2. Double-click canvas → search Load Upscale Model → add it. Select RealESRGAN_x4plus from its dropdown.
  3. Double-click canvas → search Upscale Image (using Model) → add it. Wire: Load Upscale Model output → Upscale Image (UPSCALE_MODEL pin).
  4. Rewire image flow: VAE Decode output → Upscale Image (IMAGE pin) → Save Image.
  5. Queue Prompt. Output will be 4× your base resolution with recovered detail.
VRAM headroom required

Upscaling a 1024px → 4096px image needs significant extra VRAM. If you hit an OOM error, try Upscale Latent by (upscales before decoding, more VRAM-efficient) or reduce your base resolution to 768×768 first.

Step 07

ControlNet — Pose & Depth Control

~20 minutes · precise structural conditioning
What ControlNet unlocks

Without ControlNet, your image composition is entirely up to the model. With it, you feed in a structural guide — a pose skeleton, a depth map, a Canny edge drawing — and the model generates an image that follows that exact structure. This is how AI portrait studios reproduce a client's precise pose across dozens of style variations.

ControlNet types at a glance

TypeInputUse case
OpenPose / DWPosePhoto → skeleton overlayMatch a person's exact body pose
Canny EdgePhoto → edge mapPreserve outlines and structural composition
Depth MapPhoto → depth estimationMaintain 3D spatial relationships
Scribble / SketchHand-drawn line artTurn rough sketches into full renders
IP-AdapterReference imageMatch style, face, or composition of a reference photo

How to set it up

  1. Via ComfyUI Manager → Install Custom Nodes → search ComfyUI-ControlNet-Aux. Install it and restart.
  2. Download a ControlNet model matching your base checkpoint. For SDXL: controlnet-canny-sdxl. For SD 1.5: control_v11p_sd15_openpose. Place in ComfyUI/models/controlnet/.
  3. Add a Load Image node → feed your reference photo into a preprocessor node (e.g. DWPose Estimator for poses, Canny for edges).
  4. Add Load ControlNet Model → select your downloaded model.
  5. Add Apply ControlNet node. Wire: preprocessor image output → Apply ControlNet IMAGE pin. Wire: Load ControlNet → CONTROL_NET pin. Wire: your positive CONDITIONING → CONDITIONING pin.
  6. The Apply ControlNet output CONDITIONING replaces your positive conditioning into the KSampler. Adjust strength (0.5–1.0) to control how strongly the structure is enforced.
Start with Canny, not Pose

Canny edge detection is the easiest ControlNet to debug — the edge map is visually obvious. Once you understand the wire routing, swap in DWPose or Depth Anything for more complex conditioning. Official docs with walkthrough: docs.comfy.org/tutorials/controlnet

Step 08

FLUX Workflow Setup

~15 minutes · current state-of-the-art
Why FLUX is different

FLUX is a 12-billion parameter rectified flow transformer from Black Forest Labs — a fundamentally different architecture than Stable Diffusion. It uses a dual CLIP text encoder (T5XXL + CLIP-L), handles long complex prompts far better than SD, and produces photorealistic output with correct anatomy and text rendering. Do not use the standard SD workflow for FLUX — the node graph is different.

FLUX vs. SD node differences

ComponentStable Diffusion (SDXL)FLUX
Model loaderLoad CheckpointLoad Diffusion Model
Text encoderSingle CLIPDual CLIP: T5XXL + CLIP-L
VAEBundled in checkpointSeparate VAE file required
SamplerDPM++ 2M KarrasEuler · scheduler: simple
Guidance scale (CFG)7–12 typical3.5 typical (lower is better)
Steps20–3020–28 Dev · 4 Schnell
Negative promptsYes, effectiveIgnored / unused in base FLUX

Set it up in 5 steps

  1. Download FLUX.1 Dev (.safetensors) from Hugging Face / black-forest-labs. Place in ComfyUI/models/unet/ (not checkpoints — FLUX uses a separate unet folder).
  2. Download the FLUX VAE (ae.safetensors) and both text encoders (t5xxl_fp8_e4m3fn.safetensors + clip_l.safetensors) from the same repo. Place VAE in models/vae/ and encoders in models/clip/.
  3. In ComfyUI, press Ctrl+D → look for a FLUX template in the built-in library, or load one from the Comfy.org workflow browser.
  4. In the Dual CLIP Loader node, select t5xxl_fp8_e4m3fn for clip_name1 and clip_l for clip_name2. Type: flux.
  5. Write your prompt in the CLIP Text Encode node. FLUX handles long, natural-language prompts well — describe the scene in sentences. No negative prompt needed. Queue and run.
Low VRAM? Use FLUX FP8

The FLUX.1 Dev FP8 quantized model needs only ~8 GB VRAM vs. 12+ GB for full precision, with near-identical visible quality. It's the practical choice for most GPUs. Add --lowvram to your launch flags for extra headroom.

Watch — Ultimate Beginner Guide to Learning ComfyUI (2026)
Step 09

Save, Share & Explore Templates

~5 minutes · workflow management

Save your workflow

Click Save → exports your full node graph as a .json file. Every node, every setting, every wire. Share this file and anyone can load your exact workflow.

The workflow-in-image trick

Every PNG ComfyUI outputs has the full workflow embedded in its metadata. Drag any ComfyUI-generated PNG onto the canvas and the complete node graph loads instantly — no JSON file needed. This is how the community shares workflows without documentation.

Reverse-engineer any output

See a stunning ComfyUI image posted online? If the creator didn't strip metadata, drag it onto your canvas. You get their exact model, sampler settings, prompts, and node graph. This is the fastest way to learn advanced techniques.

Built-in template library

01
Image-to-Image
Use an existing image as the generation starting point. Denoise at 0.5–0.75 to preserve composition while applying a new style.
02
Inpaint & Outpaint
Mask a region and regenerate only that area, or expand the canvas outward. Essential for fixing artifacts and extending scenes.
03
Image-to-Video
Animate a still image using Stable Video Diffusion or Wan2.1. Full pipeline in the template library — no extra setup required.
04
LoRA Loader
Layer a LoRA fine-tune on top of the base model. Adjust weight (0.5–1.0) to blend the LoRA's influence. Multiple LoRAs can stack.
Step 10

Essential Custom Nodes

~15 minutes · extend your toolkit

Install ComfyUI Manager first — it's the package manager for everything else. Without it, installing nodes requires manually cloning GitHub repos.

# From inside your ComfyUI directory:
cd custom_nodes
git clone https://github.com/Comfy-Org/ComfyUI-Manager
# Restart ComfyUI — Manager button appears in UI
Node PackWhat it doesPriority
ComfyUI ManagerPackage manager — install, update, disable all other nodes from the UI. Non-negotiable first install.Essential
ComfyUI Impact PackFaceDetailer — auto-detects faces and re-renders them at high resolution. Fixes deformed faces in seconds. 25%+ of all custom node downloads.Essential
ComfyUI-ControlNet-AuxPreprocessors for ControlNet: DWPose, Depth Anything V2, Canny, Scribble. Required for Step 7.High
WAS Node Suite200+ utility nodes: image ops, file handling, text manipulation, logic nodes. The Swiss army knife of ComfyUI.High
Efficiency NodesCompresses the standard workflow into fewer combined nodes. Keeps complex graphs navigable.Medium
SUPIR UpscaleState-of-the-art upscaling — dramatically outperforms RealESRGAN for complex scenes with fine detail.Medium
ComfyUI IPAdapter PlusStyle and face transfer from a reference image. Feed in a photo → generate variations in that style. Extremely powerful for character consistency.Medium
Watch — Get Started in ComfyUI w/ Max Novak
Step 11

What to Build Next

Your ongoing learning path

You've completed the foundation. Here's the learning ladder — each level unlocks new categories of output and control.

Level 4 — Power user
Text-to-image · Upscaling · Template exploration

You can generate, upscale, and work from built-in templates. Build 10+ workflows from scratch using only the default node set before moving up.

Level 4 — Power user
ControlNet · LoRA stacking · img2img · Inpainting · FLUX

Learn to condition generation with reference images, apply multiple LoRAs simultaneously, and use FLUX for photorealistic output. Start with a ControlNet + LoRA combined workflow.

Level 4 — Power user
IPAdapter · Face consistency · Image-to-video · Batch workflows · API automation

Use IPAdapter for style transfer and character consistency across many images. Build video pipelines. Automate batch generation via the ComfyUI REST API. Explore LoRA training.

Level 4 — Power user
Custom node development · Multi-model pipelines · Production systems

Write your own custom nodes in Python. Build multi-stage pipelines (generate → upscale → face fix → video → audio) as a single automated graph. Wire ComfyUI into production apps via the API.

The fastest path forward

Grab any workflow from comfy.org workflow browser that does something you can't do yet. Load it, break it, fix it, extend it. You'll learn more from debugging someone else's advanced workflow in 2 hours than from tutorials in a week.

AI Diffusion Myths vs. Truths

Myth
You need a $2,000 GPU to generate images.
Truth: You can run SD 1.5 on 4GB VRAM, SDXL on 6-8GB VRAM, and FLUX on 8GB VRAM (using FP8 quantizations). Alternatively, Cloud GPUs let you build on any low-end laptop.
Myth
ComfyUI is too complex compared to Automatic1111.
Truth: While node graphs look intimidating at first, they prevent the hidden setting conflicts common in tab-based interfaces. Once set up, they are much easier to customize.
Myth
Local CPU generation is a viable fallback.
Truth: While CPU generation works, it takes 5 to 20 minutes per image (vs. seconds on a GPU). A cheap Cloud GPU or Colab is highly recommended over CPU.

Frequently Asked Questions

No — but it's the fastest path. Nvidia (CUDA) is best-supported and fastest. Apple Silicon (M1–M4) works well via Metal. AMD GPUs work via ROCm on Linux. CPU-only is possible but expect 5–20 minutes per image instead of seconds.
Three most common causes: (1) CFG Scale too high — try 7–9 for SDXL, 3.5 for FLUX; (2) wrong resolution for your model — SDXL wants 1024x1024, SD 1.5 wants 512x512; (3) model-LoRA mismatch — your LoRA must match the checkpoint version (SD1.5 LoRA on SDXL produces garbage output).
CFG Scale is the main culprit. Above 12 for SDXL tends to produce oversaturated, blown-out results. Try dropping to 7-8. Also check if your model needs a separate VAE — some SDXL models ship without a baked-in VAE and produce dull, grey-cast images without one. Download sdxl_vae.safetensors from Hugging Face and add it to your workflow.
Euler is simple and fast — good for quick tests. DPM++ 2M Karras is the community default for quality SDXL output — balances quality and speed well at 20-25 steps. DPM++ SDE Karras adds stochasticity for more varied, sometimes more creative results. For FLUX, use Euler with Simple scheduler — its architecture does not benefit from Karras schedulers.
You're exceeding your GPU's VRAM limit. Fix in order of impact: add --lowvram to your launch flags; reduce image resolution; generate at 512px and upscale instead of generating at 2048px directly; switch to an FP8/quantized model version (FLUX FP8 saves ~4 GB VRAM); close other GPU-heavy apps before running.
A1111 is simpler upfront — one settings panel, no node wiring. ComfyUI has a steeper learning curve but unlimited flexibility once past the basics. More importantly, ComfyUI supports architectures A1111 does not — FLUX, video generation (Wan2.1, SVD), audio, and 3D. Most serious users have migrated to ComfyUI. If you are starting fresh in 2026, start with ComfyUI.
A checkpoint is the full base model (2-12 GB) — the entire neural network. A LoRA (50-200 MB) modifies the checkpoint toward a specific style, character, or concept without replacing it. Multiple LoRAs can stack on one checkpoint. An embedding / textual inversion (tiny, 10-100 KB) teaches the text encoder new words that map to concepts — it modifies prompts rather than the model itself.
Two approaches: FaceDetailer from ComfyUI Impact Pack — add it after VAE Decode. It auto-detects faces, crops them, re-renders at high resolution with more steps, and blends the result back in. Takes ~30 extra seconds and fixes most issues. Alternatively, use inpainting — mask the problem area and regenerate just that region with a targeted prompt. For hands specifically, a negative prompt like "extra fingers, fused fingers, malformed hands" also helps during base generation.
Two ways: batch size in the Empty Latent Image node — set to 4 to generate 4 images in one pass (uses more VRAM per generation). Or queue multiple prompts — click Queue Prompt multiple times or use a Loop node from WAS Node Suite to iterate automatically. Setting seed to -1 randomizes each generation in a batch.
Most common causes: strength set too low — try 0.8-1.0 while debugging; model mismatch — a SD 1.5 ControlNet model will not work on SDXL and vice versa; wrong preprocessing — the preprocessor output must visually make sense (run a Preview Image after the preprocessor to check); Apply ControlNet output not connected correctly — the conditioned output must replace your positive conditioning input to the KSampler, not sit parallel to it.
ComfyUI itself (GPL-3.0) is free for commercial use. The legality of your outputs depends on the model license: FLUX.1 Schnell (Apache 2.0) is commercially free. FLUX.1 Dev is non-commercial by default. SDXL is CreativeML Open RAIL+M — commercial use is allowed with some restrictions. Always check the specific model license on Hugging Face or Civitai before using outputs commercially.
The core software is completely free and open-source. Running it locally costs nothing beyond electricity and the one-time hardware investment. Comfy Cloud uses credit-based pricing for GPU time if you do not have local hardware.