Torch Not Compiled with CUDA Enabled in ComfyUI: Fix by Install
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/, function _:
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 for the current device.
How it usually happens, most common first:
- Something ran
pip installand pulled PyTorch from PyPI. On Windows, PyPI'storchwheel is the CPU build. ComfyUI's ownrequirementslists.txt torchandtorchvisionwithout 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. - The right PyTorch is installed in a different Python. The portable build runs
python_; a manual install runs whatever venv you activated. Aembeded\python .exe pip installfrom any other Python changes nothing ComfyUI sees. - 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 see | What it means |
|---|---|
What you see2.14.1+cu130 13.0 True | What it meansA CUDA 13.0 build that sees your GPU. This error should not happen. |
What you see2.14.1+cpu None False | What it meansA CPU-only build. This is the cause. |
What you seeAny version, then None and False | What 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 True | What it meansAn AMD ROCm build. It answers through torch, so it does not raise this. |
What you seeVersion with +cu…, then False | What 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 expect | What 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 through | When | Cause |
|---|---|---|
The traceback goes throughcomfy/, get_, then torch | WhenAt startup, before ComfyUI loads | CauseThe PyTorch in this environment has no CUDA. Reinstall it. |
The traceback goes throughA file under custom_ calling .cuda() or passing a cuda device | WhenWhen you queue a workflow with that node | CauseThe 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_, next to the ComfyUI folder. Two ways to fix it, both run from the portable folder.
ComfyUI's own script. update\update_ 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
cu126in the index URL instead ofcu130. - If the check still shows
None, run the install line again with--index-in place ofurl --extra-. That is the form PyTorch's own install selector uses, and it stops pip from considering PyPI's CPU wheel at all.index- url
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
venvfolder 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 interface, so ComfyUI runs and this error goes away. Per ComfyUI's README:
| Platform | What ComfyUI's README says to install |
|---|---|
| PlatformLinux | What ComfyUI's README says to installpip install torch torchvision torchaudio --index- |
| PlatformWindows | What 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, packaged | What ComfyUI's README says to installThe AMD portable, ComfyUI_, started with run_ |
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:// 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. 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_ 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_, as ComfyUI's portable documentation shows. After any install, run the check line again.embeded\python .exe - m pip install ... - 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_, which stops named packages being installed, andblacklist .list pip_, which restores pinned versions on startup and acceptsauto_ fix .list --index-. Both live in the Manager's user folder.url - 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
torchcauses 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.
- PyTorch
torch/— the exact error and the function that raises it.cuda/__ init__ .py - PyTorch HIP (ROCm) semantics — ROCm builds reuse
torch;.cuda torch..version .hip - PyTorch install selector data,
published_— the per-platform pip commands for 2.14.1, and the macOS note.versions .json - torch on PyPI and PyTorch's wheel index — Linux-only CUDA dependencies, and the
+cpu,+cu130and+rocm7.2tags. - ComfyUI README — install commands for NVIDIA, AMD, Intel and Mac, the portable builds, and its fix for this error.
- ComfyUI
requirements— unpinned.txt torchandtorchvision. - ComfyUI
comfy/— device selection and the DirectML warning.model_ management .py - ComfyUI
comfy/—cli_ args .py --cpuand--directml. - ComfyUI
.ci/andwindows_ nvidia_ base_ files windows_— the portable's launch scripts, its readme, and what the dependency update script runs.release_ dependencies .yml - ComfyUI troubleshooting, Portable for Windows, Comfy Desktop for Windows, Managing installations and Snapshots, ComfyUI documentation — the documented fix, the portable's pip, Desktop's PyTorch switch and snapshots.
- ComfyUI issue #2427 — the portable reports, the dependency script and the Stability Matrix reply.
- Stability Matrix issues #1239, #1204 and #713 — user workarounds and the venv path.
- ComfyUI-DynamiCrafter issue #21 — the Mac example.
- ComfyUI-Manager README, manager-v4 —
pip_andblacklist .list pip_.auto_ fix .list