ComfyUIPrompting basicsParameters & settings

ComfyUI Beginners Guide: Nodes, KSampler and First Image

By Marco Cavazzana · Updated · 4 min read
ShareEmail
Short answer

ComfyUI is a node-based interface for Stable Diffusion, Flux and other open models. A basic workflow loads a checkpoint, encodes a positive and a negative prompt, creates an empty latent image, runs KSampler (seed, steps, cfg, sampler, scheduler, denoise), decodes the latent with the VAE and saves the image. Learn those seven nodes and every other workflow becomes readable.

ComfyUI looks intimidating because it shows you the machinery that other tools hide. Boxes connected by wires replace the single prompt field. The upside is that once you understand the default workflow, you understand how every diffusion model generates an image, and you can rebuild any workflow someone shares with you. This guide covers the core nodes, the KSampler settings and the prompting habits that make the difference.

What ComfyUI is

ComfyUI is open-source software you run on your own machine (or on a rented GPU). It supports Stable Diffusion 1.5 and SDXL, Flux, Wan, LTX and many other models, and it exposes each step of generation as a node. A workflow is the graph of nodes you see on the canvas. It is saved as JSON and also embedded in every PNG the Save Image node writes, which is covered in ComfyUI workflow metadata and saving.

You will need a checkpoint file (the model weights) in the models folder. Where you get models and how to pick one is a separate topic; Stable Diffusion settings explained covers the model families and the same sampler vocabulary.

The seven core nodes

  1. Load Checkpoint. Loads the model and outputs three things: MODEL, CLIP (the text encoder) and VAE (the image encoder/decoder).
  2. CLIP Text Encode (positive). Turns your prompt into conditioning the model can use. Connect CLIP from the checkpoint.
  3. CLIP Text Encode (negative). Same node, second copy, for what you do not want. Some models, Flux among them, largely ignore it.
  4. Empty Latent Image. Sets width, height and batch size. This is where resolution lives.
  5. KSampler. The engine. Takes model, positive, negative and latent, and denoises the latent over a number of steps.
  6. VAE Decode. Turns the finished latent into pixels using the VAE.
  7. Save Image. Writes a PNG to the output folder with the workflow inside. Preview Image shows but does not save.

Wires carry a type, and the colours match: a MODEL output only plugs into a MODEL input. If a connection refuses to snap, the types do not match. Right-click the canvas or double-click to search for nodes by name.

KSampler settings explained

  • seed and control after generate. The seed starts the noise. "randomize" gives a new image each run; "fixed" repeats; "increment" steps through neighbours. Fix the seed whenever you compare two settings.
  • steps. How many denoising passes. SD 1.5 and SDXL usually look finished between 20 and 30; distilled models need far fewer. More is slower, not always better.
  • cfg. How hard the model follows the prompt. 5 to 8 is the usual range for Stable Diffusion; Flux works at much lower values and uses a separate guidance node in many workflows.
  • sampler_name and scheduler. The maths of each step. euler with normal or simple, or dpmpp_2m with karras, are dependable starting pairs. Change them last.
  • denoise. 1.0 means start from pure noise, which is what text-to-image needs. Lower values keep part of an input latent, which is how image-to-image and upscaling passes work.

Writing prompts in ComfyUI

The positive prompt is plain text. Lead with the subject, then setting, light, lens and style, separated by commas or written as a sentence. Stable Diffusion models respond well to comma lists and to weighting with brackets: (red scarf:1.3) raises emphasis, values below 1 lower it. Flux prefers full sentences and ignores most weighting. The negative prompt is for recurring faults: "blurry, deformed hands, extra fingers, watermark, text". Keep it short; a long negative prompt can fight the positive one.

LoRA files add a style or subject. Insert a Load LoRA node between Load Checkpoint and the two CLIP Text Encode nodes, set the strength (0.6 to 0.9 is a sensible start) and include the trigger word the LoRA was trained with in your prompt.

Settings at a glance

SettingWhat it doesStart with
CheckpointThe model that generatesOne well-known SDXL or Flux checkpoint
Width / heightOutput resolution, set in Empty Latent Image1024 x 1024 for SDXL and Flux, 512 x 768 for SD 1.5
SeedStarting noiserandomize to explore, fixed to compare
StepsDenoising passes20 to 30 (fewer for distilled models)
cfgPrompt adherence6 to 7 for SD, much lower for Flux
Sampler / schedulerStep algorithmeuler + normal, or dpmpp_2m + karras
DenoiseHow much of the input latent to replace1.0 for text-to-image
Batch sizeImages per run1 until the prompt is right

Custom nodes and the Manager

Almost every shared workflow uses nodes that are not in the core set. ComfyUI Manager is the add-on that installs them; once it is set up, opening a workflow with missing nodes gives you an "install missing custom nodes" option. Restart ComfyUI after installing. Add custom nodes only when a workflow needs them, and note which ones a project depends on so you can rebuild the environment later.

Try it

Positive: a weathered fishing boat pulled up on a pebble beach at dawn, mist over the water, soft pink light, 35mm photograph, muted colours
Negative: blurry, deformed, text, watermark, oversaturated
Empty Latent: 1024 x 1024, batch 1
KSampler: seed fixed, steps 25, cfg 6.5, euler, normal, denoise 1.0

Queue it, then change only the cfg to 4 and then to 9 with the same seed. The three images show you exactly what guidance does to this model before you change anything else.

Frequently asked questions

Is ComfyUI harder to learn than other Stable Diffusion interfaces?
The first hour is harder because nothing is hidden, but the default workflow is only seven nodes. Once you can read checkpoint, text encode, latent, KSampler, VAE decode and save, every shared workflow follows the same pattern and you can modify it rather than depend on presets.
What do the KSampler settings in ComfyUI do?
Seed sets the starting noise, steps is how many denoising passes run, cfg is how strictly the prompt is followed, sampler and scheduler choose the step algorithm, and denoise controls how much of an input latent is replaced. Use 1.0 denoise for text-to-image and lower values for image-to-image.
Does ComfyUI work with Flux as well as Stable Diffusion?
Yes. Flux, Wan, LTX and many other open models run in ComfyUI, often with their own loader nodes and a different guidance setup. Flux prefers sentence-style prompts, mostly ignores the negative prompt and uses much lower guidance values than Stable Diffusion.

Nothing you makeis lost.

Free when it launches · Chrome on your computer · Read-only

DreamdriveComing to Chrome
Join the waiting list