ComfyUI Installation on Mac.
Comfy UI Installation Guide
Step 1: Check and Install Python 3.10 on Mac
Check for Python Installation:
Open Terminal on your Mac.
Type the following command to check if Python is installed:
python3 --version
- If Python 3.10 is installed, you will see something like 'Python 3.10.x'.
2. Install Python 3.10 (if not installed):
- If Python 3.10 is not installed, install it by running:
brew install python@3.10
- If you don't have Homebrew, install it with:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)
"
- After Homebrew is installed, re-run the command to install Python 3.10.
Step 2: Install pip and Verify Virtual Environment Tools
1. Ensure pip is Installed:
- After installing Python, check if pip is installed:
pip3 --version
- If pip is not installed, run:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
2. Verify or Install virtualenv:
- Check if virtualenv is installed:
virtualenv --version
- If not, install it with:
pip3 install virtualenv
Step 3: Install PyTorch
1. Install PyTorch:
- In Terminal, ensure you're using Python 3.10:
python3 --version
- Install PyTorch with:
pip3 install torch torchvision torchaudio
2. Verify the Installation:
- Check if PyTorch is installed correctly:
python3 -c "import torch; print(torch.__version__)"
Step 4: Clone Comfy UI from GitHub
1. Navigate to the Desired Directory:
- Open Terminal and go to the folder where you want to save Comfy UI:
cd ~/projects
- Create a new folder if needed:
mkdir -p ~/projects/comfy-ui
cd ~/projects/comfy-ui
2. Clone the Repository:
- Download the Comfy UI code with:
git clone https://github.com/comfyanonymous/ComfyUI.git
3. Go into the Project Folder:
- Navigate to the Comfy UI folder:
cd ComfyUI
Step 5: Set Up a Virtual Environment and Install Requirements
1. Create a Virtual Environment:
- Make sure you're in the Comfy UI folder:
cd ~/projects/comfy-ui/ComfyUI
- Create a virtual environment:
python3 -m venv venv
2. Activate the Virtual Environment:
- To start using the virtual environment, run:
source venv/bin/activate
3. Install Project Requirements:
- With the virtual environment active, install the necessary packages:
pip install -r requirements.txt
Step 6: Run the Application
1. Start the Application:
- Run the Comfy UI by typing:
python main.py
2. Turn Off the Virtual Environment:
- When you're done, you can turn off the virtual environment by typing:
deactivate