打开Terminal
安装Xcode
xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" in System Settings to install updates
出现这行,说明已经安装完成了
对版本
python3 --version
Python 3.11.5
pip3 --version
pip 23.2.1 from /opt/homebrew/lib/python3.11/site-packages/pip (python 3.11)
git --version
git version 2.39.2 (Apple Git-143)
brew install python3
brew install git
克隆Repo
<https://github.com/comfyanonymous/ComfyUI>
安装虚拟环境
cd ComfyUI
python3 -m venv venv
然后激活
source venv/bin/activate
安装Pytorch Nightly Build
# 注意,一定要安装nightly build,不能安装官网上的版本。
pip3 install --pre torch torchvision torchaudio --extra-index-url <https://download.pytorch.org/whl/nightly/cpu>
pip install git+https://github.com/pytorch/pytorch@refs/pull/114183/head git+https://github.com/pytorch/vision git+https://github.com/pytorch/audio
下载模型
# SDXL Turbo
<https://huggingface.co/stabilityai/sdxl-turbo/tree/main>
# Stable Video Diffusion
14 framerate
<https://huggingface.co/stabilityai/stable-video-diffusion-img2vid/tree/main>
25 framerate
<https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt/tree/main>
下载完成后把模型复制到这个目录里
cd models/checkpoints
安装comfiyui manager
cd custom_nodes
git clone <https://github.com/ltdrdata/ComfyUI-Manager>
安装Python 依赖包
cd ..
pip install -r requirements.txt
加载模型
cd models/checkpoints
启动ComfyUI
python main.py --force-fp16
加载 Work Flow
点击Manager,然后安装custom nodes
加载模型,就可以使用了