Skip to content

Instantly share code, notes, and snippets.

@wouterdebie
Last active June 13, 2024 08:03
Show Gist options
  • Save wouterdebie/b12d5a1160ef9de82cfb7be608f03bdf to your computer and use it in GitHub Desktop.
Save wouterdebie/b12d5a1160ef9de82cfb7be608f03bdf to your computer and use it in GitHub Desktop.
ComfyUI MacOS Apple Silicon install
#!/bin/bash
set -e
brew install llvm libomp python@3.11
export CC=$(brew ls --verbose llvm | grep -e 'bin/clang$')
export CXX=$(brew ls --verbose llvm | grep -e 'bin/clang++$')
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
python3.11 -m venv venv
. ./venv/bin/activate
pip install --upgrade pip
pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu
python -m pip install --no-binary :all: numpy
python -m pip install "diffusers[torch]"
python -m pip install tensorflow tensorflow-metal
python -m pip install onnxruntime onnxruntime-silicon
python -m pip install jax-metal
python -m pip install mlx coremltools
pip install -r requirements.txt
pip install wheel
pip install xformers
cd custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Manager.git
cd ..
## Install some extras that are necessary for some nodes
pip install --upgrade onnx transformers optimum omegaconf
# for ComfyUI_VLM_nodes
pip install llama-cpp-python
# For prompt_generator nodes
pip install tf-keras
# Arm64 isn't recognized by an older version of py-cpuinfo
sed -i .orig 's/py-cpuinfo==.*/py-cpuinfo==9/' ComfyUI_VLM_nodes/requirements.txt
python main.py --force-fp16 --fp16-vae --highvram
@wouterdebie
Copy link
Author

Thanks to m3pr0 on reddit for some extra tips.

@laurentVeliscek
Copy link

laurentVeliscek commented May 28, 2024

Hi !

Thanks for sharing your recipe to install a formula one comfyUI.

Everything seems to work fine until i get this error at the end of the script :

sed: ComfyUI_VLM_nodes/requirements.txt: No such file or directory

Macbook air M3 / sonoma

Any idea ?

@wouterdebie
Copy link
Author

@laurentVeliscek this requires you to install ComfyUI_VLM_nodes. This was more of a mental note for me though.

That said, I recommend using https://github.com/Comfy-Org/comfy-cli for the installation (at least I switched to it, rather than my script). It provides a great installation experience and handy management tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment