ComfyUI Troubleshooting Guide

Common ComfyUI errors and fixes.

How to install

How to install

  1. Setup differs for this server — follow the Installation part of the README below.
  2. Claude Code: claude mcp add <name> -- <command>.
  3. Claude Desktop / Cursor: add it under mcpServers in the MCP config file.
Claude Code — installs the whole folder, not just SKILL.md
npx degit artokun/comfyui-mcp/plugin/skills/troubleshooting#main ~/.claude/skills/troubleshooting

For one project only, change the path to .claude/skills/troubleshooting. This skill also uses extra_model_paths.yaml, cli_args.py — copying SKILL.md alone won't be enough. See the folder on GitHub.

This one runs on your machine and can reach your files. Read the README below before you connect it.

Not working?
  • Check which app you pasted it into — the steps above name the right one.
  • Some skills need the paid tier of Claude or ChatGPT.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Show the full text500 lines
troubleshooting/SKILL.md500 lines17.8 KBpushed 27d agoRawView on GitHub

ComfyUI Troubleshooting Guide

Render completes but looks WRONG (artifacts, wrong subject/pose/color, a ControlNet/mask/LoRA not taking, a refiner degrading it)? That's not an error. Use the debug-render skill (list_packs with action: "skill_read", name: "debug-render") to localize the bad stage with run-to-node (panel_run to_node_id) by previewing intermediate steps. This guide is for runs that fail with an error, OOM, or missing node.

Error Diagnosis Strategy

When a workflow fails, follow this approach:

  1. Get the error. Use get_history(action="diagnose") to retrieve the execution result with the full traceback, plus any missing models/nodes
  2. Check logs. Use get_system_stats (action:"logs") with keyword filters like "error", "warning", "traceback"
  3. Identify the failing node. The history response includes the node_id and node_type that failed
  4. Cross-reference inputs. Use create_workflow (action:"node_info") to verify the failing node's expected input schema
  5. Check models. Use list_local_models to verify all referenced model files exist

Out of Memory (OOM)

Error Pattern

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate X MiB.
GPU 0 has a total capacity of 24.00 GiB of which X MiB is free.

Or:

RuntimeError: CUDA error: out of memory

Root Cause

The GPU does not have enough VRAM to hold the model weights, intermediate tensors, and latent images at the same time. Common triggers:

  • High resolution images (2048x2048+)
  • Multiple models loaded at the same time
  • FP32 precision models on limited VRAM
  • Video generation (LTXV, AnimateDiff) with many frames
  • Large batch sizes

Fixes (in order of preference)

  1. Reduce resolution. Drop to the model's native resolution (512 for SD 1.5, 1024 for SDXL/Flux)
  2. Use FP8/FP16 quantized models. FP8 Flux models use ~8GB vs ~24GB for FP16
    • Search for FP8 variants: download_model({ action: "search", query: "flux fp8" }) or the same with "sdxl fp8"
  3. Launch flags (the VRAM ladder). Offload via ComfyUI CLI flags:
    • --lowvram offloads text encoders / model parts to CPU
    • --novram is extreme offload, the go-to for long video (LTX 2 / WAN) OOM
    • --cache-none caches nothing (lowest RAM/VRAM); combine with --novram
    • --reserve-vram N reserves N GB so the GPU stops spilling into slow shared VRAM (Windows); typical 2 to 4
    • --disable-smart-memory forces offload to RAM when a run gets stuck or OOMs intermittently
    • Full matrix and recipes: comfyui-launch-flags
  4. Free VRAM between generations. ComfyUI should auto-manage, but restarting clears leaked memory
  5. Use tiled VAE decoding. For high-resolution images, tile the VAE decode step
    • Node: VAEDecodeTiled instead of VAEDecode
    • Breaks the image into tiles, decodes each separately, and stitches them together
  6. Reduce batch size. Set batch_size to 1 in EmptyLatentImage
  7. Avoid multiple models. Don't load two full checkpoints at the same time; use one checkpoint and LoRAs instead
  8. For LTXV/video: always use FP8 quantized video models on 24GB cards

VRAM Estimates

Model FP32 FP16 FP8
SD 1.5 ~4GB ~2GB ~1GB
SDXL ~12GB ~6GB ~3GB
Flux Dev ~48GB ~24GB ~12GB
Flux Schnell ~48GB ~24GB ~12GB
LTXV ~20GB+ ~10GB+ ~6GB

Launch Flags — VRAM / Cache / Attention / Precision

ComfyUI's startup flags tune the speed↔VRAM tradeoff. Match them to the detected GPU (the panel orchestrator reports VRAM/GPU/torch/sage in its env block; pick the tier from there). Set them on the process that launches ComfyUI (or the --panel-orchestrator / connect command's ComfyUI, not the agent).

VRAM mode (pick ONE by card size)

