AssertionError: Torch not compiled with CUDA enabled
The message
AssertionError: Torch not compiled with CUDA enabledWhat it means
The copy of PyTorch that ComfyUI is using was built without Nvidia GPU support, so the first time anything asks for the graphics card, PyTorch stops with this error.
What to do
Uninstall torch from the Python that runs ComfyUI and reinstall it from PyTorch's CUDA package index (the README's command uses whl/cu130). On the portable build, run pip through python_embeded\python.exe.
ComfyUI starts to load (or you've just updated it), and the console ends with a traceback like this one from issue #2427:
File "C:\Users\Luna\Documents\ComfyUI_windows_portable\python_embeded\lib\site-packages\torch\cuda\__init__.py", line 289, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
ComfyUI didn't write this line. It comes from PyTorch, the library that does the actual number crunching, and PyTorch 2.14.0, the newest on PyPI as of September 26, 2026, still raises it from torch/cuda/__init__.py. The same text turns up in other local AI tools for the same reason: 49 issues in the ComfyUI repo quote it and another 39 in text-generation-webui's, as of September 26, 2026.
What it means
PyTorch ships in several builds. There's one with CUDA, which is Nvidia's system for running code on the graphics card, and there are builds without it (plain CPU, AMD's ROCm, Apple's). The build you get depends on where pip downloads it from. On Windows, the default package on PyPI (the public Python package index) is the build without CUDA (the torch 2.14.0 Windows wheel there is 118 MB, and its Nvidia libraries are listed for Linux only), and PyTorch's own index at download.pytorch.org/whl/cu130 and similar addresses serves the CUDA ones.
So the error means the PyTorch sitting in ComfyUI's Python can't talk to an Nvidia card at all. Your drivers can be perfect and it'll still say this.
Why it appears after a custom node install
Both issue threads start the same way. "I just updated Comfyui and some custom nodes" in #2427, and in #4845, "I literally just restarted ComfyUI", with a log showing ComfyUI-Manager had just installed dependencies. A custom node's requirements can ask for a different torch version (or a package like xformers that pins one), and pip then quietly swaps the CUDA build for whatever PyPI has. A ComfyUI team member's reply in #4845 about one such package was short: "Don't install xformers unless you are using tooncraft."
How to fix it
ComfyUI's README has a troubleshooting line for exactly this: uninstall torch, then reinstall it with the Nvidia command from the install section. As of v0.37.0 that command is:
pip uninstall torch
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130
The README says a cu130 or newer build is required on Nvidia 20-series cards and above. For a 10-series or older card, the project offers a separate portable download built on CUDA 12.6.
On the Windows portable build, plain pip installs into whatever Python is on your system, not the one ComfyUI uses. Open a terminal in the ComfyUI_windows_portable folder and run pip through the bundled interpreter: .\python_embeded\python.exe -m pip uninstall torch, then the install line with the same prefix. A team member in #2427 had to point that out to someone typing the command from inside python_embeded itself.
Afterwards, check what you've got with python -c "import torch; print(torch.cuda.is_available())" (through the same interpreter). It should print True. If a custom node keeps undoing the fix every time it updates, that node's requirements are the thing to look at.
On a Mac there's no CUDA to install. ComfyUI's Apple silicon instructions use PyTorch's Mac build instead, so seeing this error on a Mac means some code asked for the Nvidia path by name, and reinstalling torch won't change that.
Other lines the same feature prints
Match yours against these if the one at the top of the page is not quite it. They come from the same code and mean related things.
Torch not compiled with CUDA enabledraise AssertionError("Torch not compiled with CUDA enabled")