建議:在 Mac 上安裝 conda 環(huán)境
新建 Python 虛擬環(huán)境
$ conda create -n sd-webui python=3.10
# 切換到虛擬環(huán)境
$ conda activate sd-webui
開源代碼克隆到本地
$ git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
下載模型
到這個頁面下載模型:https://huggingface.co/stabilityai/stable-diffusion-2
模型名稱:768-v-ema.ckpt
-
拷貝模型到指定目錄:
Stable-diffusion-webui>Models>Stable-diffusion文件夾里
啟動項目
$ cd stable-diffusion-webui
# 啟動過程需要科學上網(wǎng),會下載組建和克隆代碼
$ ./webui.sh
...
Model loaded in 22.0s (load weights from disk: 1.7s, find config: 4.1s, create model: 0.3s, apply weights to model: 4.7s, apply half(): 10.5s, move model to device: 0.6s).
Running on local URL: http://127.0.0.1:7860
To create a public link, set `share=True` in `launch()`.
Startup time: 26.3s (import torch: 1.0s, import gradio: 0.8s, import ldm: 0.3s, other imports: 1.1s, load scripts: 0.4s, load SD checkpoint: 22.2s, create ui: 0.3s).
# 至此丙唧,可以打開瀏覽器愈魏,訪問:http://127.0.0.1:7860 了。