一、安装环境
操作系统:win10
python 版本:3.10.15
CPU:i5-4590
内存:16GB
设备无独显
Git
二、安装步骤
Stable Diffusion WebUI 安装
克隆项目
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
下载预训练模型
地址:https://huggingface.co/CompVis
模型放置路径为:Stable Diffusion\stable-diffusion-webui\models\Stable-diffusion 目录下
后续其它模型均放置到该目录下
模型下载地址:
https://huggingface.co/models?other=stable-diffusion
安装 GFPGAN
GFPAN 是腾讯旗下的一个开源项目,可以用于修复和绘制人脸,减少stable diffusion人脸的绘制扭曲变形问题,下载后放置在 stable-diffusion-webui 根目录
项目地址:https://github.com/TencentARC/GFPGAN
运行stable-diffusion-webui
由于是 CPU 运行,没有 GPU 参与,因此需要修改 webui-user.bat 文件启动参数配置
set COMMANDLINE_ARGS= --lowvram --precision full --no-half --skip-torch-cuda-test
系统使用了 miniconda 管理 python 环境,需要使用 Anaconda Prompt 在项目根目录使用 Python 3.10 环境运行 webui-user.bat 文件
等……
等待……
等待下……
等待下载……
进行测试
在 web 面板中,左上角选择模型,在 prompt 中输入提示词,进行生成
使用 CPU 生图时间大概三分钟,效果如下:
三、遇到的错误
启动后遇到错误停止运行
解决方法:
webui-user.bat 文件启动参数配置新增:--listen
四、参考资料
https://blog.soarli.top/archives/698.html
https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/9074