Creating Your First Complete Workflow
Build a functional text-to-image workflow from scratch using basic nodes
Creating Your First Complete Workflow
In this lesson, we'll build your first functional text-to-image workflow in ComfyUI from the ground up. By the end, you'll have a complete workflow that can generate images from text prompts using the essential nodes that form the backbone of most ComfyUI workflows.
Understanding the Basic Workflow Structure
Every ComfyUI text-to-image workflow follows a similar pattern:
- Text Input → Text Encoding → Sampling → Decoding → Image Output
- Model Loading nodes that provide the AI models needed for generation
- Parameter nodes that control the generation process
Think of it like a factory assembly line where each node performs a specific function, and the connections between nodes determine how data flows through your workflow.
Step 1: Loading Your Model
Start by adding a Load Checkpoint node to your canvas. This node loads the Stable Diffusion model that will generate your images.
Load Checkpoint
├── ckpt_name: [Select your model file]
├── MODEL (output) → connects to sampling
├── CLIP (output) → connects to text encoding
└── VAE (output) → connects to decoding
The Load Checkpoint node outputs three essential components:
- MODEL: The neural network that generates images
- CLIP: The text encoder that understands prompts
- VAE: The decoder that converts latent space to actual images
Step 2: Setting Up Text Prompts
Add two CLIP Text Encode (Prompt) nodes - one for positive prompts and one for negative prompts:
Positive Prompt Node:
- Connect the CLIP output from Load Checkpoint to the "clip" input
- Enter your desired image description in the text field
- Example: "a beautiful landscape with mountains and a lake, sunset lighting, highly detailed"
Negative Prompt Node:
- Connect the same CLIP output to this node's "clip" input
- Enter what you don't want in the image
- Example: "blurry, low quality, distorted, ugly"
Step 3: Configuring the Sampler
Add a KSampler node, which is the heart of the generation process:
KSampler Connections:
├── model ← Load Checkpoint (MODEL)
├── positive ← Positive CLIP Text Encode (CONDITIONING)
├── negative ← Negative CLIP Text Encode (CONDITIONING)
├── latent_image ← Empty Latent Image (LATENT)
└── LATENT (output) → VAE Decode
Key Parameters:
- seed: Controls randomness (use -1 for random)
- steps: Number of denoising steps (20-30 is typical)
- cfg: How closely to follow your prompt (7-12 works well)
- sampler_name: Algorithm used (euler, dpmpp_2m are popular)
- scheduler: How steps are scheduled (normal, karras)
Step 4: Creating the Canvas
Add an Empty Latent Image node to define your image dimensions:
- width: Image width in pixels (512, 768, 1024)
- height: Image height in pixels (512, 768, 1024)
- batch_size: How many images to generate at once (start with 1)
Connect this node's LATENT output to the KSampler's "latent_image" input.
Step 5: Decoding to Final Image
Add a VAE Decode node:
- Connect KSampler's LATENT output to "samples" input
- Connect Load Checkpoint's VAE output to "vae" input
- This converts the latent representation back to a viewable image
Step 6: Saving Your Result
Finally, add a Save Image node:
- Connect VAE Decode's IMAGE output to "images" input
- Set your preferred filename prefix
- Images will be saved to ComfyUI's output folder
Testing Your Workflow
- Queue Prompt: Click the "Queue Prompt" button to start generation
- Monitor Progress: Watch the progress bar and any console output
- View Results: Check the Save Image node or output folder for your generated image
- Iterate: Adjust prompts, parameters, or seed values and run again
Troubleshooting Common Issues
- Red nodes: Usually indicate missing connections or invalid parameters
- Slow generation: Try reducing image size or step count
- Poor results: Experiment with different samplers, CFG values, or more descriptive prompts
- Out of memory: Reduce batch size or image dimensions
Next Steps
Once you have this basic workflow running, you can:
- Experiment with different models and samplers
- Add LoRA nodes for style modifications
- Include upscaling nodes for higher resolution
- Save your workflow as a template for future use
This fundamental workflow structure serves as the foundation for more complex ComfyUI creations. Master these connections and parameters before moving on to advanced techniques.
Resources
medium
Beginners Guide to a Basic ComfyUI Workflow | by Chris Green
https://medium.com/diffusion-doodles/beginners-guide-to-a-basic-comfyui-workflow-110e871b3526
How to use ComfyUI for beginners.
other
Best complete tutorial, from the beginning, on ComfyUI?
https://www.reddit.com/r/StableDiffusion/comments/1dm2ims/best_complete_tutorial_from_the_beginning_on/
Practice
List the six essential nodes needed for a basic text-to-image workflow in ComfyUI and briefly explain what each node does.
💡 Think about the complete flow from text input to final image output, including model loading and parameter configuration.
Create a basic ComfyUI workflow by connecting the essential nodes. Take a screenshot of your completed node graph showing all connections, and generate one test image using the prompt 'a serene mountain lake at sunset, photorealistic, highly detailed'. Include your workflow file (.json) and the generated image in your submission.
💡 Make sure all nodes are properly connected with no red error indicators. Start with default parameters: 20 steps, CFG 7, 512x512 resolution.
What happens if you connect the CLIP output from Load Checkpoint to both positive and negative CLIP Text Encode nodes?
💡 Consider how the text encoder processes different types of prompts and why both positive and negative conditioning need the same text understanding capability.