Flag Card Behavior
--gpu-only 16GB+ Everything (CLIP/VAE/UNet) stays on GPU — fastest, max VRAM
--highvram 12–16GB Models stay resident in GPU after use, no CPU offload
--normalvram 8–12GB Default balance — unload to CPU RAM when idle
--lowvram 6–8GB Split the UNet, aggressive CPU offload — slower
--novram 4–6GB Extreme split/offload — for OOM even on lowvram, or long videos
--cpu <4GB / no GPU CPU only (very slow)

--reserve-vram N (GB) leaves headroom for the OS and other apps. Bump it if you OOM intermittently mid-run (VAE decode / audio round-trips spike).

Cache (RAM vs re-run speed)

Flag Effect
--cache-classic Default aggressive caching (fastest re-runs, most RAM)
--cache-lru N Keep the last N node results (bounded RAM)
--cache-ram N Cap cache to N GB of headroom
--cache-none No caching — minimal RAM, re-runs every node

Attention (speed vs compatibility)

Flag Notes
--use-sage-attention Recommended — fast + efficient (needs SageAttention + Triton; see triton-sageattention)
--use-flash-attention Very fast on supported GPUs
--use-pytorch-cross-attention PyTorch 2.x native — best compatibility
--use-split-cross-attention Lower VRAM, slower
--use-quad-cross-attention Sub-quadratic optimization
(omit) Auto-selects xFormers if available

Precision (UNet)

Flag Effect
--fp16-unet Half precision, ~50% VRAM
--bf16-unet BFloat16, good balance (newer GPUs)
--fp8_e4m3fn-unet 8-bit float, max savings (newest GPUs)

Typical recipes:

  • RTX 4090/5090 (24 to 32GB): --gpu-only --use-sage-attention --cache-classic
  • 12 to 16GB: --highvram --use-sage-attention (or --fp8_e4m3fn-unet for big models)
  • 8GB: --normalvram --use-sage-attention --cache-lru 20
  • 6GB: --lowvram --use-split-cross-attention --cache-none
  • OOM on long video: --novram --reserve-vram 2

Device Mismatch

Error Pattern

RuntimeError: Expected all tensors to be on the same device, but found at least
two devices, cuda:0 and cpu!

Root Cause

A tensor on the CPU is combined with a tensor on the GPU. This usually happens when:

  • A custom node doesn't move tensors to the correct device
  • Model offloading placed parts of the model on CPU
  • A node produces CPU tensors while downstream expects GPU tensors

Fixes

  1. Check if the error occurs with a specific custom node. Update or replace that node
  2. If using --lowvram or --cpu, some nodes may not support CPU offloading
  3. Restart ComfyUI to reset device state
  4. Check if a custom node has a newer version that fixes device handling

Missing Nodes

Error Pattern

Cannot find node class 'NodeClassName'

Or in the execution response:

"error": {"type": "node_not_found", "message": "Cannot find node class 'X'"}

Root Cause

The workflow references a node type that is not installed. This happens when:

  • A custom node pack is not installed
  • A custom node pack is installed but failed to load (import error)
  • The node was renamed or removed in a pack update

Fixes

  1. Search for the node pack:
    search_custom_nodes(action="search", query="NodeClassName")
    
  2. Install via ComfyUI Manager or the registry
  3. Check logs for import errors:
    get_system_stats (action:"logs")(keyword="import")
    get_system_stats (action:"logs")(keyword="error")
    
    Import errors often reveal missing Python dependencies
  4. Install missing Python dependencies. If the custom node requires a pip package:
    pip install missing-package
    
  5. Restart ComfyUI after installing any custom node. Nodes are loaded at startup

NaN Tensor Errors

Error Pattern

RuntimeError: Input contains NaN

Or images come out as solid gray/noise with NaN warnings in logs.

Root Cause

Numerical instability during the diffusion process. Common triggers:

  • CFG scale too high. Values above 15-20 can cause numerical overflow
  • Corrupted model weights. Damaged download or incompatible merge
  • FP16 overflow. Some operations overflow at half precision
  • Incompatible LoRA. A LoRA trained for a different base model

Fixes

  1. Lower CFG. Try CFG 7.0 for SD 1.5/SDXL, 1.0 for Flux
  2. Use FP32 VAE. Some VAEs produce NaN in FP16. Switch to vae-ft-mse-840000-ema-pruned.safetensors (FP32)
  3. Remove LoRAs. Test without LoRAs to isolate the cause
  4. Re-download the model. Hash verification can detect corrupted files
  5. Check LoRA compatibility. The LoRA must match the base model family

Dtype Mismatches

Error Pattern

RuntimeError: expected scalar type Float but found Half

Or:

RuntimeError: expected scalar type Half but found Float

Or:

RuntimeError: Input type (float) and bias type (c10::Half) should be the same

Root Cause

A model component expects one precision (FP32/FP16) but receives another. Most common with:

  • VAE precision mismatch (FP16 model + FP32 VAE or vice versa)
  • Mixed-precision LoRAs
  • Custom nodes that force a specific dtype

