LogoWonderful Launcher
  • Home
  • Pricing
  • Docs
  • Download

ComfyUI Torch Not Compiled With CUDA Enabled Fix on Windows

Partially verifiedLast verified 2026-06-29

Fix ComfyUI Torch not compiled with CUDA enabled by checking active Python, CPU-only PyTorch, NVIDIA driver, and Windows launch path.

If you searched for ComfyUI torch not compiled with CUDA enabled fix, ComfyUI torch not compiled with CUDA enabled fix Windows, or ComfyUI shows AssertionError: Torch not compiled with CUDA enabled, the Python environment that launched ComfyUI cannot use CUDA through PyTorch.

That usually means one of four things:

  • ComfyUI is running with CPU-only Torch.
  • You launched the wrong portable batch file, ComfyUI Desktop runtime, or virtual environment.
  • A custom node install replaced the working GPU build of torch.
  • Your NVIDIA driver is too old for the CUDA build you installed.

Do the checks below in order. Do not keep installing random plugin requirements until the exact Python that starts ComfyUI reports torch.cuda.is_available() == True.

Fast rule

nvidia-smi proves Windows can see the GPU. It does not prove ComfyUI's Python can use CUDA. Always test Torch inside the same portable python_embeded, Desktop-managed environment, or venv that starts ComfyUI.

Quick diagnosis

CheckCommandWhat good looks like
GPU visible to Windowsnvidia-smiShows your NVIDIA GPU and driver version
Active Pythonpython -c "import sys; print(sys.executable)"Matches the ComfyUI launch environment, not a random global Python
Torch buildpython -c "import torch; print(torch.__version__); print(torch.version.cuda)"Version does not end in +cpu; CUDA is not None
CUDA availablepython -c "import torch; print(torch.cuda.is_available())"Prints True
Correct launch pathPortable users run run_nvidia_gpu.batYou are not launching the CPU batch or a different Python

If nvidia-smi works but torch.cuda.is_available() is False, your driver can see the GPU, but the Python environment cannot use it through PyTorch.

Windows Fix: Pick the Right Runtime First

Before reinstalling PyTorch, identify which ComfyUI runtime you are actually repairing:

Install typeFirst thing to verifyWhy it matters
Windows portableYou launched run_nvidia_gpu.bat and tested .\python_embeded\python.exePortable ComfyUI does not use your global Python
ComfyUI DesktopYou are using Desktop's managed runtime or repair pathGlobal pip install torch will not fix Desktop's private environment
Manual venvThe venv is activated before testing or installingOtherwise the repair can land in system Python

If you cannot identify the active Python, stop here and use ComfyUI Python Embedded Explained before changing packages.

CUDA still blocked after checking the runtime?

If this error is blocking real work, preserve the task logs and use the launcher-native diagnostics path before trying more blind package installs.

Open diagnostics path

Exact error logs

This guide applies when your terminal, browser console, or ComfyUI log contains one of these lines:

AssertionError: Torch not compiled with CUDA enabled
Torch not compiled with CUDA enabled
torch.cuda.is_available() is False
CUDA is not available

If the error appears while loading a workflow, treat it as a runtime problem first. If it appeared immediately after installing a custom node, treat it as dependency drift: the node installer may have replaced CUDA-enabled Torch with a CPU wheel or an incompatible build.

Case-review checks before reinstalling Torch

Recent Agent-case reviews showed that this error is easy to misclassify. The most common false path is: nvidia-smi works, so the repair assumes CUDA is healthy, even though ComfyUI is running a different Python or a CPU-only PyTorch wheel.

Use this sequence before changing packages:

EvidenceWhat it provesWhat to check next
nvidia-smi shows the GPUWindows and the NVIDIA driver can see the cardTest PyTorch in the same Python that starts ComfyUI
torch.version.cuda is None or version ends in +cpuActive PyTorch is CPU-onlyReinstall PyTorch from the correct CUDA wheel index
torch.cuda.is_available() is False in one terminalThat terminal's Python cannot use CUDACompare sys.executable with the ComfyUI launch path
CUDA works in system Python but not portable PythonWrong environment was testedRepair python_embeded or the launch venv, not the global Python
Error appeared after a custom-node installA dependency install may have replaced TorchRepair the core Torch stack before installing more plugin requirements

