The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
Go to file
2025-05-13 16:58:07 +03:00
.ci Fix updater issue with newer portable. (#7917) 2025-05-03 00:28:10 -04:00
.github More API Nodes (#7956) 2025-05-06 04:23:00 -04:00
api_server Add Load Image Output node (#6790) 2025-02-18 17:53:01 -05:00
app This should not be a warning. (#7946) 2025-05-05 07:49:07 -04:00
comfy Update zluda.py 2025-05-13 16:23:24 +03:00
comfy_api make audio chunks contiguous before encoding (#7942) 2025-05-04 23:27:23 -04:00
comfy_api_nodes remove aspect ratio from kling request (#8062) 2025-05-12 13:32:24 -04:00
comfy_execution [Type] Annotate graph.get_input_info (#7386) 2025-04-17 21:02:24 -04:00
comfy_extras implement APG guidance (#8081) 2025-05-12 21:10:24 -04:00
custom_nodes Lint unused import (#5973) 2024-12-09 15:24:39 -05:00
input LoadLatent and SaveLatent should behave like the LoadImage and SaveImage. 2023-05-18 00:09:12 -04:00
models Update folder paths: "clip" -> "text_encoders" 2024-11-02 15:35:38 -04:00
notebooks Enforce all pyflake lint rules (#6033) 2024-12-12 19:29:37 -05:00
output Initial commit. 2023-01-16 22:37:14 -05:00
script_examples add comment about using api key in headless (#8082) 2025-05-12 23:06:44 -04:00
tests Fix and enforce no trailing whitespace. 2024-12-31 03:16:37 -05:00
tests-unit More API Nodes (#7956) 2025-05-06 04:23:00 -04:00
utils Normalize extra_model_config.yaml paths to prevent duplicates. (#6885) 2025-02-20 07:09:45 -05:00
.gitattributes Tell github not to count the web directory in language stats. 2024-08-15 13:48:56 -04:00
.gitignore More API Nodes (#7956) 2025-05-06 04:23:00 -04:00
basic-flux-workflow.json Add files via upload 2025-01-07 02:19:30 +03:00
better-flux-workflow.json Add files via upload 2025-01-07 02:19:30 +03:00
CODEOWNERS Update CODEOWNERS and add christian-byrne (#7663) 2025-04-19 17:23:31 -04:00
comfyui_version.py ComfyUI version 0.3.34 2025-05-12 15:58:28 -04:00
comfyui-n.bat Create comfyui-n.bat 2025-05-02 18:05:04 +03:00
comfyui.bat removed pytorch garbage collection settings. 2024-12-30 15:03:01 +03:00
comfyui.png Add files via upload 2024-11-21 10:46:38 +03:00
CONTRIBUTING.md Add CONTRIBUTING.md (#3910) 2024-07-01 13:51:00 -04:00
cuda_malloc.py Update cuda_malloc.py 2024-08-30 12:19:50 +03:00
deepcache-sample.json Update deepcache-sample.json 2025-02-01 01:59:43 +03:00
execution.py Add support for Comfy API keys (#8041) 2025-05-10 22:10:58 -04:00
extra_model_paths.yaml.example add 'is_default' to model paths config (#4979) 2024-09-19 08:59:55 -04:00
fix_torch.py Lint all unused variables (#5989) 2024-12-12 17:59:16 -05:00
fix-update.bat Create fix-update.bat 2024-09-14 16:14:34 +03:00
fixforrx580.bat Update fixforrx580.bat 2025-04-24 14:53:14 +03:00
fluxguide.md Update fluxguide.md 2025-01-07 14:02:01 +03:00
folder_paths.py Add support for VIDEO as a built-in type (#7844) 2025-04-29 05:58:00 -04:00
hook_breaker_ac10a0.py Prevent custom nodes from hooking certain functions. (#7825) 2025-04-26 20:52:56 -04:00
install-for-older-amd.bat Update install-for-older-amd.bat 2025-04-24 14:53:48 +03:00
install-n.bat Add files via upload 2025-05-02 18:17:46 +03:00
install.bat Update install.bat 2025-04-24 14:52:34 +03:00
latent_preview.py Convert latents_ubyte to 8-bit unsigned int before converting to CPU (#6300) 2025-01-28 08:22:54 -05:00
LICENSE Initial commit. 2023-01-16 22:37:14 -05:00
main.py Add a way to disable api nodes: --disable-api-nodes (#7960) 2025-05-06 04:53:53 -04:00
new_updater.py Replace print with logging (#6138) 2024-12-20 16:24:55 -05:00
node_helpers.py Fix problem. 2025-04-03 20:57:59 -04:00
nodes.py implement APG guidance (#8081) 2025-05-12 21:10:24 -04:00
patchzluda2.bat Update patchzluda2.bat 2025-04-24 14:55:12 +03:00
patchzluda-n.bat Update patchzluda-n.bat 2025-05-02 18:18:59 +03:00
patchzluda.bat Update patchzluda.bat 2025-04-24 14:54:13 +03:00
pyproject.toml ComfyUI version 0.3.34 2025-05-12 15:58:28 -04:00
pytest.ini Execution Model Inversion (#2666) 2024-08-15 11:21:11 -04:00
README.md Update README.md 2025-05-13 16:58:07 +03:00
requirements.txt Update frontend to v1.19 (#8076) 2025-05-12 16:47:02 -04:00
server.py Add method to stream text to node UI (#8018) 2025-05-10 20:40:02 -04:00
start-tunableop-novram.bat Update start-tunableop-novram.bat 2024-08-30 16:07:10 +03:00
testzluda.py Add files via upload 2025-02-15 17:14:13 +03:00

ComfyUI-ZLUDA

Windows-only version of ComfyUI which uses ZLUDA to get better performance with AMD GPUs.

Table of Contents

What's New?

  • If you want to enable MIOPEN , Triton and Flash-Attention use the install-n.bat . This will install torch 2.7 , with latest nightly zluda and patch the correct files into comfyui-zluda. This features do not work very well and you are on your own if you want to try these. ---- You have to install HIP 6.2.4 - Download and extract HIP Addon inside the folder (information down below on installation section). ---

  • If you choose to install hip 6.2 instead of 5.7 (and make sure the path's are there) comfyui-zluda will install latest zluda not 3.8.4 like 5.7.1.

  • Florance2 is now fixed , (probably some other nodes too) you need to disable "do_sample" meaning change it from True to False, now it would work without needing to edit it's node.

  • Added onnxruntime fix so that it now uses cpu-only regardless of node. So now nodes like pulid, reactor, infiniteyou etc works without problems and can now use codeformer too.

  • Added installing the new required package to be installed comfyui-frontend-package inside zluda patch, comfyui removed its web frontend from the main and it is now to be installed like the other packages, new installs will do this but previous users have to install it somehow. So here it is. It will install only one time and that would be brief. So don't be afraid if you see "Comfyui Frontend Package installed." in the commandline.

  • Changed how ZLUDA is patched into the Comfyui itself. Now code is in external file , much cleaner and easier for me the change if it becomes necessary.

  • Added a way to use any zluda you want (to use with HIP versions you want to use such as 6.1 - 6.2) After installing, close the app, run patchzluda2.bat. It will ask for url of the zluda build you want to use. You can choose from them here, lshyqqtiger's ZLUDA Fork then you can use patchzluda2.bat, run it paste the link via right click (A correct link would be like this, https://github.com/lshqqytiger/ZLUDA/releases/download/rel.d60bddbc870827566b3d2d417e00e1d2d8acc026/ZLUDA-windows-rocm6-amd64.zip) After pasting press enter and it would patch that zluda into comfy for you.

  • Reverted zluda version back to 3.8.4. After updating try running patchzluda and if still have problems, delete venv and re-run install.bat.

  • U̶p̶d̶a̶t̶e̶d̶ Z̶L̶U̶D̶A̶ v̶e̶r̶s̶i̶o̶n̶ t̶o̶ 3̶.8̶.5̶. I̶f̶ y̶o̶u̶ h̶a̶v̶e̶ a̶l̶r̶e̶a̶d̶y̶ i̶n̶s̶t̶a̶l̶l̶e̶d̶ c̶o̶m̶f̶y̶u̶i̶-̶z̶l̶u̶d̶a̶, y̶o̶u̶ c̶a̶n̶ u̶p̶d̶a̶t̶e̶ z̶l̶u̶d̶a̶ w̶i̶t̶h̶ r̶u̶n̶n̶i̶n̶g̶ ̶p̶a̶t̶c̶h̶z̶l̶u̶d̶a̶.b̶a̶t̶̶ o̶n̶c̶e̶. O̶f̶ c̶o̶u̶r̶s̶e̶, r̶e̶m̶e̶m̶b̶e̶r̶ t̶h̶e̶ f̶i̶r̶s̶t̶ t̶i̶m̶e̶ f̶o̶r̶ e̶v̶e̶r̶y̶ t̶y̶p̶e̶ o̶f̶ m̶o̶d̶e̶l̶ w̶o̶u̶l̶d̶ t̶a̶k̶e̶ e̶x̶t̶r̶a̶ t̶i̶m̶e̶.

  • Added a "small flux guide." This aims to use low vram and provides the very basic necessary files needed to get flux generation running. HERE

  • Added --reserve-vram with the value of 0.9 to commandline options that run with the app on startup. Greatly helps reduce using too much memory on generations.

  • Changed start.bat to comfyui.bat because there is already a windows command by that name, which creates some problems. Also added fix-update.bat which solves the problem that causes not being able to update to the latest version.

Important

📢 REGARDING KEEPING THE APP UP TO DATE

Avoid using the update function from the manager, instead use git pull, which we are doing on every start if start.bat is used. (App Already Does It Every Time You Open It, If You Are Using comfyui.bat, So This Way It Is Always Up To Date With Whatever Is On My GitHub Page)

Only use comfy manager to update the extensions (Manager -> Custom Nodes Manager -> Set Filter To Installed -> Click Check Update On The Bottom Of The Window) otherwise it breaks the basic installation, and in that case run install.bat once again.

📢 REGARDING RX 480-580 AND SIMILAR GPUS

After a while we need to keep updating certain packages to keep up with the original app and certain requirements of some models etc. So, torch is changed over time , but this gave gpu's prior to rdna some negative performance. So for these gpu's please use fixforrx580.bat if you are having memory problems too much slowdown etc. This is not mandatory and it won't just make your gpu faster then before but it would be less problematic then using latest torch that we use with other gpu's.

📢 RANDOM TIPS & TRICKS REGARDING USING AMD GPU'S

  • The generation speed is slower than nvidia counterparts we all know and accept it, but most of the time the out of memory situation at the end with VAE decoding is worse. To overcome this use "--cpu-vae". Add it to commandline_args on comfyui.bat. You can now decode using your system memory (the more the memory the better) and your cpu power. This might be slower but at least it works.

Dependencies

If coming from the very start, you need :

  1. Git: Download from https://git-scm.com/download/win. During installation don't forget to check the box for "Use Git from the Windows Command line and also from 3rd-party-software" to add Git to your system's PATH.

  2. Python (3.10.11 3.11 also works, but 3.10 is used by most popular nodes atm): Install the latest release from python.org. Don't Use Windows Store Version. If you have that installed, uninstall and please install from python.org. During installation remember to check the box for "Add Python to PATH when you are at the "Customize Python" screen.

  3. Visual C++ Runtime: Download vc_redist.x64.exe and install it.

  4. Install HIP SDK 5.7.1 from HERE the correct version, "Windows 10 & 11 5.7.1 HIP SDK"

    *** (*** this app installs zluda for 5.7.1 by default, if you want to use 6.1 or 6.2 you have to get the latest zluda link from lshyqqtiger's ZLUDA Fork then you can use patchzluda2.bat, run it paste the link via right click (a correct link would be like this, https://github.com/lshqqytiger/ZLUDA/releases/download/rel.d60bddbc870827566b3d2d417e00e1d2d8acc026/ZLUDA-windows-rocm6-amd64.zip press enter and it would patch that zluda into comfy for you. Of course this also would mean you have to change the variables below from "5.7" to "6.x" where needed) ***

  5. Add the system variable HIP_PATH, value: C:\Program Files\AMD\ROCm\5.7\ (This is the default folder with default 5.7.1 installed, if you have installed it on another drive, change if necessary, if you have installed 6.2.4, or other newer versions the numbers should reflect that.)

    1. Check the variables on the lower part (System Variables), there should be a variable called: HIP_PATH.
    2. Also check the variables on the lower part (System Variables), there should be a variable called: "Path". Double-click it and click "New" add this: C:\Program Files\AMD\ROCm\5.7\bin (This is the default folder with default 5.7.1 installed, if you have installed it on another drive, change if necessary, if you have installed 6.2.4, or other newer versions the numbers should reflect that.)

    ((( these should be HIP_PATH, value: C:\Program Files\AMD\ROCm\6.2\ and Path variable C:\Program Files\AMD\ROCm\6.2\bin )))

  6. If you have an AMD GPU below 6800 (6700,6600 etc.), download the recommended library files for your gpu

  • from Brknsoul Repository (for hip 5.7.1)

  • from likelovewant Repository (for hip 6.2.4)

    1. Go to folder "C:\Program Files\AMD\ROCm\5.7\bin\rocblas", there would be a "library" folder, backup the files inside to somewhere else.
    2. Open your downloaded optimized library archive and put them inside the library folder (overwriting if necessary): "C:\Program Files\AMD\ROCm\5.7\bin\rocblas\library"
      • There could be a rocblas.dll file in the archive as well, if it is present then copy it inside "C:\Program Files\AMD\ROCm\5.7\bin\rocblas"
  1. Reboot your system.

Setup (Windows-Only)

Open a cmd prompt. (Powershell doesn't work, you have to use command prompt.)

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

((( use install-n.bat if you want to install for miopen-triton combo for high end gpu's )))

to start for later use (or create a shortcut to) :

comfyui.bat

((( use comfyui-n.bat if you want to use miopen-triton combo for high end gpu's, that basically changes the attention to pytorch attention which works with flash attention )))

YOU NEED TO DO THESE ADDITIONAL STEPS : if you want to try miopen-triton with high end gpu :
* install hip 6.2.4 from the url above then download hip sdk addon from this url `https://drive.google.com/file/d/1JSVDV9yKCJ_vldXb5hS7NEHUeDJGoG6M/view?usp=sharing` and extract that into `C:\Program Files\AMD\ROCm\6.2`
* To install triton package , FOR PYTHON 10 : `https://github.com/lshqqytiger/triton/releases/download/bb314b47/triton-3.3.0+gitbb314b47-cp310-cp310-win_amd64.whl`
                              FOR PYTHON 11: `https://github.com/lshqqytiger/triton/releases/download/5dcd7566/triton-3.3.0+git5dcd7566-cp311-cp311-win_amd64.whl`
  Download correct package for the python version you are using into the comfyui-zluda folder THEN
  Enter the comfyui-zluda directory, open up commandline. Enter venv :
  venv\scripts\activate (enter)
  pip install triton-3.3.0+gitbb314b47-cp310-cp310-win_amd64.whl (or the other file if you have downloaded that version) (enter)  

--- To install flash-attention package and use "flash-attention" in comfyui :
  - Add this line to comfyui-n.bat
  `set FLASH_ATTENTION_TRITON_AMD_ENABLE=TRUE`
  And change the `--use-pytorch-cross-attention` to `--use-flash-attention`
  2 - Download and extract this into comfyui-zluda folder, `https://github.com/user-attachments/files/20140536/flash_attn-2.7.4.post1-py3-none-any.zip`
  3 - THEN activate the venv and install the "flash_attn-2.7.4.post1-py3-none-any.whl"
      env\scripts\activate (enter)
      pip install flash_attn-2.7.4.post1-py3-none-any.whl  (enter) 

--- To use sage-attention , you have to change the "--use-pytorch-cross-attention" to "--use-sage-attention". My advice is make a seperate batch file for all different attention types instead of changing them.

also for later when you need to repatch zluda (maybe a torch update etc.) you can use:

patchzluda.bat

((( patchzluda-n.bat for miopen-triton setup)))

  • The first generation would take around 10-15 minutes, there won't be any progress or indicator on the webui or cmd window, just wait. Zluda creates a database for use with generation with your gpu.

Note

This might happen with torch changes , zluda version changes and / or gpu driver changes.

Troubleshooting

  • If you installed miopen-triton setup with install.n.bat , getting ":: Triton core imported successfully , :: Running Triton kernel test... , :: Triton test failed , :: Triton available but failed verification" Do this to fix it :
    • Copy "libs" folder from python install directory under(C:\Users\username\AppData\Local\Programs\Python\Python310) Or 311 , whatever python you are using, to under "comfyui-zluda\venv" so ,
    • For example : "C:\Users\username\AppData\Local\Programs\Python\Python310\libs" to "d:\Comfyui-Zluda\venv* Beware, there are two similar folders under venv , "Lib" and "Library" , so this would be a similarly named folder , don't mistake them. Then try running comfy again.
  • DO NOT use non-english characters as folder names to put comfyui-zluda under.
  • Wipe your pip cache "C:\Users\USERNAME\AppData\Local\pip\cache" You can also do this when venv is active with : pip cache purge
  • xformers isn't usable with zluda so any nodes / packages that require it doesn't work. Flash attention doesn't work.
  • Have the latest drivers installed for your amd gpu. Also, Remove Any Nvidia Drivers you might have from previous nvidia gpu's.
  • If you see zluda errors make sure these three files are inside "ComfyUI-Zluda\venv\Lib\site-packages\torch\lib" cublas64_11.dll (231kb) cusparse64_11.dll (199kb) nvrtc64_112_0.dll (129kb) If they are there but much bigger in size please run : patchzluda.bat (this is for zluda 3.8.4, other versions might be different sizes)
  • If for some reason you can't solve with these and want to start from zero, delete "venv" folder and re-run install.bat
  • If you can't git pull to the latest version, run these commands, git fetch --all and then git reset --hard origin/master now you can git pull
  • Problems with caffe2_nvrtc.dll: if you are sure you properly installed hip and can see it on path, please DON'T use python from windows store, use the link provided or 3.11 from the official website. After uninstalling python from windows store and installing the one from the website, be sure the delete venv folder, and run install.bat once again.
  • rocBLAS-error: If you have an integrated GPU by AMD (e.g. AMD Radeon(TM) Graphics) you need to add HIP_VISIBLE_DEVICES=1 to your environment variables. Other possible variables to use : ROCR_VISIBLE_DEVICES=1 HCC_AMDGPU_TARGET=1 . This basically tells it to use 1st gpu -this number could be different if you have multiple gpu's- Otherwise it will default to using your iGPU, which will most likely not work. This behavior is caused by a bug in the ROCm-driver.
  • Lots of other problems were encountered and solved by users so check the issues if you can't find your problem here.

Credits