Fixes

  1. Use a separate VAE. Load an explicit FP32 VAE instead of the checkpoint's built-in VAE
    • Node: VAELoader with vae-ft-mse-840000-ema-pruned.safetensors
  2. Match precision. If the model is FP16, use FP16-compatible nodes throughout
  3. Force FP32 VAE decode. Some node packs offer VAEDecodeFP32 nodes
  4. Check ComfyUI settings. The --force-fp32 flag forces everything to FP32 (uses more VRAM)

CLIP Token Overflow

Error Pattern

No explicit error. The prompt is truncated at 77 tokens without warning, and details mentioned late in the prompt are ignored.

Symptoms

  • Later parts of long prompts have no effect on the image
  • Adding more descriptive text doesn't change the output
  • Removing early tokens suddenly makes later tokens work

Fixes

  1. Use a BREAK token. Split the prompt at natural boundaries:
    subject description, pose, clothing, setting
    BREAK
    lighting, style, quality, camera angle
    
  2. Use CLIPTextEncodeSDXL. SDXL's dual-CLIP processes two 77-token chunks
  3. Prioritize important tokens. Put the most important descriptors first
  4. Use fewer filler words. Remove articles and prepositions where possible
  5. Use embeddings. Condense complex concepts into single tokens with textual inversions

Black Images

Error Pattern

No error in the execution. The workflow "succeeds" but produces completely black or near-black images.

Root Causes and Fixes

Cause Diagnosis Fix
denoise = 0 Check KSampler inputs Set denoise to 1.0 for txt2img, 0.5-0.8 for img2img
cfg = 0 Check KSampler inputs Set CFG to 7.0 (SD 1.5), 1.0 (Flux)
steps = 0 Check KSampler inputs Set steps to 20+ (standard) or 4+ (turbo)
Wrong VAE VAE doesn't match model Use the correct VAE for the model family
Empty prompt CLIPTextEncode has empty text Add a text prompt
Wrong scheduler Incompatible scheduler/sampler combo Try "normal" scheduler with "euler" sampler
Seed collision Extremely rare Change the seed value
FP16 VAE overflow VAE decode produces black Use FP32 VAE or VAEDecodeTiled

Quick Diagnostic Checklist

  1. Check denoise > 0 (should be 1.0 for txt2img)
  2. Check cfg > 0 (should be 7.0 for SD 1.5, 1.0 for Flux)
  3. Check steps > 0 (should be 20 for standard, 4 for turbo)
  4. Verify the positive prompt is not empty
  5. Try a different seed
  6. Try a known-working sampler/scheduler combo: euler + normal

Connection Type Errors

Error Pattern

Output type 'IMAGE' doesn't match input type 'LATENT'

Or:

Required input 'model' of type 'MODEL' but got connection of type 'CLIP'

Root Cause

Connecting the wrong output slot of a node to an incompatible input. Often caused by using the wrong output index.

Fixes

  1. Check output indices. Use create_workflow (action:"node_info") to verify the exact output order
    • CheckpointLoaderSimple outputs: 0=MODEL, 1=CLIP, 2=VAE
    • Getting index wrong: ["1", 0] gives MODEL, ["1", 1] gives CLIP
  2. Verify connection format. ["nodeId", outputIndex], where node ID is a string and index is an integer
  3. Check data type flow. The pipeline must follow the correct type chain:
    MODEL → KSampler
    CLIP → CLIPTextEncode → CONDITIONING → KSampler
    LATENT → KSampler → LATENT → VAEDecode → IMAGE
    VAE → VAEDecode, VAEEncode
    

Model Loading Errors

Error Pattern

FileNotFoundError: [Errno 2] No such file or directory: 'models/checkpoints/model.safetensors'

Or:

SafetensorError: Error reading file: invalid header

Or:

RuntimeError: PytorchStreamReader failed reading zip archive

Root Causes

  • File not found. Model file doesn't exist at the referenced path
  • Corrupted download. Incomplete or damaged file
  • Wrong format. File is not a valid safetensors/pickle/checkpoint format

Fixes

  1. Verify the model exists: list_local_models({ action: "list", model_type: "checkpoints" })
  2. Check the exact filename. Model names in workflows must match the filename exactly (case-sensitive)
  3. Re-download. If hash mismatch or corruption:
    download_model({ action: "download", url: "...", target_subfolder: "checkpoints" })
    
  4. Check file size. A 1KB safetensors file is corrupted; re-download
  5. Verify subfolder. Models must be in the correct subfolder (checkpoints/, loras/, vae/, etc.)

Torch / CUDA Version Errors

Error Pattern

RuntimeError: CUDA error: no kernel image is available for execution on the device

Or:

ImportError: cannot import name 'xxx' from 'torch'

Or:

AssertionError: Torch not compiled with CUDA enabled

Root Cause

PyTorch and CUDA version incompatibility, usually after:

  • Updating PyTorch without matching CUDA toolkit
  • Installing a custom node that downgrades/changes PyTorch
  • Using pip install that pulls a CPU-only PyTorch

