Every ComfyUI user hits the same wall sooner or later: a red node, a wall of Python in the console, or an image that comes out black. The good news is that almost every ComfyUI error is one of about twenty known problems, and each has a known fix. This guide lists them all, with the exact error text you will see, what actually causes it and the steps that fix it. It also covers the launch flags that solve memory problems, how to read the console, and a clean-reinstall plan for when nothing else works. Use your browser’s find (Ctrl+F) with a word from your error, or jump from the index below.
- Red nodes on load: missing custom nodes. Use Manager, Install Missing Custom Nodes, then restart.
- “Value not in list”: the model file is missing or in the wrong folder.
- “CUDA out of memory”: lower the size, use fp8 or GGUF files, use VAE Decode (Tiled), or start with
--lowvram. - “mat1 and mat2” or “expected 4 channels, got 16”: mismatched text encoder, VAE, LoRA or ControlNet.
- “deserializing header”: broken download. Download the file again.
- Always read the first red traceback in the console; the last line of it names the real problem.
How to Read a ComfyUI Error
ComfyUI shows errors in two places: a pop-up in the browser and a full traceback in the console (the black window, or the terminal you started it from). The pop-up is a summary. The console has the detail.
- Find the node. The failing node is outlined in red in the graph. The pop-up names its type, such as KSampler or VAEDecode.
- Find the first traceback. In the console, scroll to the first block that starts with
Traceback (most recent call last)after you pressed Queue. - Read the last line of it. That line, such as
RuntimeError: mat1 and mat2 shapes cannot be multiplied, is the actual error. Search for it in this guide. - Check the startup log too. Many problems start at launch: look for
IMPORT FAILEDnext to custom node names and any red lines before “To see the GUI go to”.
When you ask for help on Reddit, GitHub or Discord, paste that last traceback line, your GPU, your ComfyUI version and the model file names. That gets you an answer far faster than a screenshot of the red node.
Error Index
Errors and Fixes
1. When loading the graph, the following node types were not found
Cause: You opened a workflow that uses custom nodes you have not installed.
Fix:
- Install ComfyUI Manager if you do not have it (it is built into current ComfyUI and Comfy Desktop).
- Open Manager and click Install Missing Custom Nodes.
- Install each pack it lists, then restart ComfyUI fully.
Manual install works too: cd ComfyUI/custom_nodes, then git clone <repo-url> and pip install -r <pack>/requirements.txt. If the node still shows red after restart, the pack failed to import. See IMPORT FAILED below.
2. Prompt outputs failed validation: Value not in list: ckpt_name / unet_name / lora_name
Cause: The workflow asks for a model file that is not in the folder the node reads, or has a different name or subfolder on your PC.
Fix:
- Click the dropdown on the red node and pick a file you have.
- If the list is empty, the file is in the wrong folder. Check our ComfyUI model folder cheat sheet.
- Press R to refresh the lists after adding files.
The same message for sampler_name or scheduler means the workflow was made in a newer ComfyUI. Update ComfyUI.
3. torch.OutOfMemoryError: CUDA out of memory. Tried to allocate X GiB
Cause: The model, the image size or the batch needs more VRAM than your GPU has free.
Fix:
- Lower the resolution or the batch size, or shorten the video length.
- Use a smaller file: fp8, int8 or a GGUF quant instead of bf16 (see our GGUF guide).
- Swap VAE Decode for the core VAE Decode (Tiled) node. Decoding is a common OOM point for large images and video.
- Start ComfyUI with
--lowvram, or--reserve-vram 1to keep some VRAM free for Windows. - Close browsers with many tabs, games and other GPU apps.
For video models specifically, see the MiniMax H3 out-of-memory fix.
4. ComfyUI shows “Reconnecting…” and the console just closes or ends
Cause: The Python process crashed, usually because system RAM (not VRAM) ran out while loading or offloading a big model.
Fix:
- Read the last lines of the console before it closes. Run from a terminal so it stays open.
- Increase the Windows page file (System, Advanced, Performance, Virtual memory) to 32 GB or more on a fast SSD.
- Use smaller model files so less has to sit in RAM.
- 32 GB of RAM is the practical minimum for 2026 image and video models; 64 GB is comfortable.
5. SafetensorError: Error while deserializing header: HeaderTooLarge / MetadataIncompleteBuffer / InvalidHeaderDeserialization
Cause: The model file is broken: an incomplete download, or an HTML page (login wall or error page) saved with a .safetensors name.
Fix:
- Compare the file size with the size on the download page.
- Delete it and download again. On Hugging Face, gated models need you to accept the licence and log in first.
- Use a download manager or
huggingface-cli downloadfor files over 10 GB.
6. mat1 and mat2 shapes cannot be multiplied (AxB and CxD)
Cause: Two parts that do not belong together are connected, most often the wrong text encoder for the model, the wrong CLIP type in the loader, or a LoRA or ControlNet made for a different base model.
Fix:
- Use the exact text encoder named on the model card, and set the
typein Load CLIP to the model family. - Check that every LoRA, ControlNet and IP-Adapter was made for this base model (SDXL parts do not work on FLUX, and so on).
- Start from the official template for the model (Workflow, Browse Templates) and change one thing at a time.
7. Given groups=1, weight of size […], expected input […] to have 4 channels, but got 16 channels
Cause: The VAE does not match the model. Newer models use 16-channel (or larger) latents, while SD 1.5 and SDXL VAEs expect 4.
Fix:
- Load the VAE named on the model card, for example
flux2-vae.safetensorsorqwen_image_vae.safetensorsinComfyUI/models/vae/. - Do not connect an SDXL VAE to a FLUX, Qwen or Krea model, or the other way round.
- For empty latents, use the latent node from the model’s own template; some models need their own latent node.
8. Error(s) in loading state_dict: size mismatch for …
Cause: The file was loaded with the wrong loader or for the wrong architecture.
Fix:
- Diffusion-only files go through Load Diffusion Model, not Load Checkpoint.
- Check the file is for this model family and version. Many models have v1 and v2 files with different shapes.
- Update ComfyUI. New architectures need new code.
9. lora key not loaded: … (many lines in the console)
Cause: The LoRA does not match the model. ComfyUI skips the keys it cannot place, so the LoRA does little or nothing.
Fix:
- Use a LoRA trained for this exact base model.
- Some LoRAs ship two files with different key names (for example a diffusers version and a ComfyUI version). Download the one with
comfyuiin the name. - A handful of skipped keys can be normal; hundreds means the wrong LoRA.
10. AssertionError: Torch not compiled with CUDA enabled
Cause: A CPU-only PyTorch is installed, often after a custom node’s requirements replaced it.
Fix:
Reinstall a CUDA build of PyTorch in ComfyUI’s Python. For current NVIDIA cards, including the RTX 50 series:
pip install --upgrade torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
On the Windows portable build, run it as python_embeded\python.exe -m pip install ... from the portable folder.
11. CUDA error: no kernel image is available for execution on the device
Cause: Your PyTorch build is too old for your GPU. This is common on new cards such as the RTX 50 series, which need CUDA 12.8 builds.
Fix:
- Install a current PyTorch with the
cu128command above. - Or download the latest ComfyUI portable or Comfy Desktop, which ship a matching PyTorch.
- Then update attention packages such as SageAttention or xformers to builds for that PyTorch.
12. ModuleNotFoundError: No module named ‘…’
Cause: A Python package a custom node needs is missing, or it was installed into a different Python than the one ComfyUI uses.
Fix:
- Install the pack’s requirements with ComfyUI’s own Python:
pip install -r ComfyUI/custom_nodes/<pack>/requirements.txt. - Portable:
python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\<pack>\requirements.txt. - Desktop: use the terminal inside the app so the right environment is active.
- Typing plain
pipin a random terminal usually installs into the wrong Python.
13. Cannot import … module for custom nodes / (IMPORT FAILED) in the startup list
Cause: The custom node pack crashed while loading: a missing package, a version conflict, or a pack that is too old for your ComfyUI.
Fix:
- Scroll up in the console to the first red traceback for that pack. The last line names the real problem.
- Install its requirements (see above), then restart.
- Update the pack (
git pullin its folder, or Update in Manager) and update ComfyUI. - If two packs need different versions of the same library, disable the one you use least.
14. Black image, or NaN / invalid value warnings when decoding
Cause: The VAE overflowed in fp16. This mostly happens with SDXL-era VAEs.
Fix:
- Start ComfyUI with
--fp32-vaeor--bf16-vae. - Use an fp16-fixed VAE for SDXL.
- For newer models, make sure you use the VAE from the model card.
15. Output is pure noise or a grey mess
Cause: Several causes: the wrong sampler settings for a distilled model, the wrong VAE, or fp8 weights broken by a speed flag.
Fix:
- Distilled and turbo models need their own settings. For example the Krea 2 3-step LoRA needs CFG 1.0, and CFG 0.0 breaks the image (see our Krea 2 3-step guide).
- LoRAs that need a ManualSigmas schedule, such as Pruna’s Qwen Image LoRAs, give soft or noisy images with a normal scheduler.
- The
--fast fp8_matrix_multoption can turn some unscaled fp8 checkpoints into noise. Try without--fast.
16. Prompt outputs failed validation: Required input is missing
Cause: A node has an input socket that is not connected.
Fix:
Look for the node outlined in red and connect the missing input (often MODEL, CLIP, VAE or a latent). Nodes that were bypassed (purple) can break the chain too.
17. Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu
Cause: A custom node did not move everything to the GPU, often while ComfyUI was offloading.
Fix:
- Update the custom node and ComfyUI.
- Try starting with
--disable-smart-memoryor--normalvram. - Report it to the node author with the full traceback if it persists.
18. Port 8188 already in use / address already in use
Cause: Another ComfyUI (or another app) is already running on that port.
Fix:
Close the other instance, or start this one on another port: python main.py --port 8189, then open http://127.0.0.1:8189.
19. git is not recognized / git not found when installing nodes
Cause: Git is not installed or not on PATH, so Manager and git clone cannot download packs.
Fix:
Install Git from git-scm.com with the default options, then restart your terminal and ComfyUI.
20. This action is not allowed with this security level
Cause: ComfyUI Manager blocks some installs (such as installing from a Git URL) at its default security level.
Fix:
Prefer installing packs from the Manager list. If you trust the source, the level is set by security_level in the Manager’s config.ini (under ComfyUI/user/ in current versions). Lowering it lets any workflow request installs, so change it back afterwards.
21. SageAttention / xformers not found or errors at start
Cause: A launch flag such as --use-sage-attention was set, but the package is missing or built for another PyTorch.
Fix:
- Remove the flag to confirm ComfyUI starts.
- Install a SageAttention or xformers build that matches your exact PyTorch and CUDA version.
- ComfyUI runs fine without either; they only add speed.
22. Generation is suddenly very slow, console says “loaded partially”
Cause: The model did not fit in VRAM, so ComfyUI keeps part of it in system RAM and moves it in and out every step.
Fix:
- This is normal for big models on 8 to 16 GB cards and is not an error.
- Use a smaller quant (fp8, int8, GGUF Q5 or Q4) so the whole model fits.
- On NVIDIA, turn off CUDA Sysmem Fallback Policy for ComfyUI’s Python in the NVIDIA Control Panel if you prefer a clear OOM to a silent slowdown.
Launch Flags That Fix Problems
Many problems are solved by starting ComfyUI with an extra option. For a manual install, add the flag after python main.py. On the Windows portable build, right-click run_nvidia_gpu.bat, choose Edit, and add the flag to the end of the line:
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --lowvram
In Comfy Desktop, server options are in Settings.
| Flag | What it does | Use it when |
|---|---|---|
--lowvram |
Splits the model and offloads aggressively | You get out-of-memory errors on 8 to 12 GB cards |
--novram |
Keeps almost nothing in VRAM | --lowvram is still not enough (very slow) |
--reserve-vram 1 |
Leaves the given GB of VRAM free | Windows or your browser needs VRAM and ComfyUI crashes near the limit |
--normalvram |
Forces normal memory mode | ComfyUI picked low-VRAM mode on a card that does not need it |
--highvram |
Keeps models in VRAM between runs | You have 24 GB or more and want faster repeat runs |
--disable-smart-memory |
Unloads models to RAM after each run | Device or memory errors when switching models |
--fp32-vae / --bf16-vae |
Runs the VAE in higher precision | Black images or NaN warnings when decoding |
--cpu |
Runs everything on the CPU | Testing on a PC without a supported GPU (extremely slow) |
--cuda-device 1 |
Uses the second GPU | You have more than one NVIDIA card |
--listen |
Accepts connections from other PCs on your network | You open ComfyUI from another device |
--port 8189 |
Uses a different port | Port 8188 is already in use |
--use-sage-attention |
Uses SageAttention for speed | The sageattention package is installed and matches your PyTorch |
--preview-method auto |
Shows live previews while sampling | You want to see progress (needs TAESD files for the best previews) |
How to Update ComfyUI Safely
Many errors come from an old ComfyUI running a new workflow, or a new ComfyUI with old custom nodes. Update both together:
- Portable: run
update\update_comfyui.batin the portable folder. Useupdate_comfyui_and_python_dependencies.batonly when a release note tells you to. - Manual install: in the ComfyUI folder run
git pull, thenpip install -r requirements.txt. - Desktop: accept the app update when it is offered.
- Custom nodes: in Manager, click Update All, then restart.
Before a big update, copy ComfyUI/user/ (your workflows and settings) somewhere safe. Your models are never touched by an update.
When Nothing Works: Clean Reinstall Plan
If the console is full of import errors and conflicts, a fresh install is often faster than chasing each one. You do not need to download your models again.
- Rename your old ComfyUI folder to
ComfyUI_old. - Download a fresh ComfyUI portable, or clone ComfyUI again and install its requirements.
- Point the new install at your old models with
extra_model_paths.yaml(see the model folder cheat sheet), or move themodelsfolder across. - Copy
ComfyUI_old/user/into the new install to keep your workflows. - Install only the custom nodes you actually use, one at a time, restarting after each. If one breaks things, you know which.
FAQ
Where can I see the full error?
In the console window that ComfyUI runs in. On the portable build it is the black window that opens with the .bat file. In Desktop, open the logs from the app menu.
Why does a workflow from the internet always show errors?
It was built with other custom nodes, other model files and often a newer ComfyUI. Install missing nodes, pick your own model files in each loader, and update ComfyUI.
Is it safe to install every missing node a workflow asks for?
Custom nodes run Python code on your PC. Install packs from well-known authors with public GitHub repos, and be careful with unknown packs from random workflows.
How much VRAM do I need to avoid out-of-memory errors?
It depends on the model and its precision. Our ComfyUI VRAM guide covers what fits on 8, 12, 16 and 24 GB.
Can I fix errors without the command line?
Most of them, yes. Manager handles missing nodes and updates, and model problems are fixed by moving files. Only Python package problems really need a terminal.
Final Thoughts
ComfyUI errors look scary, but they repeat. Missing nodes, wrong folders, mismatched parts and memory limits cover nearly all of them. Read the last line of the first traceback, match it to the list above, and fix one thing at a time. Keep this page bookmarked next to the model folder cheat sheet and you will spend far less time debugging and more time making images.
More ComfyUI guides:
- ComfyUI Model Folder Cheat Sheet
- GGUF Quantization Explained: Which File to Download
- MiniMax H3 Out of Memory Fix for 16 GB
- gpu-unlock: BF16 Speed Boost for RTX 30 and 40
Sources
- GitHub: ComfyUI (launch options in
comfy/cli_args.py, README) - GitHub: ComfyUI-Manager
- PyTorch: install selector (CUDA builds)
- GitHub: city96/ComfyUI-GGUF