Back to Blog
tutorialIntermediate20 min read

ComfyUI with ZLUDA for AMD GPUs on Windows

ZLUDA (CUDA on AMD) is a compatibility layer that allows CUDA applications to run on AMD GPUs. This guide walks you through installing and configuring ComfyUI ZLUDA specifically optimized for AMD hardware, including the AMD Radeon 780M integrated graphics.

ComfyUI on AMD 780M with Zluda — Full Setup Guide (Windows)

ComfyUI with ZLUDA for AMD GPUs on Windows

This guide was originally written for an AMD Radeon 780M, but this should also work for 680M and other AMD GPUs. The main difference will be the library files you copy over.

Affiliate links in this guide help support this documentation at no extra cost to you.

This guide was created for the AMD Radeon 780M integrated graphics using Windows. A separate guide is available for the AMD Radeon 680M. The mini-pc used in this example is the GMKTec K12 with a 780M, which has the Ryzen 7 H 255 CPU, 32GB of DDR5 5600, and a 512GB SSD. This is now my primary Windows PC and it has been fantastic. One major benefit is the Oculink port which allows for an external GPU if you ever want to upgrade from the 780M.

Overview

ZLUDA (CUDA on AMD) is a compatibility layer that allows CUDA applications to run on AMD GPUs. This guide will walk you through installing and configuring the ComfyUI ZLUDA specifically optimized for AMD hardware, including the AMD Radeon 780M integrated graphics.

What you'll need:

  • A system with AMD Radeon 780M integrated graphics
  • Windows 10/11 (ZLUDA currently works on Windows)
  • At least 16GB of system RAM (more is better for larger models)
  • ~20GB of free storage space for ComfyUI and initial models

The following are some required guidelines to keep in mind from the start.

CRITICAL SETUP REQUIREMENTS

These steps are mandatory for ZLUDA to work properly:

  1. Use Command Prompt, NOT PowerShell - PowerShell will cause issues
  2. Clone to drive root (e.g., C:\ComfyUI-Zluda) - Do not use nested directories
  3. Use Python 3.11.9 specifically - Other versions will cause issues
  4. Exclude directory from Windows Security - (see why)
  5. Carefully copy all required libraries and add ons - Missing dependencies will cause failures

Not following the above will result in a painful experience. Trust me.

Install Latest Adrenaline Drivers

I recommending going to AMD's Drivers and Support for Processors and Graphics and downloading the latest drivers for your AMD GPU if you have not done this already. You need at least version 25.5.1.

AMD Drivers Download Page
AMD Drivers Download Page

Once the download is complete, install the drivers.

AMD Adrenaline Driver Installation
AMD Adrenaline Driver Installation

When complete, leave the "Keep AMD software up to date" if you want to enable auto updates and then click "Close".

AMD Driver Installation Complete
AMD Driver Installation Complete

Install HIP 6.4.2 Drivers

The next step is to install the HIP drivers. For the 780M version 6.4.2 will be installed. Be sure not to mix this up with the 6.2.4 as they look similar. Navigate to the AMD HIP SDK page and download the specified version.

AMD HIP SDK Download Page
AMD HIP SDK Download Page

You will need to accept the terms before downloading.

HIP SDK License Terms
HIP SDK License Terms

Once complete start the installation. When prompted to allow the app to make changes, select "Yes"

Windows UAC Allow Changes Prompt
Windows UAC Allow Changes Prompt

The installer will begin and it will be similar to installing the drivers. Leave all the defaults selected

HIP SDK Installer Components
HIP SDK Installer Components

When completed, click "Finish"

HIP SDK Installation Complete
HIP SDK Installation Complete

If the AMD Adrenaline UI pops up you can close it.

Validate and set HIP PATHs

There are three environmental variables you must make sure exist. Two of them are likely already set. In your Windows search bar, type "System" and look for the menu item for "Edit the system environmental variables".

Windows System Search
Windows System Search

A window will pop up, select "Environment Variables" at the bottom.

System Properties Environment Variables
System Properties Environment Variables

In the bottom section, confirm both HIP_PATH and HIP_PATH_64 exist. They should both point to C:\Program Files\AMD\ROCm\6.4\

HIP PATH Environment Variables
HIP PATH Environment Variables

Now in the top section, select the "Variable" named "Path" and then click the "Edit" button.

Edit PATH Variable
Edit PATH Variable

Then click "New"

Add New PATH Value
Add New PATH Value

Paste in the below value, and click "OK"

C:\Program Files\AMD\ROCm\6.4\bin

ROCm Bin Path Added
ROCm Bin Path Added

Now click "OK" on the main "Environment Variables" to close it.

Environment Variables OK
Environment Variables OK

And then click "OK" on the "System Properties" window to close it as well.

System Properties OK
System Properties OK

Replace ROCm Library Files