Fixes

  1. Check current versions:
    get_system_stats()  # Shows PyTorch version and CUDA version
    
  2. Verify CUDA availability. In Python: torch.cuda.is_available()
  3. Reinstall PyTorch with CUDA. Visit pytorch.org for the correct install command matching your CUDA version
  4. Pin PyTorch version. After fixing, avoid running pip install commands that might change PyTorch
  5. Use ComfyUI's bundled venv. ComfyUI Desktop ships with a pre-configured Python environment

ComfyUI Desktop vs CLI Differences

Key Differences

Aspect ComfyUI Desktop ComfyUI CLI
Default port 8000 8188
Python Embedded (bundled) System/venv Python
Install location AppData/Local/Programs/ComfyUI/ Wherever you cloned it
Custom nodes Documents/ComfyUI/custom_nodes/ ./custom_nodes/ in repo
Models Documents/ComfyUI/models/ ./models/ in repo
Config extra_model_paths.yaml for shared paths Same
Updates Auto-updater in the app git pull

Common Issues

  • Wrong port. MCP tools default to 8188; if using Desktop, configure for port 8000
  • Path confusion. Desktop separates user data from application files
  • Custom node pip installs. Desktop's embedded Python may not be on PATH; install within the venv

Error-Specific Debugging Commands

Workflow Failed — Get Details

get_history(action="list")                       # Most recent execution
get_history(action="list", prompt_id="abc-123")  # Specific execution
get_history(action="diagnose")                   # Why the last run failed

The response includes:

  • status.status_str: "success" or "error"
  • status.messages: Timestamped execution messages
  • outputs: Node outputs (images, etc.)
  • Error traceback for failed nodes

Check Server Health

get_system_stats()    # GPU info, VRAM, Python/PyTorch versions
queue(action="list")  # Running and pending jobs
get_system_stats (action:"logs")(max_lines=50, keyword="error")  # Recent error logs

Verify Node Availability

create_workflow(action="node_info", node_type="KSampler")        # Check specific node
create_workflow(action="node_info", node_type="ControlNetApply")  # Verify custom nodes loaded

Verify Models

list_local_models({ action: "list", model_type: "checkpoints" })   # Installed checkpoints
list_local_models({ action: "list", model_type: "loras" })         # Installed LoRAs
list_local_models({ action: "list", model_type: "controlnet" })    # Installed ControlNets

Quick Reference: Error to Fix

Error Message (partial) Most Likely Fix
CUDA out of memory Reduce resolution, use FP8 model; VRAM ladder --lowvram--novram --cache-none--reserve-vram N (launch flags)
Expected all tensors on same device Update custom node, restart ComfyUI
Cannot find node class Install the node pack, restart ComfyUI
Input contains NaN Lower CFG, use FP32 VAE, remove LoRAs
expected scalar type Float but found Half Use FP32 VAE, or --force-fp32
No such file or directory (model) Check filename, re-download model
invalid header (safetensors) Re-download — file is corrupted
CUDA error: no kernel image Reinstall PyTorch with matching CUDA version
Black images, no error Check denoise > 0, cfg > 0, steps > 0, prompt not empty
Image looks garbled/noisy Wrong model+VAE combo, wrong sampler settings
Connection refused on port 8188 ComfyUI not running, or using Desktop (port 8000)
Prompt outputs failed validation Node inputs don't match schema — check create_workflow (action:"node_info")

Sources

  • Official: none found as a vendor error catalog. Launch-flag names cross-check against comfyui-launch-flags (upstream cli_args.py).
  • Empirical: error→fix table from observed ComfyUI failures.
