建议:在 Mac 上安装 conda 环境
新建 Python 虚拟环境
$ conda create -n sd-webui python=3.10
# 切换到虚拟环境
$ 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
# 启动过程需要科学上网,会下载组建和克隆代码
$ ./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 了。
网友评论