Easy Install Comfy UI on PC (Windows/Mac/Linux)

install Comfy UI on Windows/Mac/Linux

Whether you are a Windows, Mac, or Linux user, we will help you to install ComfyUI on your PC. ComfyUI is the Web User Interface for running Stable Diffusion which can be managed locally or remotely on any machine.

After releasing of this Webui, it gained huge popularity amongst AI Artists. 

Well, Comfyui gives you a flow-to-model architecture that helps us to understand how the different modules (nodes) are connected with one another which is beginner-friendly. In simple words, it's easy to understand.

Apart from this, we have a detailed understanding of various ComfyUI nodes which will give you a clear picture of each function.

Let's directly jump into the installation part.


Install Comfy UI on Windows :

The ComfyUI Standalone Portable Windows (For NVIDIA GPU) is the best way to download and setup with just a click. Using this method, you create a separate virtual directory which will not generate any installation conflict in the future.

1. First install Git by navigating to its official page.


Download Python

Add path to environment variable


2. Download Python 3.10.6 version and add the environment path by checking the option while installing.


3. If you don’t have the zip extractor then just download the 7ZIP for extracting the compressed files which we will going to download.



4. Now, move to the ComfyUI git hub repository by going to its official link provided below and clone the repository. Simply choose any drive where you want to install ComfyUI in your local machine. Move to the address bar and open your command prompt by typing "cmd". Then copy the following cloning command and paste into your command prompt and press "Enter".

git clone https://github.com/comfyanonymous/ComfyUI.git


Click run nvidia gpu bat file

7. After installation, go to the installed folder where you have installed the ComfyUI folder select the “run_nvidia_gpu.bat” file and just right-click on it to create a shortcut to your desktop.


Download ComfyUI Manager

Now you also need to install ComfyUI Manager that will help you in installing and managing custom nodes. To install this, download the batch file and save into installed "ComfyUI_windows_portable" folder.

start comfyui

Now, click the downloaded "install-manager-for-portable-version.bat" batch file to start the installation. Restart your ComfyUI to take effect.


8. If you have NVIDIA GPU installed on your machine and want to take the optimized performance of it then it's recommended to use the model from their official repo.

comfyUI folder

For that, you have to move to this folder "ComfyUI" by moving to this path: ComfyUI_windows_portable\ComfyUI_windows_portable\ComfyUI. This folder stores all  Comfy UI files that required to run it. 


install using repo for nvidia setup

Copy the following command given below to your command prompt for installing the Pytorch and Xformers 

pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121 

or 

Alternative:

you can also move to the official Github repo of Comfy UI  and copy the same link from there as you see in the above image.


open command prompt on Comfyui folder

10. Now go to the main ComfyUI folder and type cmd to open a command prompt on that section of ComfyUI.

install pytorch and xformers using cmd

 On the opened command prompt window just paste the command which you have copied. Well, this will give you the power to speed up the image generation and pytorch to run COMFY ui. 


install all requirements

11. Now go back to the GitHub repo and copy and paste the following command to your command prompt:

pip install requirements.txt

This will install all the necessary and required files used to run ComfUI.

hugging face

Civit ai

12. Now, we have to download any standard Stable Diffusion models either from CivitAi or Hugging Face for image generation.

There are multiple Stable Diffuion Models you can try :

Install Stable Diffusion XL

Install Stable Cascade

Install Stable Diffusion 3

Don't know how to work with Stable Diffusion Models? You can checkout our Models Category section.


save model into checkpoints folder

13. Download and store the following file in the folder section  "ComfyUI_windows_portable/ ComfyUI/models/checkpoints" as we show in the above image.

Click the shortcut on desktop to open comfyui

14. Finally, you have the portable version of the comfy UI on a Windows PC. Click on  run_nvidia_gpu.bat file to start ComfyUI available inside the ComfyUI root folder. Or just you can move this file to your desktop and click on the shortcut that we have created to start ComfyUI.


ComfyUI installed

15. Enjoy and start your image art generation with ComfyUI.


Install Comfy UI on Mac:

1. First, make sure you have installed the Git installed on your computer. If not, then you can go to Git official website to download and install the current version of Git on your Mac PC.


2. Now, to download the Comfy UI from the Github repo you need to go to the link:

https://github.com/comfyanonymous/ComfyUI


