Torch Not Compiled with CUDA Enabled in ComfyUI: Fix by Install

Updated 2026-10-09

Why ComfyUI says Torch not compiled with CUDA enabled, how to check your PyTorch build, and the fix for portable, Desktop, venv, AMD, Mac and Stability Matrix.

Quick answer

The ComfyUI error "torch not compiled with cuda enabled" means the copy of PyTorch that ComfyUI is running has no NVIDIA CUDA support in it. It is a CPU-only build, or a build for some other kind of hardware. Your GPU and driver are usually fine; the wrong PyTorch is installed in the Python that ComfyUI uses.

The full line comes from PyTorch itself, in torch/cuda/__init__.py, function _lazy_init:

AssertionError: Torch not compiled with CUDA enabled

PyTorch raises it when the build has no CUDA bindings at all. ComfyUI hits it at startup, because unless it finds Apple MPS, DirectML, an Intel or other accelerator, or the --cpu flag, it asks torch.cuda for the current device.

How it usually happens, most common first:

  1. Something ran pip install and pulled PyTorch from PyPI. On Windows, PyPI's torch wheel is the CPU build. ComfyUI's own requirements.txt lists torch and torchvision without a version, and a custom node pack's requirements can list them too, so installing requirements before PyTorch, or a node that asks for a different torch version, can replace the CUDA build.
  2. The right PyTorch is installed in a different Python. The portable build runs python_embeded\python.exe; a manual install runs whatever venv you activated. A pip install from any other Python changes nothing ComfyUI sees.
  3. There is no CUDA on the machine at all. AMD cards use ROCm builds, Macs use MPS. On a Mac, the error almost always means a custom node hard-codes CUDA.

The fix for the first two is the one ComfyUI's README gives: uninstall torch, then install it again from PyTorch's CUDA index. For NVIDIA that is currently:

pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130

Run that with the Python your install actually uses; the sections below give the exact command for each install type. We read ComfyUI's README, its source, its documentation and the PyTorch source on 2026-10-09.

Check which PyTorch you have

One line tells you the build, the CUDA version it was built for and whether it can see a GPU. In a manual install, activate the venv first:

python -c "import sys, torch; print(sys.executable); print(torch.__version__, torch.version.cuda, torch.cuda.is_available())"

On the Windows portable build, run it from the portable folder with the embedded Python:

.\python_embeded\python.exe -c "import sys, torch; print(sys.executable); print(torch.__version__, torch.version.cuda, torch.cuda.is_available())"

How to read the second line:

What you seeWhat it means
What you see2.14.1+cu130 13.0 TrueWhat it meansA CUDA 13.0 build that sees your GPU. This error should not happen.
What you see2.14.1+cpu None FalseWhat it meansA CPU-only build. This is the cause.
What you seeAny version, then None and FalseWhat it meansAlso a CPU-only build. PyPI's wheel file names carry no tag, so trust None.
What you see2.14.1+rocm7.2, then TrueWhat it meansAn AMD ROCm build. It answers through torch.cuda, so it does not raise this.
What you seeVersion with +cu…, then FalseWhat it meansA CUDA build that cannot reach the GPU: a driver or GPU problem, not this one.
What you seeFirst line is not the Python you expectWhat it meansYou checked, or installed into, the wrong environment.

The suffixes are the tags PyTorch's own wheel index uses: +cpu, +cu130, +rocm7.2. On our own test machine for the MiniMax H3 RTX 3060 run, the version was 2.13.0+cu130.

Read the traceback before reinstalling

Where the traceback passes through tells you which problem you have.

The traceback goes throughWhenCause
The traceback goes throughcomfy/model_management.py, get_torch_device, then torch.cuda.current_device()WhenAt startup, before ComfyUI loadsCauseThe PyTorch in this environment has no CUDA. Reinstall it.
The traceback goes throughA file under custom_nodes/<pack>/ calling .cuda() or passing a cuda deviceWhenWhen you queue a workflow with that nodeCauseThe node assumes NVIDIA. On a Mac, reinstalling PyTorch will not help.

The next check in the same PyTorch function raises a different message, libcudart functions unavailable, which points at a broken build rather than a CPU one.

Fix it by install type

Windows portable

The portable build keeps its Python in python_embeded, next to the ComfyUI folder. Two ways to fix it, both run from the portable folder.

ComfyUI's own script. update\update_comfyui_and_python_dependencies.bat updates ComfyUI, then reinstalls torch, torchvision and torchaudio from PyTorch's CUDA index together with ComfyUI's requirements. The workflow that builds the portable writes that script for CUDA 13.0 by default, the version the README says the NVIDIA portable ships with. Several users in ComfyUI issue #2427 reported that this script fixed the error for them. It also updates every Python dependency, which the portable's own readme says to do only when dependencies are broken.

By hand, with the embedded Python:

.\python_embeded\python.exe -s -m pip uninstall -y torch torchvision torchaudio
.\python_embeded\python.exe -s -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130

ComfyUI's README uninstalls only torch. We remove all three so they come back from the same index together. Then run the check above again.

Two variations:

  • GTX 10-series and older. ComfyUI's README offers a separate portable with PyTorch CUDA 12.6 for those cards and says not to use it on 20-series and newer. On a 10-series card, use cu126 in the index URL instead of cu130.
  • If the check still shows None, run the install line again with --index-url in place of --extra-index-url. That is the form PyTorch's own install selector uses, and it stops pip from considering PyPI's CPU wheel at all.

Comfy Desktop

