Skip to content

xformers installs incompatible torch version (2.7.1) despite having torch 2.5.1+cu121 installed for CUDA 12.1 #8882

Description

@chnisar515

Custom Node Testing

Your question

Hi team,

I'm currently setting up ComfyUI in a clean virtual environment using Python 3.10.11, Windows 11, and a NVIDIA RTX 5070 (Ada, 12GB) with CUDA 12.1 support. I encountered a critical dependency conflict while attempting to install xformers alongside the CUDA-enabled version of PyTorch.

My Environment:

OS: Windows 11 64-bit
Python: 3.10.11 (inside a venv)
GPU: NVIDIA GeForce RTX 5070 (Ada)
CUDA version: 12.1 (confirmed via PyTorch and nvidia-smi)
pip: 24.0
ComfyUI: Git clone of master
Torch target: torch==2.5.1+cu121 from the official PyTorch CUDA 12.1 index

Installation Steps I Followed:
python -m venv venv venv\Scripts\activate

Installed the correct CUDA-enabled torch stack:
pip install torch==2.5.1+cu121 torchvision==0.20.1+cu121 torchaudio==2.5.1+cu121 --extra-index-url https://download.pytorch.org/whl/cu121

Verified torch and CUDA compatibility:
python -c "import torch; print(torch.__version__, torch.cuda.is_available())"

Then I attempted to install xformers:
pip install xformers

and output is below

(venv) C:\ComfyUI\ComfyUI>pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --extra-index-url https://download.pytorch.org/whl/cu121
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu121
Collecting torch==2.5.1
Using cached https://download.pytorch.org/whl/cu121/torch-2.5.1%2Bcu121-cp310-cp310-win_amd64.whl (2449.4 MB)
Collecting torchvision==0.20.1
Using cached https://download.pytorch.org/whl/cu121/torchvision-0.20.1%2Bcu121-cp310-cp310-win_amd64.whl (6.1 MB)
Collecting torchaudio==2.5.1
Using cached https://download.pytorch.org/whl/cu121/torchaudio-2.5.1%2Bcu121-cp310-cp310-win_amd64.whl (4.1 MB)
Requirement already satisfied: filelock in c:\comfyui\comfyui\venv\lib\site-packages (from torch==2.5.1) (3.18.0)
Requirement already satisfied: typing-extensions>=4.8.0 in c:\comfyui\comfyui\venv\lib\site-packages (from torch==2.5.1) (4.14.1)
Requirement already satisfied: networkx in c:\comfyui\comfyui\venv\lib\site-packages (from torch==2.5.1) (3.4.2)
Requirement already satisfied: jinja2 in c:\comfyui\comfyui\venv\lib\site-packages (from torch==2.5.1) (3.1.6)
Requirement already satisfied: fsspec in c:\comfyui\comfyui\venv\lib\site-packages (from torch==2.5.1) (2025.5.1)
Collecting sympy==1.13.1 (from torch==2.5.1)
Using cached https://download.pytorch.org/whl/sympy-1.13.1-py3-none-any.whl (6.2 MB)
Requirement already satisfied: numpy in c:\comfyui\comfyui\venv\lib\site-packages (from torchvision==0.20.1) (2.2.6)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in c:\comfyui\comfyui\venv\lib\site-packages (from torchvision==0.20.1) (11.3.0)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in c:\comfyui\comfyui\venv\lib\site-packages (from sympy==1.13.1->torch==2.5.1) (1.3.0)
Requirement already satisfied: MarkupSafe>=2.0 in c:\comfyui\comfyui\venv\lib\site-packages (from jinja2->torch==2.5.1) (3.0.2)
Installing collected packages: sympy, torch, torchvision, torchaudio
Successfully installed sympy-1.13.1 torch-2.5.1+cu121 torchaudio-2.5.1+cu121 torchvision-0.20.1+cu121

(venv) C:\ComfyUI\ComfyUI>pip install xformers
Collecting xformers
Using cached xformers-0.0.31.post1-cp39-abi3-win_amd64.whl.metadata (1.1 kB)
Requirement already satisfied: numpy in c:\comfyui\comfyui\venv\lib\site-packages (from xformers) (2.2.6)
Collecting torch==2.7.1 (from xformers)
Using cached torch-2.7.1-cp310-cp310-win_amd64.whl.metadata (28 kB)
Requirement already satisfied: filelock in c:\comfyui\comfyui\venv\lib\site-packages (from torch==2.7.1->xformers) (3.18.0)
Requirement already satisfied: typing-extensions>=4.10.0 in c:\comfyui\comfyui\venv\lib\site-packages (from torch==2.7.1->xformers) (4.14.1)
Collecting sympy>=1.13.3 (from torch==2.7.1->xformers)
Using cached sympy-1.14.0-py3-none-any.whl.metadata (12 kB)
Requirement already satisfied: networkx in c:\comfyui\comfyui\venv\lib\site-packages (from torch==2.7.1->xformers) (3.4.2)
Requirement already satisfied: jinja2 in c:\comfyui\comfyui\venv\lib\site-packages (from torch==2.7.1->xformers) (3.1.6)
Requirement already satisfied: fsspec in c:\comfyui\comfyui\venv\lib\site-packages (from torch==2.7.1->xformers) (2025.5.1)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in c:\comfyui\comfyui\venv\lib\site-packages (from sympy>=1.13.3->torch==2.7.1->xformers) (1.3.0)
Requirement already satisfied: MarkupSafe>=2.0 in c:\comfyui\comfyui\venv\lib\site-packages (from jinja2->torch==2.7.1->xformers) (3.0.2)
Using cached xformers-0.0.31.post1-cp39-abi3-win_amd64.whl (100.2 MB)
Using cached torch-2.7.1-cp310-cp310-win_amd64.whl (216.1 MB)
Using cached sympy-1.14.0-py3-none-any.whl (6.3 MB)
Installing collected packages: sympy, torch, xformers
Attempting uninstall: sympy
Found existing installation: sympy 1.13.1
Uninstalling sympy-1.13.1:
Successfully uninstalled sympy-1.13.1
Attempting uninstall: torch
Found existing installation: torch 2.5.1+cu121
Uninstalling torch-2.5.1+cu121:
Successfully uninstalled torch-2.5.1+cu121
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
torchaudio 2.5.1+cu121 requires torch==2.5.1+cu121, but you have torch 2.7.1 which is incompatible.
torchvision 0.20.1+cu121 requires torch==2.5.1+cu121, but you have torch 2.7.1 which is incompatible.
Successfully installed sympy-1.14.0 torch-2.7.1 xformers-0.0.31.post1

(venv) C:\ComfyUI\ComfyUI>

Logs

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThis issue is stale and will be autoclosed soon.User SupportA user needs help with something, probably not a bug.bug-cop:user-resolved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions