How to install A1111 & ComfyUI built on Pytorch 2.12.0+cu132 (*Update as needed)
As of June 1, 2026, xformers 0.0.35, which supports Pytorch 2.12.0+cu132, has been released, so I have updated the description to match the latest version.
The arrival of Pytorch 2.12.0+cu132
I have been writing articles focusing on Pytorch for some time now, but
Since Pytorch 2.4.0, it has supported CuDNN 9.x, and the latest version, 2.12.0+cu132, is now available.
Regarding SD reForge and Forge (the following is for reForge, but the installation method is exactly the same), I will omit them as they have already been described in the article below, but
I will explain how to apply this to A1111 and ComfyUI.
In this article, I will explain how to perform a fresh installation of A1111 and ComfyUI by applying Pytorch 2.12.0+cu132 to each.
Note that the method for updating Pytorch and xformers in an existing environment is explained below.
Installation Method
About Python and Git
The prerequisite Python and Git installation methods, including Microsoft Visual Studio, are explained in the article below. Here, I assume that a Python 3.11.x environment is installed.
(Note that the article below uses Python 3.12.x for ComfyUI)
Installation to A1111
Now, I will describe the installation method. Starting with A1111.
First, as usual, create an arbitrary folder, perform a git clone, and download the files for A1111.

As shown in the figure below, set the path to that folder, launch PowerShell, and execute the following to build the virtual environment and then activate it.
python -m venv venv
venv\scripts\activate
Next, install xformers. Also, since the torch for CPU operation will be installed at the same time here, I will delete it.
pip install xformers
pip uninstall torch
Note that there is a possibility that the installation via the network may fail at this time; in that case, please refer to the article below and try the method of downloading the whl file to your local drive and installing it.
After installing xformers, install triton, which xformers requires by default. However, there is no official Windows whl file for the triton library. Therefore, I will use a custom library developed by a volunteer.
As shown in the figure below, please enter and execute the following.
pip install -U triton-windows
Next, execute the following (The figure below shows 124, but specify 132 as in the code below) to install the latest Pytorch suite.
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu132
Since ONNX-related components are essential, we will install them here. Execute the installation as shown in the figure below.
python.exe -m pip install importlib_metadata onnx polygraphy
pip install coloredlogs flatbuffers numpy packaging protobuf sympy
pip install --pre --index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ort-cuda-13-nightly/pypi/simple/ onnxruntime-gpuNext, we will install insightface.
This is a library required for IP-Adapter and Reactor. While it should be installed automatically in A1111, it seems that the latest reForge and Forge are designed not to install it automatically. Since it is a library that is ultimately required for A1111 as well, installing it here ensures everything is set up correctly.
Please execute the following command. All related libraries will also be installed.
pip install https://huggingface.co/ussoewwin/Insightface_for_windows/resolve/main/insightface-0.7.3-cp311-cp311-win_amd64.whlNote that here, we are downloading from my HuggingFace as follows.
Once you have finished the settings up to this point, double-click webui-user.bat as usual to start the installation. At this time, if you want to use xformers, the description will be as follows.
@echo off
set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=--xformers --opt-channelslast --skip-python-version-check
set PYTORCH_CUDA_ALLOC_CONF=garbage_collection_threshold:0.6,max_split_size_mb:128
call webui.bat
When the WebUI starts, it will be applied with Pytorch 2.12.0+cu132 as shown in the figure below. The figure below is an example of applying xformers.
(Note that while the figure below shows an installation in a Python 3.12.x environment, the procedure explained here does not allow installation into a 3.12 environment)

Here, as explained in the article below, it is also recommended to perform a manual update of CuDNN.
Also, as a startup option, it is generally best to specify it in a way that uses xformers.
(Especially when performing Upscale, it is more stable than cross-attention)
Installation to ComfyUI
Next, regarding the application method to ComfyUI, the basics are the same. Also, here I will explain based on the Windows-Portable version. As of June 2026, ComfyUI Portable runs in a Python 3.13.x environment.
Note that in this case, the Portable version of ComfyUI does not have the virtual environment itself in venv format, so the commands are slightly different.
After unzipping the compressed file for ComfyUI, launch powershell with the path set to that folder as shown in the figure below, and first execute the following to delete the existing torch.
python_embeded\python.exe -m pip uninstall torch However, ComfyUI is often packaged with the latest Pytorch environment from the start, and as of June 1, 2026, the latest Pytorch 2.11.0+cu130 is already applied. In that case, the following Pytorch update work is unnecessary. Please proceed directly to the next steps: installing xformers, ONNX-related components, and Insightface.

Continue by executing the following to delete all Pytorch libraries.
python_embeded\python.exe -m pip uninstall torchvision
python_embeded\python.exe -m pip uninstall torchaudioNext, execute the following. Similar to A1111, this is the step to delete the torch for CPU operation that would otherwise be installed simultaneously with xformers.
python_embeded\python.exe -m pip install xformers
python_embeded\python.exe -m pip uninstall torchNext, enter and execute the following to reinstall all Pytorch libraries. Here, I use an unofficial version of torchaudio that I built, because official development of torchaudio ended at 2.11.0.
python_embeded\python.exe -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cu132
python_embeded\python.exe -m pip install https://huggingface.co/ussoewwin/torchaudio-built-on-cu132-for-windows/resolve/main/torchaudio-2.12.0%2Bcu132-cp313-cp313-win_amd64.whlIf deletion and updating of Pytorch libraries are not required, please proceed according to the descriptions from here on.
Next, please enter and execute the following.
python_embeded\python.exe -m pip install xformersHowever, at this time, torch+cu is often deleted and the torch for CPU operation is installed instead.If that process does not occur, there is no problem, so please proceed to the next step.
If the above case occurs,please perform the torch deletion and reinstallation explained above. However, you do not need to do anything for torchaudio and torchvision. If the CPU-only version of torch is installed, ComfyUI will not be able to run with CUDA.
Next, please install triton-windows just as you did for A1111. The point about replacing the installation command for ComfyUI is the same as above. The command statement will be as follows.
python_embeded\python.exe -m pip install -U triton-windowsIn ComfyUI, there are additional steps to take besides installing the libraries, so please refer to the article below and follow the instructions.
Continuing in the same way as A1111, you can install the onnx-related libraries and insightface here. Please install each of them after changing the command format to "python_embeded\python.exe -m pip install" for ComfyUI.
First, please install insightface.
python_embeded\python.exe -m pip install https://huggingface.co/ussoewwin/Insightface_for_windows/resolve/main/insightface-0.7.3-cp313-cp313-win_amd64.whlNote that here, you will download it from my HuggingFace as follows.
It is also recommended to perform a manual update of CuDNN here, just as you did for A1111.
Next, we will install sage-attention2. Please refer to the article below for the installation method.
To use sage-attention2, edit the run_nvidia_gpu.bat file and add the following description after python main.py as shown below.
python main.py --use-sage-attentionOnce you have finished the settings up to this point, double-click the "run_nvidia_gpu" batch file as usual, as shown in the figure below.

Note that in ComfyUI, as shown in the figure below, xformers is applied automatically without needing to specify any particular startup options.

For now, I have explained the entire installation procedure, but I will add any items that need to be added if necessary.
If you want to use Flash-Attention, please install the version that matches your environment from my HuggingFace below.