Comfy Desktop manages each installation's Python for you, and its documentation gives two tools that fit this error:

  • Manage, then the About tab. Open the instance's ⋮ menu, choose Manage, then About. The PyTorch row shows the installed build, and Change PyTorch switches it to an official stack tested with that install type: CUDA, ROCm, Intel XPU, CPU or Apple MPS. The rest of the environment is kept.
  • Restore Snapshot. Desktop records a snapshot, including every pip package, on each boot, restart and update. If the error started after installing a node, restore the snapshot from before it; the preview lists what will change, so you can see whether torch was replaced.

ComfyUI's troubleshooting page says Desktop on Windows supports only NVIDIA GPUs with CUDA, while Desktop's own install page lists NVIDIA and AMD as recommended. If you are on an AMD card on Windows, the portable build or a manual install is the documented route.

Manual install (git clone and a venv)

Activate the venv you start ComfyUI from, run the check, then follow the README:

pip uninstall torch
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130
pip install -r requirements.txt

The order matters. The README installs PyTorch first and the requirements file second, because the requirements file only asks for torch by name and pip keeps what is already there. Our ComfyUI download page makes the same point.

On Linux, a plain pip install torch already gets a CUDA build: PyTorch's install selector gives that plain command as a CUDA option on Linux but as the CPU option on Windows, and PyPI's Linux wheel depends on the CUDA 13.0 toolkit. So on Linux this error usually means a +cpu build from PyTorch's CPU index, or the wrong environment.

Stability Matrix

Stability Matrix installs ComfyUI its own way. A ComfyUI contributor replied in issue #2427 that Stability Matrix users have to ask its team, because it does not use the standard install.

We found no fix from Stability Matrix's maintainers in its issue tracker. What users report there, unconfirmed:

  • Check Settings → System Settings and make sure your GPU is selected as the default GPU. One user listed this as the first step of their fix; another, on an RTX 5080, found it was not enough.
  • Delete the venv folder inside the ComfyUI package folder and launch the package again, so Stability Matrix reinstalls its dependencies. User logs show that folder at ...\Packages\ComfyUI\venv\.

Deleting venv removes every Python package in it, including the ones your custom nodes installed, and Stability Matrix has to install them all again.

AMD and Intel GPUs

An AMD card never has CUDA. What you need is a ROCm build of PyTorch, which reuses the torch.cuda interface, so ComfyUI runs and this error goes away. Per ComfyUI's README:

PlatformWhat ComfyUI's README says to install
PlatformLinuxWhat ComfyUI's README says to installpip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm7.2
PlatformWindowsWhat ComfyUI's README says to installAMD's ROCm 10.0 PyTorch packages, from AMD's own index, with Windows 11, a current AMD driver and Python 3.13; the README has the full command
PlatformWindows, packagedWhat ComfyUI's README says to installThe AMD portable, ComfyUI_windows_portable_amd.7z, started with run_amd_gpu.bat

If you get this error on an AMD machine, you are almost certainly running an NVIDIA or CPU build: the NVIDIA portable, or a plain pip install torch on Windows.

The README does not mention ZLUDA. ComfyUI still has a --directml flag, but its own startup warning says torch-directml barely works, is very slow, and may be removed, and asks you not to use it.

Intel Arc cards use PyTorch's xpu builds, from https://download.pytorch.org/whl/xpu per the README, or the Intel portable.

On a Mac

PyTorch's install selector states that CUDA is not available on macOS. ComfyUI does not need it there: when PyTorch reports Apple MPS, ComfyUI uses the mps device and never asks for CUDA. ComfyUI's README says to install the PyTorch nightly following Apple's Metal guide.

So on a Mac, this error almost always comes from a custom node that calls .cuda() directly. One example: in ComfyUI-DynamiCrafter issue #21, ComfyUI listed the device as mps on an M4 Pro, and the node's own script still called model.cuda(). That issue is open with no reply.

Reinstalling PyTorch does not fix that. Look in the node's repository for a device setting or an MPS issue, or use a different node for the job. If ComfyUI itself fails at startup on a Mac, PyTorch is not reporting MPS, and its device code falls through to the CUDA call.

--cpu: the last resort

--cpu is a real ComfyUI flag; its help text says it uses the CPU for everything and is slow. The portable build's run_cpu.bat is the normal launch line with --cpu added. In Comfy Desktop, startup flags go in the instance's Startup Args tab.

It makes ComfyUI start on a CPU-only PyTorch, which proves the install works. It does not make a video model practical: our ComfyUI download page covers why. It also does not stop a custom node that calls .cuda() itself.

Stop it coming back

  • Install node requirements with ComfyUI's Python. On the portable build that is .\python_embeded\python.exe -m pip install ..., as ComfyUI's portable documentation shows. After any install, run the check line again.
  • Read pip's output. If a node install says it is uninstalling or installing torch, check the build before you restart.
  • ComfyUI-Manager can block it. Its README documents pip_blacklist.list, which stops named packages being installed, and pip_auto_fix.list, which restores pinned versions on startup and accepts --index-url. Both live in the Manager's user folder.
  • On Desktop, keep the snapshots. They are the quickest undo.

What we could not confirm

  • A Stability Matrix fix from its maintainers. Everything in that section is from users.
  • A fix for the DynamiCrafter case on a Mac.
  • Whether every custom node that pins torch causes this. It depends on the pin and on the index pip uses.

If none of this matches what you see, paste the full error into our ComfyUI troubleshooting tool. For an all-black result rather than an error, see ComfyUI black video output. The system requirements checker checks a GPU and system RAM against a model; MiniMax H3 is its only preset so far.

GenVidKit is an independent guide. It is not affiliated with Comfy Org, the PyTorch Foundation, Meta, NVIDIA, AMD, Intel, Apple or Lykos AI (Stability Matrix).

Sources

All read on 2026-10-09.