Skip to main content
  1. projects/

Installing ComfyUI on macOS M2

timothysmith
AIMG Projects AI Software and Tools Tutorials and Guides Virtualization
Author
Timothy Smith
Head of Infrastructure
Table of Contents

Introduction
#

If you’ve recently acquired an M2 Mac and you’re eager to explore ComfyUI, you’re in the right place. ComfyUI offers a seamless user interface experience, and setting it up on your M2 Mac is a straightforward process. Let’s dive into the steps required to get ComfyUI up and running on your system.

Setting Up the Environment
#

Firstly, let’s create a directory where ComfyUI will reside. You can name this directory anything you like, but for clarity, let’s call it AI.

mkdir AI
cd AI

Next, let’s install Homebrew, a powerful package manager tailored for macOS. Visit the official Homebrew website to learn more about its features and benefits.

Visit Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

After Homebrew is installed we now need to install python3.11. We can check for current version first then if it is not installed we can install it:

python3 --version
brew install [email protected]

Now that Python3.11 is install we need to upgrade pip and setuptools

pip3 install --upgrade pip setuptools

Installing PyTorch
#

PyTorch is a crucial library for machine learning tasks, and we’ll need it for ComfyUI. Visit pytorch.org to get the installation command. After visiting the link, execute the following command:

pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu

Cloning and Installing ComfyUI
#

Now that we have the necessary dependencies set up, let’s clone the ComfyUI repository into our AI directory.

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

Install the required dependencies for ComfyUI.

pip3 install -r requirements.txt

Running ComfyUI
#

To run ComfyUI, navigate to the directory where it’s located.

cd ../ComfyUI

Execute the following command to start ComfyUI.

python3.11 main.py
to view ComfyUI click the link that looks similar to this: https://127.0.0.1:8188

Exiting ComfyUI
#

To exit ComfyUI at any time, you can press either CTRL+C or CMD+C in your terminal window.

Restarting ComfyUI
#

If you restart your computer, you’ll need to navigate back to the directory where ComfyUI is installed and rerun the command to start it.

That’s it! You’ve successfully installed and set up ComfyUI on your M2 Mac. Enjoy exploring its features and capabilities.

Related

Navigating Docker with Ease
timothysmith
Kasm Projects AIMG Projects Personal Projects Networking and Servers Software and Tools Tutorials and Guides Virtualization
Homer the Best Homelab Dashboard
timothysmith
AIMG Projects Personal Projects Software and Tools Tutorials and Guides Virtualization Web Development
TwinGate the Easiest VPN Out There
timothysmith
AIMG Projects Personal Projects Networking and Servers Software and Tools Tutorials and Guides Virtualization