Introduction to ComfyUI

Table of contents

What is ComfyUI?

ComfyUI is a node-based AI image/video generation workflow tool. You can visually build complex AI generation pipelines by connecting nodes, each responsible for a specific function.

Core Concepts

Node

  • The basic unit of a workflow. Each node performs a single function.
  • The left side of a node is the input, and the right side is the output.

For detailed explanations, please refer to the "Understanding Parameters" section below.

Workflow

Here is what a basic workflow looks like. A workflow is the entire task flow created by connecting nodes. It can be saved and shared as a JSON file.

Subgraph A subgraph is a module that groups multiple nodes together. It helps organize complex workflows neatly and allows for reuse.


Basic Workflow Structure

All image generation workflows follow this flow:

Main Node Types

NodeRoleDescription
Load CheckpointLoad ModelLoads the model to be used
CLIPTextEncodePrompt EncodingEnters the text prompt
EmptyLatentImageCreate Empty CanvasSets the image dimensions
KSamplerSampling (Core)Configures detailed settings for image generation
VAEDecodeDecodingGenerates the actual image from configured values
SaveImageSaveSaves the generated image to a file

Main Data Types

The following data types flow between nodes:

TypeDescriptionColor (ComfyUI Default)
MODELDiffusion model (UNET)Purple
CLIPText encoder modelYellow
VAEImage encoder/decoderRed
CONDITIONINGEncoded prompt/conditionsOrange
LATENTLatent space image dataPink
IMAGEActual pixel image (RGB)Blue
MASKMask (for inpainting)Green

Understanding Key Parameters

KSampler Parameters

These are the most important parameters that determine the quality and outcome of image generation:

ParameterRoleTypical Values
seedRandom seed. Same value = same resultAny number
stepsNumber of generation steps. Higher = more refined but slower4-30 (varies by model)
cfgPrompt adherence strength1.0-11.0 (varies by model)
sampler_nameSampling algorithmeuler, dpmpp_2m, etc.
schedulerNoise schedulernormal, simple, sgm_uniform, etc.
denoiseDenoise strength (important for img2img)0.0-1.0

Image Generation Model History (Image Model Landscape)

GenerationModelReleasedResolutionMinimum VRAM
1st GenSD 1.52022.10512x5124GB
2nd GenSDXL2023.071024x10248GB
3rd GenSD 3.520241024x10248GB
4th GenFlux2024.081024x1024+12GB
5th GenQwen Image2025Various12GB+
5th GenZ-Image20251024x10248GB

Guidebook Structure

This guidebook is organized by task type. Refer to the relevant chapter based on the task you want to accomplish.

ChapterContentDifficulty
01. Image GenerationText-to-ImageBeginner
02. Image EditingInpainting, Outpainting, Relighting, Background RemovalElementary
03. Guided GenerationControlNet, LoRA, Reference-based GenerationIntermediate
04. Upscale/EnhancementResolution EnhancementElementary
05. Video GenerationText-to-Video, Image-to-VideoIntermediate