Back to All Cheatsheet Libraries cheatsheets

ComfyUI

The node-based visual engine for Stable Diffusion, FLUX, and more: install methods, the core node graph, every startup flag, and how to fix Manager's missing-node errors.

A visual, node-based engine for Stable Diffusion, FLUX, video, audio, and more

Instead of a single "type a prompt, get an image" box, ComfyUI exposes the entire generation pipeline as a graph: a checkpoint loader node feeds a sampler node, which feeds a VAE decode node, which feeds a save-image node — and any of those can be swapped, branched, or rerouted. That transparency is exactly why it's the tool of choice once you outgrow a simple prompt box: ControlNets, LoRAs, multi-stage upscaling, and batch pipelines are all just more nodes on the same canvas.

Runs entirely on your own hardware (or a rented GPU box) — no account required for core functionality, and everything runs offline once models are downloaded.

1

Easiest: the desktop app

For Windows and macOS, comfy.org/download gives you an installer with no command line involved — the recommended starting point for most people.

2

Manual install (any platform) — more control, needed for custom setups

conda create -n comfyenv conda activate comfyenv git clone https://github.com/Comfy-Org/ComfyUI.git cd ComfyUI

Then install PyTorch for your GPU before the general requirements — order matters, since the wrong PyTorch build silently falls back to CPU:

# NVIDIA (current-gen, e.g. 20-series+) pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130 # AMD (Linux, ROCm) pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm7.2 # Intel Arc pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/xpu # Apple Silicon — install PyTorch nightly per Apple's own MPS guide, then: conda install pytorch-nightly::pytorch torchvision torchaudio -c pytorch-nightly
pip install -r requirements.txt python main.py
3

Windows portable build

A pre-built 7z archive, no Python setup at all. Pick the variant matching your GPU (current NVIDIA, legacy NVIDIA, AMD, Intel), extract with 7-Zip, and drop model files into ComfyUI\models\checkpoints.

4

The models folder — get this right before anything else

ComfyUI/ ├── models/ │ ├── checkpoints/ # main diffusion models (SD, SDXL, FLUX…) │ ├── vae/ # VAE files │ ├── loras/ │ ├── controlnet/ │ └── vae_approx/ # TAESD fast-preview decoder ├── input/ # source images for img2img etc. ├── output/ # generated results land here └── custom_nodes/ # community extensions

The whole interface is a canvas of connected nodes. A "workflow" is just that graph saved to a JSON file — shareable, versionable, and re-loadable exactly as built.

Load Checkpoint → CLIP Text Encode (prompt) → KSampler → VAE Decode → Save Image

Load Checkpoint

Loads the model file and splits it into the three sub-models every downstream node needs: the diffusion model, CLIP text encoder, and VAE.

CLIP Text Encode

Turns your prompt text into the conditioning tensor the sampler steers toward — one node for the positive prompt, a second for the negative.

KSampler

The actual denoising loop — steps, CFG scale, sampler name, and scheduler all live here. This is the node you'll tweak most for quality/speed tradeoffs.

VAE Decode

Converts the sampler's latent-space output back into a real pixel image before it can be saved or previewed.

Shortcut Action
Ctrl+EnterQueue the current graph for generation.
Ctrl+SSave the current workflow as a JSON file.
Ctrl+OLoad a workflow JSON file, replacing the current graph.
DeleteRemoves the selected node(s) — connections to it are removed too.
. (period)Fits the view to the current selection — the fastest way to find a node in a sprawling graph.

Terms you'll meet immediately

Checkpoint LoRA ControlNet Latent Conditioning Sampler / Scheduler CFG scale Seed Workflow JSON

Run python main.py --help for the full, version-current list. These are the ones you'll actually reach for.

