The message
AssertionError: Torch not compiled with CUDA enabled
Affects: ComfyUI
Why is this happening?
PyTorch comes in separate variants for CPU, NVIDIA (CUDA), AMD (ROCm), and Intel (XPU). If you manually install with pip install torch or pip install -r requirements.txt without the PyTorch index, Windows often gets the pure CPU version. On Intel graphics cards, the error also appears when a program expects CUDA even though Intel XPU is being used.
How to fix it
- Check the installed version. Portable:
.\python_embeded\python.exe -c "import torch; print(torch.__version__, torch.cuda.is_available())". Manual (venv activated):python -c "import torch; print(torch.__version__, torch.cuda.is_available())". If it says+cpuorFalse, the wrong variant is installed. - Manual installation with an NVIDIA card: Activate your venv (
comfyui_env\Scripts\activate), thenpip uninstall torch torchvision torchaudioand after thatpip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130. - Portable version: Open a terminal in the
ComfyUI_windows_portablefolder (right-click in the empty folder area → “Open in Terminal”). Then run.\python_embeded\python.exe -m pip uninstall -y torch torchvision torchaudioand.\python_embeded\python.exe -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130. If you use the package for GTX-10 cards and older (cu126), install the last matching version instead:.\python_embeded\python.exe -m pip install "torch==2.14.*" "torchvision==0.29.*" "torchaudio==2.14.*" --index-url https://download.pytorch.org/whl/cu126(PyTorch 2.14 is the last version with cu126 packages). - Desktop app: Open Manage → Update and, under “PyTorch,” use “Change PyTorch” to switch back to the official NVIDIA stack.
- Intel graphics card: Do not install CUDA. In the activated venv, use
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/xpu(Portable:.\python_embeded\python.exe -m pip …) or use the Intel Portable package from ComfyUI directly. - Then check again with the command from step 1 whether
Trueappears.
Better not: Do not install NVIDIA’s large CUDA Toolkit to fix this error. PyTorch brings the required CUDA libraries with it; only the correct PyTorch variant is missing.
Set up from scratch again
If it still doesn’t work after that, a fresh setup step by step often helps:
- Set up and maintain ComfyUI on Windows
Desktop or Portable, where the models belong, sharing models with other programs, safely installing custom nodes, updates, startup options … - Your First Image with ComfyUI
Install Comfy Desktop, learn the interface, and create your first AI image with FLUX.2 [small] 4B or Z-Image Turbo. - Your First AI Video with LTX in ComfyUI
Use LTX-2.3 in ComfyUI to create short videos with sound from text or an image. Template, files, settings, and license.
Terms for this
Similar errors
- No module named 'sageattention' (starting with --use-sage-attention fails)
- No matching distribution found for torch (wrong Python version)
- No module named 'triton' on Windows (triton-windows missing)
- A module that was compiled using NumPy 1.x cannot be run in NumPy 2.x – a package does not match the installed NumPy version
- CUDA gone after installing a custom node or package
Sources
- https://docs.comfy.org/troubleshooting/overview
- https://github.com/Comfy-Org/ComfyUI/blob/master/README.md
- https://docs.comfy.org/installation/comfyui_portable_windows
- https://docs.comfy.org/installation/desktop/usage/manage
- https://pytorch.org/get-started/locally/
Checked on Oct 21, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.