Now just open your terminal and use the “git clone https://github.com/comfyanonymous/ComfyUI” command to download from the Git repository or you can directly click on the “Code” button and then again click on “Download Zip” to download it.

3. After downloading it, just extract the folder using the 7Zip or WinRar application into whatever folder you want to keep in the files. 

 Keep patience if it takes time to download because the model is very larger in size.


4. Create an installation folder where the Comfy UI files are stored. In our case, we made a new folder named “AI”.

5.  Now, open your terminal of Mac by pressing the shortcut key:  Command + Space Bar and type terminal.


6.   Type into the terminal:   cd press once space, then drag and drop the created folder into your terminal like we have shown in the above image. This will just add the path to your created folder.


7. Now, we have to install an application named “Homebrew”. This is the package manager that helps the users to install and run open-source software. Install it by going to their official page.

mac terminal for comfyui install

8. Just copy the code for installation by clicking the COPY button. Move back to your terminal paste the code and press Enter. If it requests for a password just type your own Mac password and press Enter (twice). This installs all required dependencies like pip, python, etc.


mac terminal for comfyui install


9. Now, type brew doctor and press Enter.

If this gives you some error, you will see a Warning message just follow the steps and just copy and paste that command and press Enter.

 Again type brew doctor and you will get the message that Your system is ready to brew.  

10.  Now to check what Python version has got, type 

python3 –version 

and press Enter.  If you want to upgrade the Python version if Comfy UI is not supported then type

brew install python@3.11

Here, in our case, we are installing Python 3.11 which is the latest version. Place the latest version in place of 3.11 to get the new version installed.

If you are getting error for python version not supported then its recommended to install Python 3.10.6


Now, install PIP as well. Type this command and press enter :

pip3 install –upgrade pip setuptools


install pytorch

Now, install Pytorch. Go to pytorch official page copy the code for installation and paste it into Terminal and press Enter. At last, we have successfully installed all the dependencies to run ComfyUI.  


11. Now, just open your terminal and type:

git clone https://github.com/comfyanonymous/ComfyUI.git

This command helps to download from the Git repository or there is an alternative method as well. You can directly go to their repo click on the “Code” button then again click on “Download Zip” to download it.


12.  All the files have been downloaded to our newly created folder “AI”. Type on terminal:

cd and drag and drop the ComfyUI folder to the terminal. This copies the file path to the terminal. Press Enter. 

drag and drop ComfyUI folder


Again type

pip3 install -r requirements.txt

This will download and install all the libraries and files.


ComfyUI installed on Mac


Now you can open the Comfy UI application which runs stable diffusion by typing:

  python3 main.py

 A new URL will be provided called a local host (Starts from https://127.0.0.1……). Just copy and paste on into your browser, and ComfyUi will be opened to your browser. 

If you have turned off the Mac and want to open ComfY UI then just move into the ComfyUI home directory, open your terminal into that folder and type "python3 main.py" and you will get the dashboard in just a few seconds.

Now, the first time you run the default workflow you will get an error. Make sure you have already set all the settings of the basic Stable diffusion model from Hugging Face and set all the checkpoints/models (the huge ckpt/safetensors files) in the folder destination:

ComfyUI\models\checkpoints

There are multiple Stable Diffusion Models we have which you can follow:

Install Stable Diffusion XL

Install Stable Cascade

Install Stable Diffusion 3

 

Install Comfy UI on Linux:

1. Make sure you have installed the Git installed on your computer. If not, then you can go to Git's official website to download and install the current version of Git on your Linux-based system.

2. Now, to download the Comfy UI from Github repo you need to go to the link and copy the Github repo link.

Or 

Alternatively, if you just clone the repo then just use this command:

 git clone https://github.com/comfyanonymous/ComfyUI

And download from the Git repository.

3. After downloading it, just extract the folder into whatever folder you want to keep the files. To unzip the zipped folder using 7ZIP or WinRAR.

Note: Keep patience if it takes time because the model is very larger in size.

4. Now, make sure you have already set all the settings of Stable diffusion if you haven’t and set all the checkpoints/models (the huge ckpt/safetensors files) in the folder destination: ComfyUI\models\checkpoints


 Conclusion:

ComfyUI is the most easiest and understandable application for image generation. If you don't know the coding but still want to understand what is and where each segment is connecting to each other, then the connecting nodes make your life easier. 
Here, we have learned how to download and install ComfyUI which runs Stable Diffusion on Windows, Mac, and Linux.