Depending on the GPU that you have, you should download the associated ROCm Library Files. On the ComfyUI Zluda repo you can see the gfx name for your GPU. This guide assumes you have a 780M.

The next step is to replace the default ROCm Library Files along with the rocblas.dll file. Navigate to the likelovewant - ROCmLibs-for-gfx1103-AMD780M-APU repo and scroll down to the "Assets" section. Then download the "rocm.gfx1103.for.hip.6.4.2.7z" file.

ROCm Libraries GFX1103 Download
ROCm Libraries GFX1103 Download

Open up the "Downloads" folder and extract the archive.

Extract ROCm Archive
Extract ROCm Archive

Leave the defaults and click "Extract"

Extract Dialog
Extract Dialog

When complete, open the directory to find the "Library" folder and the "rocblas.dll".

Extracted ROCm Library Files
Extracted ROCm Library Files

Leaving that window open, create a new tab in file explorer

File Explorer New Tab
File Explorer New Tab

Then navigate to C:\Program Files\AMD\ROCm\6.4\bin\rocblas. Once there, rename the existing library directory to library-backup.

Rename Library to Library Backup
Rename Library to Library Backup

Now go back to the "rocm gfx1103 for hip 6.4.2" tab and copy the "library" folder and paste it into the rocblas folder. When prompted, select "Continue" to make the transfer.

Continue Protected Folder Access
Continue Protected Folder Access

When the transfer is complete you will have both the new "library" folder you copied over from the extracted archive, and the original folder that was renamed to "library-backup".

Library Folders After Copy
Library Folders After Copy

Now, navigate from the C:\Program Files\AMD\ROCm\6.4\bin\rocblas folder up one directory to the C:\Program Files\AMD\ROCm\6.4\bin folder, and copy over the rocblas.dll file. You will be prompted to overwrite the existing file which you should do.

Replace rocblas.dll Confirmation
Replace rocblas.dll Confirmation

Like before, you will also be prompted to "Continue" as this is a protected folder. Press Continue.

Continue for rocblas.dll
Continue for rocblas.dll

That concludes the changes needed for the HIP SDK.

Install Python 3.11.9

Warning: You must use Python version 3.11.9 even if you already have Python installed.

Navigate to the Python download page for 3.11.9. Then scroll down to the "Files" section and grab the one labeled "Windows installer (64-bit)".

Python 3.11.9 Download Page
Python 3.11.9 Download Page

Run the installer and choose "Customize installation".

Python Customize Installation
Python Customize Installation

Leave all the Optional Features selected and click "Next"

Python Optional Features
Python Optional Features

Ensure the following options are selected for "Advanced Options"

  1. Associate files with Python (requires the 'py' launcher)
  2. Create shortcuts for installed applications
  3. Add Python to environment variables

Then click "Install"

Python Advanced Options
Python Advanced Options

When prompted to allow this app to make changes, select "Yes".

Python UAC Allow Changes
Python UAC Allow Changes

Let the installer complete, then select "Disable path length limit".

Python Disable Path Length Limit
Python Disable Path Length Limit

And once again allow the app to make changes by selecting "Yes" to the pop-up. Then click "Close" to finish the Python installation.

Python Installation Close
Python Installation Close

Install Git

In order to clone the repo, you must have git installed. Navigate to the git-scm Windows download page, and click the "Click here to download" link.

Git Download Page
Git Download Page

Once the download completes, start the installation. As usual, click "Yes" when prompted to allow the app to make changes.

Git UAC Allow Changes
Git UAC Allow Changes

Then click "Next" to start.

Git License Agreement
Git License Agreement

"Next" again.

Git Installation Destination
Git Installation Destination

Leave the default selected components and click "Next".

Git Select Components
Git Select Components

Click "Next" again.

Git Start Menu Folder
Git Start Menu Folder

Click "Next" for the editor.

Git Default Editor Selection
Git Default Editor Selection

Continue to accept the defaults (there will be several more) and then click "Install".

Git Install Button
Git Install Button

When the install completes, click "Finish" (I uncheck "View Release Notes" as it is not needed).

Git Installation Complete
Git Installation Complete

Install Visual Studio Build Tools

Next, click this to download Visual Studio Build Tools. Then start the installer and once again click "Yes" to allow the app to make changes.

Visual Studio Build Tools UAC
Visual Studio Build Tools UAC

When prompted, click "Continue".

Visual Studio Installer Continue
Visual Studio Installer Continue

There will be a few progress bars which complete, and then the installer will open. Simply click the "Install" button with the default selections.

Visual Studio Build Tools Install
Visual Studio Build Tools Install

Wait for the download and install to complete, it should not take more than a minute or so. Then simply close out of the installer.

Visual Studio Build Tools Complete
Visual Studio Build Tools Complete

Warning: At this point you must restart your PC

Installing ComfyUI Zluda