Do not mark the repair complete until the ComfyUI launch environment prints a CUDA-enabled Torch build and ComfyUI starts from the expected folder.

Step 1: Test the same Python that launches ComfyUI

The most common mistake is testing one Python and launching ComfyUI with another.

Windows portable

Open Command Prompt inside the portable folder and run:

.\python_embeded\python.exe -s -c "import sys, torch; print('python', sys.executable); print('torch', torch.__version__); print('cuda build', torch.version.cuda); print('cuda available', torch.cuda.is_available()); print('device', torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'none')"

Then make sure you start ComfyUI with:

run_nvidia_gpu.bat

If you use run_cpu.bat, CUDA will not be used even when the GPU driver is healthy.

If the portable folder has both CPU and NVIDIA batch files, do not repair packages until you confirm the NVIDIA batch is the one being used.

ComfyUI Desktop

ComfyUI Desktop manages its own runtime. Do not run pip install torch in a random global terminal and expect Desktop to change.

Use the app's own environment, terminal, repair option, or reinstall/update flow. The diagnosis is the same, but the target is different: the Python inside the Desktop runtime must report a CUDA-enabled PyTorch build.

Manual install or venv

Activate the environment you use for ComfyUI, then run:

python -c "import sys, torch; print('python', sys.executable); print('torch', torch.__version__); print('cuda build', torch.version.cuda); print('cuda available', torch.cuda.is_available()); print('device', torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'none')"
python -m pip show torch torchvision torchaudio
python -m pip check

If torch.version.cuda is None, or the version shows +cpu, you are on a CPU-only PyTorch build.

Step 2: Check the NVIDIA driver before reinstalling Torch

Run:

nvidia-smi

If the command is missing or cannot see your GPU, fix the driver first. Updating PyTorch will not help if the operating system cannot expose the GPU.

If nvidia-smi works, compare your setup with the current ComfyUI package or install guide before reinstalling packages. Portable releases can change their bundled Python, PyTorch, and CUDA combination over time, so the repair command must match the environment you actually installed. As of this verification pass, the official ComfyUI system requirements page says the current Windows portable build uses Python 3.13 with PyTorch CUDA 13.0, while older portable downloads and compatibility packages may still use older Python or CUDA builds.

  • New NVIDIA GPUs usually need a recent CUDA-enabled PyTorch build.
  • Older custom nodes may lag behind the newest Python or PyTorch stack.
  • Newer ComfyUI features can need newer PyTorch builds than an old portable folder has installed.

For a clean repair, first decide whether you are fixing the existing environment or moving to a fresh ComfyUI package whose Python, CUDA, and PyTorch versions already match your GPU. For many portable users, downloading the correct NVIDIA portable package is lower risk than trying to mutate an old broken folder.

Step 3: Repair PyTorch in the correct environment

Use the PyTorch selector for the latest command that matches your OS, package manager, Python version, and GPU. The examples below show common NVIDIA paths that were checked on 2026-06-22, but the selector should be your source of truth when versions change.

Example NVIDIA path: CUDA 13.0

Use this only when the PyTorch selector says it matches your Python version, platform, and driver/GPU target.

python -m pip uninstall -y torch torchvision torchaudio xformers
python -m pip install --upgrade pip
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130
python -m pip install -r requirements.txt

Compatibility fallback: CUDA 12.8

python -m pip uninstall -y torch torchvision torchaudio xformers
python -m pip install --upgrade pip
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
python -m pip install -r requirements.txt

Older GPU fallback: CUDA 12.6

python -m pip uninstall -y torch torchvision torchaudio xformers
python -m pip install --upgrade pip
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
python -m pip install -r requirements.txt

After reinstalling, verify again:

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

