| win11 Python3.11.0 CUDA12.4 PyTorch 2.5.1 |
|
|
| Introduction to Installing Custom PyTorch Wheels for ComfyUI |
| This guide outlines the process of installing pre-built PyTorch wheels for use within a ComfyUI virtual environment. These wheels are specifically compiled for Python 3.11, CUDA 12.4, and are designed to enhance performance and compatibility. |
|
|
| Installation Steps: |
|
|
| Activate your ComfyUI virtual environment. This ensures that the custom PyTorch installation is isolated to your ComfyUI setup and avoids conflicts with other Python environments. |
|
|
| Bash |
| E:\ComfyUI>venv\Scripts\activate |
|
|
|
|
| Install the custom PyTorch wheel. Assuming you have downloaded the torch-2.5.1+cu124-cp311-cp311-win_amd64.whl file to the E: drive, use the following pip command: |
| |
| https://download.pytorch.org/whl/cu124/torch-2.5.1%2Bcu124-cp311-cp311-win_amd64.whl#sha256=6c8a7003ef1327479ede284b6e5ab3527d3900c2b2d401af15bcc50f2245a59f |
|
|
| Bash |
| pip install "E:\torch-2.5.1+cu124-cp311-cp311-win_amd64.whl" |
| |
| |
| This command instructs pip to install the specified wheel file. The quotation marks are used to handle potential spaces in the file path. |
| Install the corresponding Torchvision and Torchaudio extensions. To ensure compatibility with the installed PyTorch version, install the matching Torchvision and Torchaudio extensions using the following command: |
| |
| Bash |
| pip install torchvision==0.20.1+cu124 torchaudio==2.5.1+cu124 --index-url https://download.pytorch.org/whl/cu124 |
| |
| This command installs specific versions of Torchvision and Torchaudio that are compatible with CUDA 12.4. The --index-url flag specifies the PyTorch wheel index, ensuring that the correct CUDA-enabled versions are downloaded. |
| Key Considerations: |
| Virtual Environment: It is crucial to perform these installations within your ComfyUI virtual environment to maintain a clean and organized setup. |
| File Path: Ensure that the file path to your downloaded PyTorch wheel is correct. |
| CUDA Compatibility: These wheels are specifically built for CUDA 12.4. If you have a different CUDA version, you will need to obtain or build compatible wheels. |
| Version Matching: Always ensure that the versions of PyTorch, Torchvision, and Torchaudio are compatible to avoid potential errors. |
| By following these steps, you can successfully install custom PyTorch wheels and their extensions within your ComfyUI environment, enabling optimized performance for your workflows. |