Warning:

  • It is HIGHLY recommended you clone the repo to C:\
  • You should be using the CMD Prompt and not Powershell for this

Open up the Command Prompt by typing "cmd" in the Windows search and then selecting the "Command Prompt".

Open Command Prompt
Open Command Prompt

Then navigate to the root of the C:\ drive by pasting in:

cd C:\

Then clone the git repo with:

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

Git Clone ComfyUI-Zluda
Git Clone ComfyUI-Zluda

Leave the CMD Prompt open and move to the next section.

Whitelist the ComfyUI-Zluda Folder

Warning: You must whitelist the directory or Windows Security will quarantine essential files during installation.

Open up Windows Security by typing "security" in the Windows search.

Open Windows Security
Open Windows Security

On the left panel, click "Virus & threat protection"

Virus and Threat Protection
Virus and Threat Protection

Find the "Virus & threat protection settings" section and click "Manage Settings"

Manage Security Settings
Manage Security Settings

Scroll to the bottom and find "Exclusions", then click "Add or remove exclusions"

Security Exclusions Section
Security Exclusions Section

When prompted to allow this app to make changes, click "Yes"

Security UAC Allow Changes
Security UAC Allow Changes

Then click "Add an exclusion" then "Folder"

Add Exclusion Folder
Add Exclusion Folder

Then select the folder C:\ComfyUI-Zluda and then click "Select Folder"

Select ComfyUI-Zluda Folder
Select ComfyUI-Zluda Folder

You should now see it listed. You can close Windows Security now.

ComfyUI-Zluda Excluded
ComfyUI-Zluda Excluded

Install ComfyUI Zluda

Back in the CMD Prompt, enter the ComfyUI-Zluda folder with:

cd ComfyUI-Zluda

Then run the installer

install-n.bat

The installation should begin. This can take some time so please be patient. After installation, it will automatically open ComfyUI in the browser.

ComfyUI Zluda Installer Running
ComfyUI Zluda Installer Running

First Use

Once the install finishes you will see the browser open to ComfyUI with the "Templates" section open.

Warning: The CMD Prompt must remain open while using ComfyUI

ComfyUI Templates Browser
ComfyUI Templates Browser

Select the "NetaYume Lumina Text to Image" template. Then download the template.

ComfyUI Download Model
ComfyUI Download Model

The model will download to your Downloads directory, open that directory up and the transfer the model to the C:\ComfyUI-Zluda\models\checkpoints folder.

ComfyUI Checkpoints Folder
ComfyUI Checkpoints Folder

However, a new node needs to be created for the workflow to run, and you will likely need to use this in all of your workflows. Right click on the open space in the workflow pane, and then select Add Node > CFZ > utils > CFZ CUDNN Toggle.

ComfyUI Add CFZ CUDNN Toggle Node
ComfyUI Add CFZ CUDNN Toggle Node

Then identify the "VAE Decode" node and on the left side "samples" input, move the pink line to the CFZ CUDNN Toggle "latent" input. Then from the CFZ CUDNN Toggle "latent" output, move it to the "samples" input on the VAE Decode Node. Finally, set the "enable_cudnn" to false on the CFZ CUDNN Toggle.

It should look something like this:

ComfyUI CFZ CUDNN Toggle Wired
ComfyUI CFZ CUDNN Toggle Wired

You should now be able to click the "Run" button and have the image generated. Then you can click the "Queue" button to see the generated images.

ComfyUI Run and Queue
ComfyUI Run and Queue

Warning: On a 780M, the first time an image is generated with this model it will take 15-20 minutes. Every time after it will be MUCH faster (~300 seconds).

You can always check the CMD Prompt for errors. You will likely see "Compilation is in progress. Please wait..." for some time as the model compiles during the first run.

ComfyUI ZLUDA Compilation Progress
ComfyUI ZLUDA Compilation Progress

Once the compilation completes you will begin to see the progress bar for the image generation as it completes each step.

ComfyUI Generation Steps Progress
ComfyUI Generation Steps Progress

Eventually the image shows both in the workflow and in the "Queue".

ComfyUI Completed AI Image Generation
ComfyUI Completed AI Image Generation

Final Notes

I am not sure on the specifics, but it seems that each new model "type" will require a one-time compilation that can take up to 15 minutes.

The first generation will take longer than usual, ZLUDA is compiling for your GPU. It does this once for every new model type. This is necessary and unavoidable

You must keep the CMD prompt open while using ComfyUI. Once you are finished you can close the CMD prompt. To start it again, open up the CMD prompt and run C:\ComfyUI-Zluda\comfyui-n.bat.

You can make a shortcut to this on your desktop which is a bit easier.

Each time you run comfyui-n.bat the latest updates from the github repo will be pulled, so there is usually no need to update anything.

Make sure to continue to add the CFZ CUDNN Toggle to your workflows as you will likely receive an error otherwise.