ComfyUI-ZLUDA: Unleashing the Power of AMD GPUs on Windows

Apr 25, 2022 | Data Science

The Windows-only version of ComfyUI has taken a leap forward by incorporating ZLUDA, a remarkable component that enhances performance on AMD GPUs. In this guide, we will walk you through the new features, setup instructions, and troubleshooting tips for using ComfyUI-ZLUDA efficiently.

What’s New?

  • Renamed start.bat to comfyui.bat to avoid conflicts with existing Windows commands.
  • Introduced fix-update.bat to ensure smooth updates to the latest version.
  • Updated ZLUDA to version 3.8.4, with installation support for the HIP SDK 5.7. If you’re on the previous version, make sure to run patchzluda.bat once. Note that the first run for each model will take a bit longer.
  • Big Update: If you encounter issues, reset the fork and run git fetch --all followed by git reset --hard origin/master to update successfully. Rebooting Windows may be necessary for speed normalization.
  • For consistent updates, avoid using the built-in update function from the manager. Instead, utilize git pull, as the application automatically ensures it’s up-to-date when comfyui.bat is used.
  • Only update extensions through the Comfy manager, as tweaking unrelated settings may disrupt your basic installation.

Dependencies

If you are starting from scratch, make sure you’ve got the following:

  1. Git: Get it from git-scm.com. Ensure you check the box for using Git from the command line during installation.
  2. Python (3.10.11 or 3.11): Install the latest release from python.org. Avoid the Windows Store version; if installed, please uninstall it first.
  3. Visual C++ Runtime: Available at aka.ms. Install this essential runtime.
  4. Install HIP SDK 5.7.1: Head to AMD’s website and select the correct version.
  5. Add the system variable HIP_PATH with a value of C:\Program Files\AMD\ROCm\5.7 and check for paths under the System Variables.
  6. If you have an AMD GPU older than the 6800 series, download compatible library files from GitHub.

Setup (For Windows Only)

Now, let’s get your ComfyUI-ZLUDA ready for action. Follow these steps:

  1. Open a command prompt.
  2. Execute the command: git clone https://github.com/patientx/ComfyUI-ZLUDA.
  3. Change the directory: cd ComfyUI-ZLUDA.
  4. Run the installer with: install.bat.
  5. Create a shortcut for later use with: comfyui.bat.
  6. For patch updates, use: patchzluda.bat.
  7. Bear in mind that the first generation may take about 10-15 minutes without progress indicators on the interface; patience is key.

Troubleshooting

If you encounter any issues, here are some handy troubleshooting steps:

  • Clear your pip cache located at C:\Users\[your windows username]\AppData\Local\pip\cache. You can also do this with pip cache purge when within a virtual environment.
  • Keep in mind that xformers aren’t compatible with ZLUDA, meaning packages requiring them may not function as intended. Errors also occur with certain face restoration tools that require CUDA; opt for alternatives like gfpgan instead.
  • Ensure your AMD GPU drivers are up-to-date, and remove any NVIDIA drivers if they were previously installed.
  • For ZLUDA errors, verify the presence of the required DLLs in ComfyUI-ZLUDA\venv\Lib\site-packages\torch\lib.
  • If things go awry, consider deleting the venv folder and rerunning install.bat.
  • Problems with caffe2_nvrtc.dll may hint at an improper installation of Python; uninstall versions from the Windows Store, then reinstall from python.org.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

Setting up ComfyUI-ZLUDA on your Windows machine opens a pathway to enhanced performance for those utilizing AMD GPUs. Embrace these improvements and prepare to harness the full potential of your system.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox