You open ComfyUI, press Run, and the console shows AssertionError: Torch not compiled with CUDA enabled. Yesterday it worked. Today it will not even start on the GPU.
The good news: your graphics card and driver are almost always fine. This error means the PyTorch inside ComfyUI’s Python is a CPU-only build. Usually a custom node, an update script or a plain pip install swapped it out.
You fix it by putting the right CUDA build of PyTorch back, and it takes about five minutes.
This guide shows how to confirm the cause, the exact fix for ComfyUI Portable, Desktop and manual installs, the right build for each NVIDIA card, what to do on Mac and AMD, and how to stop it happening again.
- Cause: a CPU-only PyTorch (
+cpu) is installed in the Python that runs ComfyUI. - Check:
python -c "import torch; print(torch.__version__, torch.cuda.is_available())". You want+cu130(or+cu128) andTrue. - Fix (Portable): from the portable folder run
.\python_embeded\python.exe -m pip uninstall -y torch torchvision torchaudio, then reinstall fromhttps://download.pytorch.org/whl/cu130. - Which build: RTX 20/30/40/50 series use cu130 (ComfyUI’s current advice). GTX 10 series and older use cu126.
- Driver: CUDA 13.0 builds need an R580 or newer NVIDIA driver.
- Mac: never install a CUDA build. The node is forcing CUDA; fix or replace it.
New to ComfyUI? My ComfyUI beginner guide covers install, models, nodes and fixes in one place.
What the Error Means
PyTorch is the engine ComfyUI uses to run models. It comes in different builds: one for NVIDIA cards (CUDA), one for AMD (ROCm), one for Intel (XPU) and a CPU-only one. The version string tells you which:
| Version string | Meaning |
|---|---|
2.14.0+cu130 |
NVIDIA build with CUDA 13.0. Good for RTX 20 series and newer |
2.x.x+cu128 |
NVIDIA build with CUDA 12.8. Also works on RTX 50 series |
2.x.x+cu126 |
NVIDIA CUDA 12.6. For GTX 10 series and older |
2.x.x+cpu or no suffix on Windows |
CPU only. This causes the error |
When ComfyUI asks PyTorch to use the GPU and the build has no CUDA code inside, PyTorch stops with Torch not compiled with CUDA enabled. Updating the NVIDIA driver or installing the CUDA Toolkit does not fix it, because the missing piece is inside the PyTorch package itself.
Why It Happens
- A custom node replaced PyTorch. This is the most common cause. Some node packs list
torchin theirrequirements.txt. On Windows, the defaulttorchon PyPI is the CPU build, so installing the requirements can silently swap your GPU build for it. - The portable update script. Users have reported the error right after running
update_comfyui_and_python_dependencies.bat(GitHub issue #11575). Installing xformers can also pull in a different torch. - The wrong Python. You installed the fix into your system Python, but ComfyUI runs its own (
python_embededin Portable,.venvin Desktop). - A broken Desktop install. If the PyTorch download times out during Desktop setup (VPNs are a known trigger), the venv can end up without a CUDA build.
- Mac or AMD. There is no CUDA on these, so a node that hard-codes
cudathrows this error.
Step 1: Check Your PyTorch Build
First, confirm the driver sees your card. Open a terminal and run:
nvidia-smi
If your GPU appears in the table, the driver is fine. The “CUDA Version” it shows is the newest CUDA your driver supports, not what PyTorch uses. If nvidia-smi fails, update or reinstall the NVIDIA driver first.
Now check PyTorch in the Python ComfyUI actually uses:
| Install | Command (run in the ComfyUI folder) |
|---|---|
| Portable (Windows) | .\python_embeded\python.exe -c "import torch; print(torch.__version__, torch.cuda.is_available())" |
| Desktop (Windows) | .\.venv\Scripts\python.exe -c "import torch; print(torch.__version__, torch.cuda.is_available())" (in your Desktop base folder, e.g. Documents\ComfyUI) |
| Manual venv (Windows) | .\venv\Scripts\python.exe -c "import torch; print(torch.__version__, torch.cuda.is_available())" |
| Manual venv (Linux) | ./venv/bin/python -c "import torch; print(torch.__version__, torch.cuda.is_available())" |
If you see +cpu and False, carry on with the fix below. If you see +cu130 and True, PyTorch is fine and a custom node is forcing a device. Jump to Troubleshooting.
Step 2: Pick the Right CUDA Build
| Your GPU | PyTorch build | Index URL |
|---|---|---|
| RTX 50 series (5090, 5080, 5070 Ti, 5060 Ti) | cu130 (cu128 also works) | https://download.pytorch.org/whl/cu130 |
| RTX 40, 30, 20 series | cu130 | https://download.pytorch.org/whl/cu130 |
| GTX 10 series and older | cu126 | https://download.pytorch.org/whl/cu126 |
ComfyUI’s README currently says a cu130 build is needed for NVIDIA 20 series and newer. CUDA 13 dropped Maxwell, Pascal and Volta, which is why GTX 10 series cards stay on CUDA 12.6. ComfyUI even ships a separate CUDA 12.6 portable build for those cards.
Driver check: CUDA 13.0 builds need an R580-branch driver or newer (580.65.06+ on Linux). If the new build fails to start, update the driver from NVIDIA’s site.
Fix for ComfyUI Portable (Windows)
- Close ComfyUI.
- Open a terminal in the portable folder. Go to
ComfyUI_windows_portablein File Explorer, typecmdin the address bar and press Enter. - Remove the CPU build (and xformers, which often drags torch along):
.\python_embeded\python.exe -m pip uninstall -y torch torchvision torchaudio xformers - Install the CUDA build (RTX 20 series and newer):
.\python_embeded\python.exe -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130For GTX 10 series, use
cu126in the URL instead. - Check it:
.\python_embeded\python.exe -c "import torch; print(torch.__version__, torch.cuda.is_available())"You should see something like
2.14.0+cu130 True. - Start ComfyUI with
run_nvidia_gpu.bat. The console should show your GPU name as the device.
The download is about 2 to 3 GB, so give it time. Yes, python_embeded is spelled that way on purpose; it is the real folder name.
Why --index-url and not --extra-index-url? ComfyUI’s README uses --extra-index-url for fresh installs, and that normally works. For a repair, --index-url is safer: it makes pip pull torch only from the PyTorch CUDA server, so it cannot pick the CPU wheel from PyPI again.
Some users fixed a stubborn case by pinning exact versions that matched their old setup, for example torch==2.8.0+cu129 with torchvision==0.23.0+cu129 and torchaudio==2.8.0+cu129 from the cu129 index. Only do this if a node pack needs a specific version; otherwise take the latest stable.
Fix for ComfyUI Desktop
ComfyUI Desktop keeps its own Python in a .venv folder inside the base folder you picked during setup (often Documents\ComfyUI).
- Close ComfyUI Desktop.
- Open a terminal in that base folder.
- Run:
.\.venv\Scripts\python.exe -m pip uninstall -y torch torchvision torchaudio .\.venv\Scripts\python.exe -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130If pip is missing in the venv, Desktop uses uv: activate the venv (
.\.venv\Scripts\activate) and run the same commands asuv pip uninstall ...anduv pip install .... - Check with the version command above, then reopen Desktop.
If that does not help, do a clean reinstall: uninstall Desktop, delete %APPDATA%\ComfyUI, turn off any VPN, reinstall, and reconnect the VPN after setup finishes. Your models in the base folder are not touched by this, but back up anything you care about first.
Fix for Manual Installs (venv, Linux)
# activate the venv ComfyUI uses
source venv/bin/activate # Linux / macOS
venv\Scripts\activate # Windows
pip uninstall -y torch torchvision torchaudio
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130
python -c "import torch; print(torch.__version__, torch.cuda.is_available())"
Then start ComfyUI with the same Python: python main.py. If you use conda, activate the conda env first instead of the venv.
Linux users hit this less often, because the default PyTorch on PyPI for Linux already includes CUDA. If you do see it on Linux, you probably have two Pythons and ComfyUI is starting the wrong one.
Mac, AMD and Intel
| Hardware | What to do |
|---|---|
| Mac (Apple Silicon) | Do not install a CUDA build. ComfyUI uses Apple’s MPS backend. The error comes from a node that hard-codes .cuda(). Update the node, look for a Mac setting in it, or replace it. --cpu works as a slow stopgap |
| AMD on Linux | Install the ROCm build: pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm7.2 |
| AMD on Windows | Use the ROCm for Windows wheels from ComfyUI’s README (Python 3.13, Windows 11, current AMD driver) |
| Intel Arc | pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/xpu |
On AMD and Intel, a node that only supports CUDA can still throw this error even with the right PyTorch. Check the node’s README for supported hardware.
Stop It Happening Again
- Read before you install. Open a node pack’s
requirements.txton GitHub. If it liststorch, be ready to reinstall the CUDA build afterwards. - Preview pip changes:
.\python_embeded\python.exe -m pip install -r requirements.txt --dry-runshows if torch would be replaced. - Keep a repair script. Save the two Portable commands above in
fix_torch.batnext torun_nvidia_gpu.bat. - Skip xformers on current builds. ComfyUI uses PyTorch attention by default, and xformers installs are a common way torch gets swapped.
- Take a snapshot in ComfyUI Manager before big updates so you can roll back. See my ComfyUI Manager guide.
Still Broken? Troubleshooting
| Problem | Fix |
|---|---|
Check shows +cu130 and True, but ComfyUI still errors |
A custom node is forcing a device or carries its own old torch extension. Start with --disable-all-custom-nodes; if it works, find the node by turning packs back on in halves. |
| Error comes back after installing a node | That node’s requirements replaced torch. Reinstall the CUDA build and pin or remove torch from that pack’s requirements. |
CUDA error: no kernel image is available |
Different problem: your build is too old for the card (common on RTX 50). Install cu130. See my RTX 50 series ComfyUI setup guide. |
| Portable window closes right after the fix | Driver too old for CUDA 13.0. Update to an R580+ driver. |
pip says “No matching distribution” |
Your Python is too new or not 64-bit. Use the Python bundled with Portable (3.13) or Python 3.12/3.13 for manual installs. |
Two torch versions in pip list |
Uninstall torch repeatedly until pip says it is not installed, then reinstall once. |
| Download stops halfway or the disk filled up | Free at least 5 GB, uninstall, and reinstall cleanly. |
| Works now, but you run out of VRAM | That is a separate error. See my CUDA out of memory fix. |
For other red errors, my list of 22 common ComfyUI errors and fixes covers the rest.
FAQ
Do I need to install the CUDA Toolkit?
No. PyTorch’s CUDA builds bundle the CUDA libraries they need. You only need an up-to-date NVIDIA driver.
Will reinstalling PyTorch delete my models or workflows?
No. It only replaces Python packages. Your models, custom_nodes, input, output and user folders stay as they are.
Is cu128 or cu130 better for RTX 50 series?
Both include Blackwell (sm_120) support. ComfyUI’s current advice is cu130, and the NVFP4 speed boost on RTX 50 cards needs the cu130 build.
Why did it break when I did not change anything?
Something did change: usually a node install, a Manager “fix” action or the update script ran pip, and pip picked a CPU build of torch.
Can I run ComfyUI on the CPU instead?
Yes, with --cpu, but image and video models become extremely slow. It is only useful for testing.
Does this error also happen in other apps?
Yes. Any Python AI app (Stable Diffusion front-ends, training scripts, Whisper) shows the same error with a CPU-only torch, and the same fix applies inside that app’s Python.
Sources
- GitHub: Comfy-Org/ComfyUI README (install commands, cu130 advice, portable builds, troubleshooting line)
- GitHub issue #11575 (error after the portable update script, pinned reinstall fix)
- GitHub: Comfy-Org/desktop issue #1647 (Desktop venv reinstall, VPN clean-install fix)
- NVIDIA CUDA 13.0 release notes (driver minimum, dropped architectures)



