Installing ComfyUI‐Zluda - brknsoul/ROCmLibs GitHub Wiki

Installing ComfyUI-Zluda

(Many thanks to patientx for their work!)

ZLUDA is an experimental CUDA Wrapper for AMD GPUs in Windows.

Warning

ZLUDA does not fully support PyTorch in its official build, so ZLUDA support is tricky and unstable.

Installing ZLUDA for AMD GPUs in Windows

Note

This guide assumes you are comfortable using the command prompt, navigating Windows Explorer, renaming files and folders, and working with zip files.

If you have an integrated AMD GPU (iGPU), you may need to disable it, or use the HIP_VISIBLE_DEVICES environment variable.

Installing Python and Git

(If you've already installed these from another SD UI, you can skip this section)

Download and install Python 3.10.10 from here; https://www.python.org/ftp/python/3.10.10/python-3.10.10-amd64.exe
Important: While Installing Python, please ensure to check the "Add Python to PATH" box.

Download and install Git from here: https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/Git-2.43.0-64-bit.exe

Install Visual C++ Runtime

Note: Most everyone would have this anyway, since it comes with a lot of games, but there's no harm in trying to install it.

Grab the latest version of Visual C++ Runtime from https://aka.ms/vs/17/release/vc_redist.x64.exe (this is a direct download link) and then run it.
If you get the options to Repair or Uninstall, then you already have it installed and can click Close. Otherwise, install it.

Install HIP SDK

If you've already installed HIP SDK before (such as from installing SD.Next or amdgpu forks of A1111 or Forge), you can skip this section and proceed to Add needed folder to PATH environment variable

Install HIP SDK 6.4.2 from https://www.amd.com/en/developer/resources/rocm-hub/eula/licenses.html?filename=AMD-Software-PRO-Edition-24.Q4-Win10-Win11-For-HIP.exe
So long as your regular AMD GPU driver is up to date, you don't need to install the PRO driver HIP SDK suggests.

Replace HIP SDK library files for unsupported GPU architectures.

Go to https://rocm.docs.amd.com/projects/install-on-windows/en/develop/reference/system-requirements.html and find your GPU model.
If your GPU model has a ✅ in both columns then skip to Add needed folder to PATH environment variable.
If your GPU model has an ❌ in the HIP SDK column, or if your GPU isn't listed, follow the instructions below;

  1. Open Windows Explorer and copy and paste C:\Program Files\AMD\ROCm\6.2\bin\rocblas into the location bar.
    (Assuming you've installed the HIP SDK in the default location and Windows is located on C:).
  2. Make a copy of the library folder, for backup purposes.
  3. Download the library 7z file that matches your GPU's "gfx" number (a table can be found here) from https://github.com/likelovewant/ROCmLibs-for-gfx1103-AMD780M-APU/releases/tag/v0.6.2.4.
    (Note: You may have to install 7-Zip to unzip the .7z files.)
  4. Open the zip file.
  5. Drag and drop the library folder from zip file into C:\Program Files\AMD\ROCm\6.2\bin\rocblas (The folder you opened in step 1).
  6. Reboot PC

Note: Very old AMD GPUs (such as RX580 or RX480) may not function.

Add needed folder to PATH environment variable

  • Click the Start button, type "env", click "Edit the system environment variables", then click the "Environment Variables" button at the bottom.
  • In the bottom set of variables, find PATH, and click the bottom Edit button.
  • In the new dialog box that opens, click "New" and type or paste C:\Program Files\AMD\ROCm\6.2\bin, hit [Enter], then click OK, and OK again in the previous box.
    A visual guide can be found here: https://github.com/brknsoul/ROCmLibs/wiki/Adding-folders-to-PATH

Installing ComfyUI

Open cmd in the folder you wish to install ComfyUI

You can do this by navigating to the desired folder and then typing "cmd" in the location bar and hitting Enter.

Note: Refrain from installing ComfyUI into the Program Files, Users, or Windows folders, this includes the OneDrive folder or on the Desktop, or into a folder that begins with a period; (eg: .comfyui).

It is recommended to install ComfyUI in the root folder of an SSD.

In the Command Prompt window that appears, type or copy and paste one line at a time;

git clone https://github.com/patientx/ComfyUI-Zluda
cd ComfyUI-Zluda
install.bat

This should automatically install ComfyUI, install ZLUDA, patch ComfyUI to use ZLUDA, then start ComfyUI.

In future, to start ComfyUI, use start.bat

Note

The very first generation will take a while, and repeatedly display Compiling in progress. Please wait... Zluda is creating a database, which can take several minutes. Be patient and your generation will eventually start. This only happens once and subsequent generations will be much quicker.