1---
2name: troubleshooting
3description: Common ComfyUI errors and fixes. OOM, missing nodes, dtype mismatches, black images, and debugging strategies
4globs:
5 - "**/*.json"
6---
7 
8# ComfyUI Troubleshooting Guide
9 
10> Render completes but looks WRONG (artifacts, wrong subject/pose/color, a
11> ControlNet/mask/LoRA not taking, a refiner degrading it)? That's not an error.
12> Use the debug-render skill (`list_packs` with `action: "skill_read"`,
13> `name: "debug-render"`) to localize the bad stage with run-to-node
14> (`panel_run` `to_node_id`) by previewing intermediate steps. This guide is for
15> runs that fail with an error, OOM, or missing node.
16 
17## Error Diagnosis Strategy
18 
19When a workflow fails, follow this approach:
20 
211. Get the error. Use `get_history(action="diagnose")` to retrieve the execution result with the full traceback, plus any missing models/nodes
222. Check logs. Use `get_system_stats (action:"logs")` with keyword filters like `"error"`, `"warning"`, `"traceback"`
233. Identify the failing node. The history response includes the `node_id` and `node_type` that failed
244. Cross-reference inputs. Use `create_workflow (action:"node_info")` to verify the failing node's expected input schema
255. Check models. Use `list_local_models` to verify all referenced model files exist
26 
27## Out of Memory (OOM)
28 
29### Error Pattern
30 
31```
32torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate X MiB.
33GPU 0 has a total capacity of 24.00 GiB of which X MiB is free.
34```
35 
36Or:
37 
38```
39RuntimeError: CUDA error: out of memory
40```
41 
42### Root Cause
43 
44The GPU does not have enough VRAM to hold the model weights, intermediate tensors, and latent images at the same time. Common triggers:
45- High resolution images (2048x2048+)
46- Multiple models loaded at the same time
47- FP32 precision models on limited VRAM
48- Video generation (LTXV, AnimateDiff) with many frames
49- Large batch sizes
50 
51### Fixes (in order of preference)
52 
531. Reduce resolution. Drop to the model's native resolution (512 for SD 1.5, 1024 for SDXL/Flux)
542. Use FP8/FP16 quantized models. FP8 Flux models use ~8GB vs ~24GB for FP16
55 - Search for FP8 variants: `download_model({ action: "search", query: "flux fp8" })` or the same with `"sdxl fp8"`
563. Launch flags (the VRAM ladder). Offload via ComfyUI CLI flags:
57 - `--lowvram` offloads text encoders / model parts to CPU
58 - `--novram` is extreme offload, the go-to for long video (LTX 2 / WAN) OOM
59 - `--cache-none` caches nothing (lowest RAM/VRAM); combine with `--novram`
60 - `--reserve-vram N` reserves N GB so the GPU stops spilling into slow shared VRAM (Windows); typical `2` to `4`
61 - `--disable-smart-memory` forces offload to RAM when a run gets stuck or OOMs intermittently
62 - Full matrix and recipes: [`comfyui-launch-flags`](../comfyui-launch-flags/SKILL.md)
634. Free VRAM between generations. ComfyUI should auto-manage, but restarting clears leaked memory
645. Use tiled VAE decoding. For high-resolution images, tile the VAE decode step
65 - Node: `VAEDecodeTiled` instead of `VAEDecode`
66 - Breaks the image into tiles, decodes each separately, and stitches them together
676. Reduce batch size. Set batch_size to 1 in `EmptyLatentImage`
687. Avoid multiple models. Don't load two full checkpoints at the same time; use one checkpoint and LoRAs instead
698. For LTXV/video: always use FP8 quantized video models on 24GB cards
70 
71### VRAM Estimates
72 
73| Model | FP32 | FP16 | FP8 |
74|-------|------|------|-----|
75| SD 1.5 | ~4GB | ~2GB | ~1GB |
76| SDXL | ~12GB | ~6GB | ~3GB |
77| Flux Dev | ~48GB | ~24GB | ~12GB |
78| Flux Schnell | ~48GB | ~24GB | ~12GB |
79| LTXV | ~20GB+ | ~10GB+ | ~6GB |
80 
81## Launch Flags — VRAM / Cache / Attention / Precision
82 
83ComfyUI's startup flags tune the speed↔VRAM tradeoff. Match them to the detected
84GPU (the panel orchestrator reports VRAM/GPU/torch/sage in its env block; pick the
85tier from there). Set them on the process that launches ComfyUI (or the
86`--panel-orchestrator` / `connect` command's ComfyUI, not the agent).
87 
88### VRAM mode (pick ONE by card size)
89 
90| Flag | Card | Behavior |
91|------|------|----------|
92| `--gpu-only` | 16GB+ | Everything (CLIP/VAE/UNet) stays on GPU — fastest, max VRAM |
93| `--highvram` | 12–16GB | Models stay resident in GPU after use, no CPU offload |
94| `--normalvram` | 8–12GB | Default balance — unload to CPU RAM when idle |
95| `--lowvram` | 6–8GB | Split the UNet, aggressive CPU offload — slower |
96| `--novram` | 4–6GB | Extreme split/offload — for OOM even on lowvram, or long videos |
97| `--cpu` | <4GB / no GPU | CPU only (very slow) |
98 
99`--reserve-vram N` (GB) leaves headroom for the OS and other apps. Bump it if you
100OOM intermittently mid-run (VAE decode / audio round-trips spike).
101 
102### Cache (RAM vs re-run speed)
103 
104| Flag | Effect |
105|------|--------|
106| `--cache-classic` | Default aggressive caching (fastest re-runs, most RAM) |
107| `--cache-lru N` | Keep the last N node results (bounded RAM) |
108| `--cache-ram N` | Cap cache to N GB of headroom |
109| `--cache-none` | No caching — minimal RAM, re-runs every node |
110 
111### Attention (speed vs compatibility)
112 
113| Flag | Notes |
114|------|-------|
115| `--use-sage-attention` | **Recommended** — fast + efficient (needs SageAttention + Triton; see `triton-sageattention`) |
116| `--use-flash-attention` | Very fast on supported GPUs |
117| `--use-pytorch-cross-attention` | PyTorch 2.x native — best compatibility |
118| `--use-split-cross-attention` | Lower VRAM, slower |
119| `--use-quad-cross-attention` | Sub-quadratic optimization |
120| (omit) | Auto-selects xFormers if available |
121 
122### Precision (UNet)
123 
124| Flag | Effect |
125|------|--------|
126| `--fp16-unet` | Half precision, ~50% VRAM |
127| `--bf16-unet` | BFloat16, good balance (newer GPUs) |
128| `--fp8_e4m3fn-unet` | 8-bit float, max savings (newest GPUs) |
129 
130Typical recipes:
131- RTX 4090/5090 (24 to 32GB): `--gpu-only --use-sage-attention --cache-classic`
132- 12 to 16GB: `--highvram --use-sage-attention` (or `--fp8_e4m3fn-unet` for big models)
133- 8GB: `--normalvram --use-sage-attention --cache-lru 20`
134- 6GB: `--lowvram --use-split-cross-attention --cache-none`
135- OOM on long video: `--novram --reserve-vram 2`
136 
137## Device Mismatch
138 
139### Error Pattern
140 
141```
142RuntimeError: Expected all tensors to be on the same device, but found at least
143two devices, cuda:0 and cpu!
144```
145 
146### Root Cause
147 
148A tensor on the CPU is combined with a tensor on the GPU. This usually happens when:
149- A custom node doesn't move tensors to the correct device
150- Model offloading placed parts of the model on CPU
151- A node produces CPU tensors while downstream expects GPU tensors
152 
153### Fixes
154 
1551. Check if the error occurs with a specific custom node. Update or replace that node
1562. If using `--lowvram` or `--cpu`, some nodes may not support CPU offloading
1573. Restart ComfyUI to reset device state
1584. Check if a custom node has a newer version that fixes device handling
159 
160## Missing Nodes
161 
162### Error Pattern
163 
164```
165Cannot find node class 'NodeClassName'
166```
167 
168Or in the execution response:
169```
170"error": {"type": "node_not_found", "message": "Cannot find node class 'X'"}
171```
172 
173### Root Cause
174 
175The workflow references a node type that is not installed. This happens when:
176- A custom node pack is not installed
177- A custom node pack is installed but failed to load (import error)
178- The node was renamed or removed in a pack update
179 
180### Fixes
181 
1821. Search for the node pack:
183 ```
184 search_custom_nodes(action="search", query="NodeClassName")
185 ```
1862. Install via ComfyUI Manager or the registry
1873. Check logs for import errors:
188 ```
189 get_system_stats (action:"logs")(keyword="import")
190 get_system_stats (action:"logs")(keyword="error")
191 ```
192 Import errors often reveal missing Python dependencies
1934. Install missing Python dependencies. If the custom node requires a pip package:
194 ```bash
195 pip install missing-package
196 ```
1975. Restart ComfyUI after installing any custom node. Nodes are loaded at startup
198 
199## NaN Tensor Errors
200 
201### Error Pattern
202 
203```
204RuntimeError: Input contains NaN
205```
206 
207Or images come out as solid gray/noise with NaN warnings in logs.
208 
209### Root Cause
210 
211Numerical instability during the diffusion process. Common triggers:
212- CFG scale too high. Values above 15-20 can cause numerical overflow
213- Corrupted model weights. Damaged download or incompatible merge
214- FP16 overflow. Some operations overflow at half precision
215- Incompatible LoRA. A LoRA trained for a different base model
216 
217### Fixes
218 
2191. Lower CFG. Try CFG 7.0 for SD 1.5/SDXL, 1.0 for Flux
2202. Use FP32 VAE. Some VAEs produce NaN in FP16. Switch to `vae-ft-mse-840000-ema-pruned.safetensors` (FP32)
2213. Remove LoRAs. Test without LoRAs to isolate the cause
2224. Re-download the model. Hash verification can detect corrupted files
2235. Check LoRA compatibility. The LoRA must match the base model family
224 
225## Dtype Mismatches
226 
227### Error Pattern
228 
229```
230RuntimeError: expected scalar type Float but found Half
231```
232 
233Or:
234 
235```
236RuntimeError: expected scalar type Half but found Float
237```
238 
239Or:
240 
241```
242RuntimeError: Input type (float) and bias type (c10::Half) should be the same
243```
244 
245### Root Cause
246 
247A model component expects one precision (FP32/FP16) but receives another. Most common with:
248- VAE precision mismatch (FP16 model + FP32 VAE or vice versa)
249- Mixed-precision LoRAs
250- Custom nodes that force a specific dtype
251 
252### Fixes
253 
2541. Use a separate VAE. Load an explicit FP32 VAE instead of the checkpoint's built-in VAE
255 - Node: `VAELoader` with `vae-ft-mse-840000-ema-pruned.safetensors`
2562. Match precision. If the model is FP16, use FP16-compatible nodes throughout
2573. Force FP32 VAE decode. Some node packs offer `VAEDecodeFP32` nodes
2584. Check ComfyUI settings. The `--force-fp32` flag forces everything to FP32 (uses more VRAM)
259 
260## CLIP Token Overflow
261 
262### Error Pattern
263 
264No explicit error. The prompt is truncated at 77 tokens without warning, and details mentioned late in the prompt are ignored.
265 
266### Symptoms
267 
268- Later parts of long prompts have no effect on the image
269- Adding more descriptive text doesn't change the output
270- Removing early tokens suddenly makes later tokens work
271 
272### Fixes
273 
2741. Use a BREAK token. Split the prompt at natural boundaries:
275 ```
276 subject description, pose, clothing, setting
277 BREAK
278 lighting, style, quality, camera angle
279 ```
2802. Use CLIPTextEncodeSDXL. SDXL's dual-CLIP processes two 77-token chunks
2813. Prioritize important tokens. Put the most important descriptors first
2824. Use fewer filler words. Remove articles and prepositions where possible
2835. Use embeddings. Condense complex concepts into single tokens with textual inversions
284 
285## Black Images
286 
287### Error Pattern
288 
289No error in the execution. The workflow "succeeds" but produces completely black or near-black images.
290 
291### Root Causes and Fixes
292 
293| Cause | Diagnosis | Fix |
294|-------|-----------|-----|
295| `denoise = 0` | Check KSampler inputs | Set denoise to 1.0 for txt2img, 0.5-0.8 for img2img |
296| `cfg = 0` | Check KSampler inputs | Set CFG to 7.0 (SD 1.5), 1.0 (Flux) |
297| `steps = 0` | Check KSampler inputs | Set steps to 20+ (standard) or 4+ (turbo) |
298| Wrong VAE | VAE doesn't match model | Use the correct VAE for the model family |
299| Empty prompt | CLIPTextEncode has empty text | Add a text prompt |
300| Wrong scheduler | Incompatible scheduler/sampler combo | Try `"normal"` scheduler with `"euler"` sampler |
301| Seed collision | Extremely rare | Change the seed value |
302| FP16 VAE overflow | VAE decode produces black | Use FP32 VAE or VAEDecodeTiled |
303 
304### Quick Diagnostic Checklist
305 
3061. Check `denoise` > 0 (should be 1.0 for txt2img)
3072. Check `cfg` > 0 (should be 7.0 for SD 1.5, 1.0 for Flux)
3083. Check `steps` > 0 (should be 20 for standard, 4 for turbo)
3094. Verify the positive prompt is not empty
3105. Try a different seed
3116. Try a known-working sampler/scheduler combo: `euler` + `normal`
312 
313## Connection Type Errors
314 
315### Error Pattern
316 
317```
318Output type 'IMAGE' doesn't match input type 'LATENT'
319```
320 
321Or:
322 
323```
324Required input 'model' of type 'MODEL' but got connection of type 'CLIP'
325```
326 
327### Root Cause
328 
329Connecting the wrong output slot of a node to an incompatible input. Often caused by using the wrong output index.
330 
331### Fixes
332 
3331. Check output indices. Use `create_workflow (action:"node_info")` to verify the exact output order
334 - `CheckpointLoaderSimple` outputs: 0=MODEL, 1=CLIP, 2=VAE
335 - Getting index wrong: `["1", 0]` gives MODEL, `["1", 1]` gives CLIP
3362. Verify connection format. `["nodeId", outputIndex]`, where node ID is a string and index is an integer
3373. Check data type flow. The pipeline must follow the correct type chain:
338 ```
339 MODEL → KSampler
340 CLIP → CLIPTextEncode → CONDITIONING → KSampler
341 LATENT → KSampler → LATENT → VAEDecode → IMAGE
342 VAE → VAEDecode, VAEEncode
343 ```
344 
345## Model Loading Errors
346 
347### Error Pattern
348 
349```
350FileNotFoundError: [Errno 2] No such file or directory: 'models/checkpoints/model.safetensors'
351```
352 
353Or:
354 
355```
356SafetensorError: Error reading file: invalid header
357```
358 
359Or:
360 
361```
362RuntimeError: PytorchStreamReader failed reading zip archive
363```
364 
365### Root Causes
366 
367- File not found. Model file doesn't exist at the referenced path
368- Corrupted download. Incomplete or damaged file
369- Wrong format. File is not a valid safetensors/pickle/checkpoint format
370 
371### Fixes
372 
3731. Verify the model exists: `list_local_models({ action: "list", model_type: "checkpoints" })`
3742. Check the exact filename. Model names in workflows must match the filename exactly (case-sensitive)
3753. Re-download. If hash mismatch or corruption:
376 ```
377 download_model({ action: "download", url: "...", target_subfolder: "checkpoints" })
378 ```
3794. Check file size. A 1KB safetensors file is corrupted; re-download
3805. Verify subfolder. Models must be in the correct subfolder (`checkpoints/`, `loras/`, `vae/`, etc.)
381 
382## Torch / CUDA Version Errors
383 
384### Error Pattern
385 
386```
387RuntimeError: CUDA error: no kernel image is available for execution on the device
388```
389 
390Or:
391 
392```
393ImportError: cannot import name 'xxx' from 'torch'
394```
395 
396Or:
397 
398```
399AssertionError: Torch not compiled with CUDA enabled
400```
401 
402### Root Cause
403 
404PyTorch and CUDA version incompatibility, usually after:
405- Updating PyTorch without matching CUDA toolkit
406- Installing a custom node that downgrades/changes PyTorch
407- Using pip install that pulls a CPU-only PyTorch
408 
409### Fixes
410 
4111. Check current versions:
412 ```
413 get_system_stats() # Shows PyTorch version and CUDA version
414 ```
4152. Verify CUDA availability. In Python: `torch.cuda.is_available()`
4163. Reinstall PyTorch with CUDA. Visit pytorch.org for the correct install command matching your CUDA version
4174. Pin PyTorch version. After fixing, avoid running `pip install` commands that might change PyTorch
4185. Use ComfyUI's bundled venv. ComfyUI Desktop ships with a pre-configured Python environment
419 
420## ComfyUI Desktop vs CLI Differences
421 
422### Key Differences
423 
424| Aspect | ComfyUI Desktop | ComfyUI CLI |
425|--------|----------------|-------------|
426| Default port | 8000 | 8188 |
427| Python | Embedded (bundled) | System/venv Python |
428| Install location | `AppData/Local/Programs/ComfyUI/` | Wherever you cloned it |
429| Custom nodes | `Documents/ComfyUI/custom_nodes/` | `./custom_nodes/` in repo |
430| Models | `Documents/ComfyUI/models/` | `./models/` in repo |
431| Config | `extra_model_paths.yaml` for shared paths | Same |
432| Updates | Auto-updater in the app | `git pull` |
433 
434### Common Issues
435 
436- Wrong port. MCP tools default to 8188; if using Desktop, configure for port 8000
437- Path confusion. Desktop separates user data from application files
438- Custom node pip installs. Desktop's embedded Python may not be on PATH; install within the venv
439 
440## Error-Specific Debugging Commands
441 
442### Workflow Failed — Get Details
443 
444```
445get_history(action="list") # Most recent execution
446get_history(action="list", prompt_id="abc-123") # Specific execution
447get_history(action="diagnose") # Why the last run failed
448```
449 
450The response includes:
451- `status.status_str`: "success" or "error"
452- `status.messages`: Timestamped execution messages
453- `outputs`: Node outputs (images, etc.)
454- Error traceback for failed nodes
455 
456### Check Server Health
457 
458```
459get_system_stats() # GPU info, VRAM, Python/PyTorch versions
460queue(action="list") # Running and pending jobs
461get_system_stats (action:"logs")(max_lines=50, keyword="error") # Recent error logs
462```
463 
464### Verify Node Availability
465 
466```
467create_workflow(action="node_info", node_type="KSampler") # Check specific node
468create_workflow(action="node_info", node_type="ControlNetApply") # Verify custom nodes loaded
469```
470 
471### Verify Models
472 
473```
474list_local_models({ action: "list", model_type: "checkpoints" }) # Installed checkpoints
475list_local_models({ action: "list", model_type: "loras" }) # Installed LoRAs
476list_local_models({ action: "list", model_type: "controlnet" }) # Installed ControlNets
477```
478 
479## Quick Reference: Error to Fix
480 
481| Error Message (partial) | Most Likely Fix |
482|--------------------------|----------------|
483| `CUDA out of memory` | Reduce resolution, use FP8 model; VRAM ladder `--lowvram``--novram --cache-none``--reserve-vram N` ([launch flags](../comfyui-launch-flags/SKILL.md)) |
484| `Expected all tensors on same device` | Update custom node, restart ComfyUI |
485| `Cannot find node class` | Install the node pack, restart ComfyUI |
486| `Input contains NaN` | Lower CFG, use FP32 VAE, remove LoRAs |
487| `expected scalar type Float but found Half` | Use FP32 VAE, or `--force-fp32` |
488| `No such file or directory` (model) | Check filename, re-download model |
489| `invalid header` (safetensors) | Re-download — file is corrupted |
490| `CUDA error: no kernel image` | Reinstall PyTorch with matching CUDA version |
491| Black images, no error | Check denoise > 0, cfg > 0, steps > 0, prompt not empty |
492| Image looks garbled/noisy | Wrong model+VAE combo, wrong sampler settings |
493| `Connection refused` on port 8188 | ComfyUI not running, or using Desktop (port 8000) |
494| `Prompt outputs failed validation` | Node inputs don't match schema — check `create_workflow (action:"node_info")` |
495 
496## Sources
497 
498- **Official:** none found as a vendor error catalog. Launch-flag names cross-check against `comfyui-launch-flags` (upstream cli_args.py).
499- **Empirical:** error→fix table from observed ComfyUI failures.
500 

Discussion

Alternatives

Also in Illustration & art