Torch Not Compiled With CUDA Enabled in ComfyUI
Fix the ComfyUI "Torch not compiled with CUDA enabled" error by checking the active Python, PyTorch CUDA build, NVIDIA driver, launch path, and dependency drift.
Start with Wonderful Launcher if this issue touches your real ComfyUI environment. Use the docs to understand the fix, and use the app to inspect the machine you already have.
Download Wonderful LauncherIf ComfyUI shows 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 or wrong 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 core runtime is green again.
Quick diagnosis
| Check | Command | What good looks like |
|---|---|---|
| GPU visible to Windows | nvidia-smi | Shows your NVIDIA GPU and driver version |
| Torch build | python -c "import torch; print(torch.__version__); print(torch.version.cuda)" | Version does not end in +cpu, CUDA is not None |
| CUDA available | python -c "import torch; print(torch.cuda.is_available())" | Prints True |
| Correct launch path | Portable users run run_nvidia_gpu.bat | You 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.
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 -c "import torch; 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.batIf you use run_cpu.bat, CUDA will not be used even when the GPU driver is healthy.
Manual install or venv
Activate the environment you use for ComfyUI, then run:
python -c "import torch; 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 checkIf 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-smiIf 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.
- 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.
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, 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.txtCompatibility 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.txtOlder 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.txtAfter 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.
Step 4: If a custom node caused it
If the error appeared right after installing a custom node, treat it as dependency drift:
- Save the error log before changing more packages.
- Check what changed:
python -m pip checkandpython -m pip show torch. - Repair
torch,torchvision, andtorchaudiofirst. - Reinstall the custom node only after confirming CUDA works.
- Use
--no-depsfor 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-smialone. It proves the driver sees the GPU, not that PyTorch can use CUDA. - Do not run
pip install -r requirements.txtfrom 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 checkshows 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, and recovery notes. If the machine is still blocked, use expert help instead of continuing random package repairs.
Source References
Start with Wonderful Launcher if this issue touches your real ComfyUI environment. Use the docs to understand the fix, and use the app to inspect the machine you already have.
Download Wonderful LauncherStart with Wonderful Launcher if this issue touches your real ComfyUI environment. Use the docs to understand the fix, and use the app to inspect the machine you already have.
Download Wonderful LauncherDid this fix your issue?
Your answer helps prioritize verified ComfyUI repairs.