Mac 使用 ComfyUI
以下紀錄在 Mac 上安裝 ComfyUI 的步驟。
注意:ComfyUI 官方現在最推薦新手使用 桌面版應用程式(Windows 與 macOS 都有),這是目前最簡單、最省心的安裝方式,內建模型管理與更新。以下的手動安裝步驟則留給想自己控制環境、或需要客製化的使用者。
- 安裝 Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"- https://brew.sh/zh-tw/
- 安裝 Python
brew install cmake protobuf rust python@3.13 git wget
- 切換到你想放 ComfyUI 的位置,再執行 git clone
- git clone https://github.com/Comfy-Org/ComfyUI
- 切換到該資料夾的 ComfyUI 位置
- cd ComfyUI
- 執行 Python
- python3 -m venv venv
- 執行以下指令安裝
./venv/bin/pip install torch torchvision torchaudio./venv/bin/pip install -r requirements.txt
- 下載模型
- 下載下來的檔案副檔名可能是
.ckpt或.safetensors - 把下載完畢的模型放到 ComfyUI 中的
/models/checkpoints的路徑- /ComfyUI/models/checkpoints
- 啟動 ComfyUI
./venv/bin/python main.py
若想與 AUTOMATIC1111 Stable Diffusion WebUI 一起使用相同的模型的話,可以找到 extra_model_paths.yaml.example 這個檔案,它應該直接在 ComfyUI 的目錄下。
將檔案複製一份,並更改檔名為 extra_model_paths.yaml
打開後會看到
1 | a111: |
把 base_path: 更改為你的 AUTOMATIC1111 Stable Diffusion WebUI 位置。
1 | a111: |
最後重新啟動 ComfyUI 就可以了。
想更新的話,再資料夾中執行 git pull,然後再執行 ./venv/bin/python main.py 即可