Do not reinstall xformers until ComfyUI starts successfully. If there is no verified xformers wheel for your Python, Torch, and CUDA combination, launch ComfyUI with --use-pytorch-cross-attention instead.

Choose repair or fresh install

SituationBetter path
You downloaded a CPU portable package by mistakeDownload the NVIDIA portable package instead of patching packages by hand
You launched run_cpu.batStart with run_nvidia_gpu.bat before reinstalling Torch
A custom node broke an environment that used to workRepair Torch in the same Python, then reinstall the node carefully
ComfyUI Desktop runtime is brokenUse Desktop's runtime repair/update path, not global pip
Multiple core packages conflict in pip checkFresh portable install is usually faster

Step 4: If a custom node caused it

If the error appeared right after installing a custom node, treat it as dependency drift:

  1. Save the error log before changing more packages.
  2. Check what changed: python -m pip check and python -m pip show torch.
  3. Repair torch, torchvision, and torchaudio first.
  4. Reinstall the custom node only after confirming CUDA works.
  5. Use --no-deps for packages that try to pull their own Torch build, then install only the missing package versions you actually need.

See ComfyUI Dependency Conflicts and Installed Custom Nodes and Broke ComfyUI? before continuing with plugin repairs.

What not to do

  • Do not install the CUDA Toolkit first unless a package specifically needs compilation. PyTorch wheels bundle the CUDA runtime they need for normal use.
  • Do not trust nvidia-smi alone. It proves the driver sees the GPU, not that PyTorch can use CUDA.
  • Do not run pip install -r requirements.txt from random custom nodes until the core runtime is fixed.
  • Do not mix the portable embedded Python with a global Python install.
  • Do not keep submitting the same broken command if the error says "No matching distribution"; your Python version or wheel index may not support that combo.

When reinstalling is faster

Repair is worth trying when the environment only has a bad Torch build. A clean portable package is faster when:

  • multiple core packages were downgraded
  • pip check shows many hard conflicts
  • you do not know which Python launches ComfyUI
  • you need a stable baseline for RTX 50-series or older GTX hardware

Use ComfyUI Portable for a clean Windows baseline, or Manual Install when you need full control over Python and GPU packages.

Related guides

  • ComfyUI GPU Compatibility
  • ComfyUI Dependency Conflicts
  • ComfyUI Startup Failed? How to Diagnose and Recover Faster
  • Installed Custom Nodes and Broke ComfyUI? Recover Without Reinstalling
  • ComfyUI Common Issues and Fast Fixes

Best next step

If CUDA worked before and broke after plugin or environment changes, start by repairing the active Python environment. If this keeps happening, Wonderful Launcher is the safer path for preserving existing workflows, models, task logs, and recovery notes. If the machine is still blocked, contact support instead of continuing random package repairs.

Source References

  • ComfyUI system requirements
  • ComfyUI troubleshooting overview
  • PyTorch Start Locally installer
  • PyTorch previous versions
  • NVIDIA driver downloads
Related guides:Fix dependency conflictsRecover startup failuresCustom nodes broke the environment

Start free with Wonderful Launcher if this affects your real ComfyUI environment. It keeps launcher-native repair, task logs, and runtime checks in one place; credits are only for image generation and metered tools.

Download Wonderful LauncherSee credit packages

Did this fix your issue?

Your answer helps prioritize verified ComfyUI repairs.

Table of Contents

Quick diagnosis
Windows Fix: Pick the Right Runtime First
Exact error logs
Case-review checks before reinstalling Torch
Step 1: Test the same Python that launches ComfyUI
Windows portable
ComfyUI Desktop
Manual install or venv
Step 2: Check the NVIDIA driver before reinstalling Torch
Step 3: Repair PyTorch in the correct environment
Example NVIDIA path: CUDA 13.0
Compatibility fallback: CUDA 12.8
Older GPU fallback: CUDA 12.6
Choose repair or fresh install
Step 4: If a custom node caused it
What not to do
When reinstalling is faster
Related guides
Best next step
Source References