Showing 0 flags
Flag What it does
--listen [IP]Listen on a given IP instead of just 127.0.0.1 — needed to reach the UI from another device on your network. Comma-separated list supported for multiple interfaces.
--port 8188Change the server port. Default is 8188.
--cpuRun everything on CPU. Works, but slow — mainly for testing a workflow without GPU access.
--gpu-onlyStore and run everything on the GPU — the opposite end of the VRAM-management spectrum from --lowvram/--novram.
--highvramKeep models resident in GPU memory instead of unloading between runs — trades VRAM headroom for faster repeated generations.
--lowvramRuns text encoders on CPU to free GPU memory when dynamic VRAM management isn't already handling it. The first flag to reach for on a memory-constrained card.
--novramMore aggressive than --lowvram — for genuinely tight VRAM situations where --lowvram alone still runs out.
--cpu-vaeRuns just the VAE decode step on CPU. Can be combined with a VRAM mode flag — useful when the VAE step specifically is what's running out of memory.
--force-fp16Forces fp16 precision globally (and sets --fp16-unet). Common pairing: --lowvram --force-fp16 for moderate VRAM savings without switching VRAM tiers entirely.
--force-fp32Forces fp32 globally — occasionally needed for numerical stability with certain models/hardware combinations, at a memory and speed cost.
--directml [DEVICE]Enables DirectML on Windows for GPUs without native CUDA/ROCm support, with an optional device index.
--preview-method autoEnables live step-by-step previews while sampling. Choices are none (default), auto, latent2rgb, or taesd for a higher-quality preview.
--output-directory PATHRedirects generated output elsewhere — handy for pointing multiple ComfyUI instances at one shared output folder.
--extra-model-paths-config PATHLoads one or more extra_model_paths.yaml files — the way to share one models folder across ComfyUI, Automatic1111, and other tools without duplicating multi-gigabyte checkpoints.
--disable-auto-launchDon't open a browser tab automatically on startup — useful when running headless on a server.
--disable-xformersTurns off the xformers memory-efficient attention optimization — a troubleshooting step if you suspect it's causing an artifact or crash.
--tls-keyfile / --tls-certfileServe over HTTPS instead of plain HTTP — worth doing the moment --listen exposes the UI beyond localhost.
--disable-api-nodesForces fully offline operation, disabling any node that calls out to a hosted API — for air-gapped or privacy-strict setups.

ComfyUI-Manager: install, update, and fix custom nodes without touching git

The vast majority of real-world workflows use at least one community custom node (IPAdapter, AnimateDiff, upscalers, and hundreds more). Manager turns "clone this repo into custom_nodes and hope the dependencies match" into a few clicks.

1

Enable it

python main.py --enable-manager
2

Fix red "missing node" errors

Load the workflow with red nodes first, open Manager, and click Install Missing Custom Nodes — it auto-detects everything the workflow needs and installs it in one pass. Restart ComfyUI afterward.

3

When a node isn't in the registry

Not every custom node is indexed by ComfyRegistry. Search GitHub directly for the exact node type name shown in the red node (e.g. IPAdapterApply) — most authors' repo names match.

When Manager itself misbehaves
  • Update ComfyUI core first. An outdated core causes a large share of "red node" errors that a plain update fixes with zero new installs.
  • Manager failing to fetch the node list ≠ ComfyUI being broken. If the app itself runs fine and only Manager can't reach the registry, treat it as a network/cache issue, not proof your whole install is bad.
  • Clear only the Manager cache if the node list looks stale or corrupted — this doesn't touch your workflows, models, or installed custom node folders.
--lowvram vs --novram vs --highvram — pick one
These VRAM-mode flags are mutually exclusive. Start with nothing (dynamic management handles most cards fine); if you hit out-of-memory errors, try --lowvram, then --novram if that's still not enough. --highvram is for the opposite problem — plenty of VRAM, want to skip the unload/reload overhead between runs.
Apple Silicon works, with caveats
Requires PyTorch's nightly MPS backend, not the stable release — follow Apple's own PyTorch guide before running pip install -r requirements.txt. Generation is slower than an equivalent NVIDIA card and some custom nodes assume CUDA and simply won't load.
A workflow JSON can embed the actual image
ComfyUI writes the full workflow graph into the PNG metadata of every output image by default. Drag that PNG back into ComfyUI and the exact workflow that produced it loads — the standard way workflows get shared online, and worth knowing before you share an output image publicly if you don't want the workflow visible too.
Checkpoints are large — plan disk space up front
SDXL-class checkpoints run 2–7 GB each, FLUX models larger still. A models folder with a handful of checkpoints, a few LoRAs, and a ControlNet or two adds up to tens of gigabytes quickly.
--extra-model-paths-config avoids duplicate downloads
If you also run Automatic1111 or Forge, point ComfyUI's config at that install's existing models folder instead of re-downloading every checkpoint a second time.
Core generation works fully offline
Once models are downloaded, nothing about running a workflow requires internet. Use --disable-api-nodes to guarantee no node calls out, useful for air-gapped machines or strict privacy requirements.