Skip to main content
This guide will walk you through creating your first complete workflow in ComfyUI. By the end, you’ll understand how nodes connect together to generate images from text prompts.

What You’ll Build

A basic text-to-image workflow that:
  • Loads a Stable Diffusion model
  • Encodes positive and negative prompts
  • Generates an image
  • Saves the result

Prerequisites

  • ComfyUI installed and running
  • A Stable Diffusion checkpoint (e.g., v1-5-pruned-emaonly.safetensors) in models/checkpoints/

Complete Workflow JSON

Here’s the API format for this basic workflow:

Understanding the Workflow

Node Connections

Each node ID (like “3”, “4”, etc.) references a node. Inputs like ["4", 0] mean:
  • "4": Node ID to connect from
  • 0: Output index from that node

The Generation Process

  1. CheckpointLoaderSimple loads the model weights
  2. CLIPTextEncode converts text prompts into embeddings
  3. EmptyLatentImage creates a random noise tensor
  4. KSampler iteratively denoises the latent based on your prompts
  5. VAEDecode converts the latent to pixel space
  6. SaveImage writes the PNG to disk

Next Steps

  • Experiment with different prompts
  • Try changing the seed for variations
  • Adjust CFG scale (higher = follows prompt more closely)
  • Increase steps for potentially better quality
  • Learn about image-to-image workflows
  • Explore ControlNet for precise control

Tips

  • Use (word:1.2) to increase emphasis on specific terms
  • Use (word:0.8) to decrease emphasis
  • Escape special characters: \(, \), \{, \}
  • Try different samplers (euler, dpm++, etc.) for different styles
  • The scheduler controls noise reduction - “normal” works for most cases