引言
在人工智能的大潮中,Stable Diffusion如一颗璀璨的明珠,以其强大的功能和独特的魅力,引领着我们走向一个全新的艺术领域。它不仅是一款AI绘画工具,更是一种创新的艺术表达方式。如果你对人工智能充满好奇,渴望亲自体验并玩转这项最新技术,那么,你找对了地方。
我们将为你提供详尽的指南,指导你如何使用和掌握Stable Diffusion,让你能够亲自感受到人工智能带来的无限可能性和创新乐趣。不论你是否有相关经验,我们都将陪伴你一步步探索,一同发现Stable Diffusion如何将你的创造力推向新的高度。让我们共同踏上这个充满挑战和乐趣的旅程,探索人工智能的无穷魅力吧!
我的Mac
配置信息:

1、安装Home Brew

在开始我们需要安装下 Home Brew, 可以直接复制下面代码到终端并执行
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
安装一些项目所需要的依赖包:
brew install python@3.11.2
2、拉取 Stable Diffusioin Web UI 代码库
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
3、启动WebUI
进入项目,执行webui.sh
脚本
bash
cd stable-diffusion-webui
./webui.sh
等待: 这一步会比较久, 需要耐心等待......

踩坑记录
(1) HTTP/2 stream 1 was not closed cleanly before end of the underlying stream ./webui.sh: line 196: cd: stable-diffusion-webui/: No such file or directory

(2) Traceback (most recent call last):
File "/Users/kerry/Desktop/stable-diffusion-webui/launch.py", line 48, in
RuntimeError: Couldn't install requirements.

(3) Installing clip
Traceback (most recent call last):
File "/Users/kerry/Desktop/practice_day/AIGC-ChatGPT/stable-diffusion-webui/launch.py", line 48, in
main()
File "/Users/kerry/Desktop/practice_day/AIGC-ChatGPT/stable-diffusion-webui/launch.py", line 39, in main
prepare_environment()
File "/Users/kerry/Desktop/practice_day/AIGC-ChatGPT/stable-diffusion-webui/modules/launch_utils.py", line 393, in prepare_environment
run_pip(f"install {clip_package}", "clip")
File "/Users/kerry/Desktop/practice_day/AIGC-ChatGPT/stable-diffusion-webui/modules/launch_utils.py", line 143, in run_pip
return run(f'"{python}" -m pip {command} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}", live=live)

4、启动成功
启动成功之后,会开启一个本地web服务,下面提示报错,是因为没有模型。

http://127.0.0.1:7860/

到这里之后,咱们发现没有可供选择的模型。
5、下载模型
在这里我们需要提前下载好一个基本的 模型, 点击 这里 进入下载页


下载好模型后, 需要将模型文件放到 stable-diffusion-webui/models/Stable-diffusion 目录下
模型下载源这里推荐 C 站, 在这上面我们可以下载各种风格的模型

选择everclear-pny-by-zovya 模型进行下载。

同上,将下载后的模型复制到 stable-diffusion-webui/models/Stable-diffusion 目录下;

然后咱们就可以看到可选择的模型

6、汉化
该项目呢全都是英文,页面有涉及了很多参数配置,所以汉化一下方便理解就很有必要了。
汉化包 stable-diffusion-webui-chinese,也是作者提供的,两种汉化方式,咱们就选择第一种。
6.1 安装依赖包
方法1:通过WebUI拓展进行安装
1.打开stable diffusion webui,进入"Extensions"选项卡
2.点击"Install from URL",注意"URL for extension's git repository"下方的输入框
3.粘贴或输入本Git仓库地址github.com/VinsonLaro/...
4.点击下方的黄色按钮"Install"即可完成安装,然后重启WebUI(点击"Install from URL"左方的"Installed",然后点击黄色按钮"Apply and restart UI"网页下方的"Reload UI"完成重启)
5.点击"Settings",左侧点击"User interface"界面,在界面里最下方的"Localization (requires restart)",选择"Chinese-All"或者"Chinese-English"
6.点击界面最上方的黄色按钮"Apply settings",再点击右侧的"Reload UI"即可完成汉化

安装完成后, 我们还需要, 重新加载下 UI, 这里直接点击页面底部的 Reload UI 即可

6.2 配置语言
打开 Settings -> User interface -> Localization
, 选择 chinese-english-0313

选择完成之后,保存配置
并重新加载UI

汉化后的效果

7、测试
我们尝试在界面选择模型
-> 提示语
-> 点击生成
, 等待片刻... 即将完成一副巨作
选择模型之后,正在进行加载中,这里需要点时间,patience。。。。


提示语:(masterpiece, best quality), 1girl, dress, wavy hair, lying, bare shoulders, blonde, jewelry, frills, (((intricate, pattern, psychedelic, surreal, abstract, swirl))), solo focus, heterochromia, splashing, vivid
