建議先到 電腦上的 App Store 下載好 Xcode

或是到這個連結 https://developer.apple.com/download/all/?q=Xcode
安裝來源:Installation on Apple Silicon · AUTOMATIC1111/stable-diffusion-webui Wiki
新安裝:
- 如果未安裝 Homebrew,請按照 https://brew.sh 上的說明進行安裝。保持終端窗口打開並按照“後續步驟”下的說明將 Homebrew 添加到您的 PATH。
- 打開一個新的終端窗口並運行
brew install cmake protobuf rust python@3.10 git wget
- 通過運行克隆 Web UI 存儲庫
git clone
https://github.com/AUTOMATIC1111/stable-diffusion-webui
- 將要使用的穩定擴散模型/檢查點放入
stable-diffusion-webui/models/Stable-diffusion
. 如果您沒有,請參閱下面的下載穩定的擴散模型。 cd stable-diffusion-webui
然後./webui.sh
運行網絡用戶界面。將使用 venv 創建並激活 Python 虛擬環境,並且將自動下載並安裝任何剩餘的缺失依賴項。- 要稍後重新啟動 Web UI 進程,請
./webui.sh
再次運行。請注意,它不會自動更新網絡用戶界面;要更新,git pull
先運行再運行./webui.sh
。
現有安裝:
如果您已經安裝了使用 創建的 Web UI setup_mac.sh
,請從您的文件夾中刪除該run_webui_mac.sh
文件和文件夾。然後運行以更新 Web UI,然後運行它。repositoriesstable-diffusion-webuigit pull./webui.sh
啟動方法:
打開 「終端機」
輸入 cd stable-diffusion-webui enter
輸入 ./webui.sh enter

打開瀏覽器,輸入 http://127.0.0.1:7860

如何結束?
如果只是關掉瀏覽器視窗,是沒有真正關掉的,要到終端機,ctrl + C,就可以終止服務。
蔡教練的建議是把 http://127.0.0.1:7860 加到瀏覽器的書籤列上面
下次先打開終端機
輸入 cd stable-diffusion-webui enter
輸入 ./webui.sh enter
點一下網址就可以打開了
使用介面如何改成繁體中文:
中文化檔案下載網址:http://bit.ly/3kH4f6T
請放到以下位置:
Users/你的帳號/stable-diffusion-webui/localizations/





下載穩定的擴散模型
如果您沒有任何模型可以使用,可以從Hugging Face下載 Stable Diffusion 模型。要下載,請單擊模型,然後單擊標題Files and versions
。查找以“.ckpt”或“.safetensors”擴展名列出的文件,然後單擊文件大小右側的向下箭頭以下載它們。
一些流行的官方穩定擴散模型是:
- 穩定擴散 1.4 ( sd-v1-4.ckpt )
- 穩定擴散 1.5 ( v1-5-pruned-emaonly.ckpt )
- 穩定擴散 1.5 修復( sd-v1-5-inpainting.ckpt )
Stable Diffusion 2.0 和 2.1 需要模型和配置文件,生成圖像時圖像寬度和高度需要設置為 768 或更高:
配置文件,按住鍵盤上的option鍵點這裡下載v2-inference-v.yaml
(可能下載為v2-inference-v.yaml.yml
)。在 Finder 中選擇該文件,然後轉到菜單並選擇File
> Get Info
。在出現的窗口中選擇文件名並將其更改為模型的文件名,除了文件擴展名而不是.yaml
,.ckpt
按鍵盤上的回車鍵(如果出現提示,請確認更改文件擴展名),並將其放在與模型相同的文件夾中模型(例如,如果您下載了768-v-ema.ckpt
模型,請將其重命名為並與模型一起768-v-ema.yaml
放入)。stable-diffusion-webui/models/Stable-diffusion
還提供了穩定擴散 2.0 深度模型( 512-depth-ema.ckpt )。按住v2-midas-inference.yaml
鍵盤上的option點擊這裡下載配置文件,然後按照上面的方法用擴展名重命名,和模型一起.yaml
放入。stable-diffusion-webui/models/Stable-diffusion
請注意,此模型適用於 512 寬度/高度或更高而不是 768 的圖像尺寸。
故障排除
Web UI 無法啟動:
如果您在嘗試使用 啟動 Web UI 時遇到錯誤,請嘗試從您的文件夾中./webui.sh
刪除repositories
和文件夾,然後在再次運行之前更新 Web UI 。venvstable-diffusion-webuigit pull./webui.sh
表現不佳:
目前 macOS 上的 GPU 加速會佔用大量內存。--opt-split-attention-v1
如果性能不佳(如果使用任何採樣器生成 20 個步驟的 512×512 圖像需要超過一分鐘)首先嘗試從命令行選項(即)開始,看看./webui.sh --opt-split-attention-v1
是否有幫助。如果這沒有太大區別,則打開位於 /Applications/Utilities 中的 Activity Monitor 應用程序並檢查 Memory 選項卡下的內存壓力圖。如果生成圖像時內存壓力顯示為紅色,請關閉 web UI 進程,然後添加命令--medvram
行選項(即./webui.sh --opt-split-attention-v1 --medvram
)。如果該選項的性能仍然很差並且內存壓力仍然是紅色,那麼請嘗試--lowvram
(即./webui.sh --opt-split-attention-v1 --lowvram
). 如果使用任何採樣器生成 20 個步驟的 512×512 圖像仍然需要幾分鐘以上,那麼您可能需要關閉 GPU 加速。在 Xcode 中打開webui-user.sh
並更改#export COMMANDLINE_ARGS=""
為export COMMANDLINE_ARGS="--skip-torch-cuda-test --no-half --use-cpu all"
.
因為蔡教練手邊沒有PC,如果你是PC的使用者,想要安裝stable-diffusion
請看這部影片 2023年Stable Diffusion最新版本一鍵安裝教程,猴子可食~ – YouTube
蔡教練創作的作品展示:























我不只是教你使用蘋果電腦,我是協助你抓住你的靈感、管理你的數位資料的數位人生管理教練 https://rd.coach/about/
如果想要學更多可以的實體小班制:蘋果總裁班
蔡教練聯繫方式:http://bit.ly/3VGbjxv
蔡正信教練 0988-515-413
蔡教練官方Line: @appleceo https://lin.ee/1TgSReQ