本地部署stable-diffusion-webui
本地部署stable-diffusion-webui
stable-diffusion-webui是集成Stable Diffusion的web应用,可以更加方便的用来AI生图。
GitHub: https://github.com/AUTOMATIC1111/stable-diffusion-webui
安装步骤
电脑GPU配置推荐越高越好。
在Windows上自动安装:
- 安装Python 3.10.6(官网推荐,我本次使用的是 3.10.11),选中“将Python添加到PATH”
- 安装git
- 下载stable-diffusion-webui,运行
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git - 进入下载的文件夹路径下,双击执行
webui-user.bat
安装过程中确保网络通畅,安装完成后会自动打开web页面,但是是无法使用的,还需要下载模型。
下载模型
模型数量最多的两个网站是:
- https://civitai.com/ civitai又称c站
- https://huggingface.co/
可惜没有魔法访问不了,国内替代可以用:
下载模型后(一般为.safetensors格式的文件),放入 D:\<Your_Dirname>\stable-diffusion-webui\models\Stable-diffusion文件夹下。
关闭页面,和cmd窗口,然后重新执行webui-user.bat
接下来就可以愉快的AI生图了。
报错及解决
- 安装过程中确保网络通畅。(有些文件下载太慢或下载不了)+重启试试(关掉页面和cmd窗口,重新执行
webui-user.bat) - 安装过程中报错:
UserWarning: NVIDIA GeForce RTX 50XX with CUDA capability sm_120 is not compatible with the current PyTorch installation. The current PyTorch install supports CUDA capabilities sm_50 sm_60 sm_61 sm_70 sm_75 sm_80 sm_86 sm_90.
解决办法:python -m pip uninstall torch torchvision python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu128

浙公网安备 33010602011771号