Skip to main content
Text-to-image generation is the foundational workflow in ComfyUI. This guide covers everything from basic generation to advanced prompt techniques.

Core Concepts

The Text-to-Image Pipeline

  1. Text Encoding: Your prompt is converted to embeddings via CLIP
  2. Latent Generation: Start with random noise in latent space
  3. Denoising: The model iteratively removes noise guided by your prompt
  4. Decoding: VAE converts the latent to a visible image

Key Nodes

  • CheckpointLoaderSimple: Loads MODEL, CLIP, and VAE
  • CLIPTextEncode: Converts text to conditioning
  • EmptyLatentImage: Creates the initial noise tensor
  • KSampler: Performs the denoising process
  • VAEDecode: Converts latent to pixels
  • SaveImage: Saves the final output

Basic Workflow

Advanced Prompting

Emphasis Syntax

Control the importance of specific words:
Default emphasis for () is 1.1.

Dynamic Prompts

Use wildcards for variation:
Each generation randomly selects from the options.

Comments

C-style comments work in prompts:

Textual Inversion

Place embeddings in models/embeddings/ and reference:

Parameter Guide

Seed

  • Purpose: Controls randomness
  • Same seed + settings = identical output
  • Tip: Lock seed when iterating on prompts

Steps

  • Range: 15-50 typically
  • 15-20: Fast preview quality
  • 25-35: Production quality
  • 40+: Diminishing returns

CFG Scale

  • Range: 1-20
  • 1-5: Creative, loose interpretation
  • 7-9: Balanced (recommended)
  • 10-15: Strict adherence to prompt
  • 15+: May oversaturate or distort

Sampler Selection

Fast samplers:
  • euler: Simple, fast, good for previews
  • euler_ancestral: Adds variation between steps
Quality samplers:
  • dpm++ 2m karras: Excellent quality/speed balance
  • dpm++ sde karras: High quality, slower
  • dpm++ 2m sde karras: Best quality, slowest
Specialized:
  • ddim: Deterministic, good for img2img
  • uni_pc: Fast convergence, experimental

Scheduler

  • normal: Linear noise schedule
  • karras: Better for DPM++ samplers
  • exponential: Smoother transitions
  • sgm_uniform: For SD3/SDXL

Workflow Example: High-Quality Portrait

Batch Generation

Generate multiple variations:
  1. Set batch_size in EmptyLatentImage to 4 (or higher)
  2. Keep seed the same for subtle variations
  3. Or use different seeds for diverse results

LoRA Integration

Enhance your model with LoRAs:
  1. Add LoraLoader node
  2. Connect MODEL and CLIP from checkpoint
  3. Select LoRA file
  4. Set strength_model (0.5-1.0 typical)
  5. Set strength_clip (0.5-1.0 typical)
  6. Connect LoraLoader outputs to KSampler

Troubleshooting

Black/blank images

  • Check VAE compatibility with your model
  • Try loading a separate VAE with VAELoader
  • Reduce CFG scale

Low quality results

  • Increase steps (try 30-40)
  • Use better sampler (dpm++ 2m karras)
  • Improve prompt detail and specificity
  • Check if model supports your resolution

Out of memory

  • Reduce image dimensions
  • Lower batch size
  • Use tiled VAE for very large images
  • Enable CPU offloading: --lowvram flag

Next Steps