电脑配置
| 项目 | 详情 |
|---|---|
| cpu | i3-12100F |
| 内存 | 16G |
| 显卡 | MTT S70 |
| 硬盘 | C:\ 512G |
安装过程
安装git
安装python3.10.6
同步sd工程:git clone github.com/AUTOMATIC11…
运行脚本安装:在工程目录运行.\webui-user.bat
直到最后显示如下报错,因为我没有使用N卡,发生这个错误也理所当然,后续会继续探索如何基于摩尔线程的卡搭建sd环境。
Traceback (most recent call last): File "C:\Users\wu\Documents\GitHub\stable-diffusion-webui\launch.py", line 48, in <module> main() File "C:\Users\wu\Documents\GitHub\stable-diffusion-webui\launch.py", line 39, in main prepare_environment() File "C:\Users\wu\Documents\GitHub\stable-diffusion-webui\modules\launch_utils.py", line 356, in prepare_environment raise RuntimeError( RuntimeError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check
2023.11.27
与摩尔线程工作人员友好交流之后得知需要安装torch_musa把cuda相关依赖替换掉即可,但是看torch_musa文档似乎仅在linux环境下验证过。所以暂时把GPU部分搁置,现在CPU中把流程跑通。
CPU运行命令:.\webui.bat --use-cpu sd --skip-torch-cuda-test
首次运行时会安装依赖项,但是由于网络原因安装过程非常困难,经常因为pip install超时报错,将stable-diffusion-webui\modules\launch_utils.py中pip install部分加上-i pypi.tuna.tsinghua.edu.cn/simple 改用国内源解决。
Collecting scipy Downloading scipy-1.11.4-cp310-cp310-win_amd64.whl (44.1 MB) --------- 10.9/44.1 MB 101.2 kB/s eta 0:05:29 stderr: ERROR: Exception:
另外一个问题是github上某个包找不到,不清楚具体原因,解决办法是手动clone到本地后git archive打包再把链接指向本地文件。
解决完上述问题后即可打开webui。
但是现在仍然无法顺利跑图,查看报错原因是缺少模型文件,现在三方模型文件分享论坛已经被屏蔽得七七八八了,先下载一个V1.5的原始模型
模型文件放到stable-diffusion-webui\models\Stable-diffusion目录,重新运行webui,仍然有以下错误
OSError: Can't load tokenizer for 'openai/clip-vit-large-patch14'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'openai/clip-vit-large-patch14' is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer.
看起来还是网络问题,无法下载tokenizer,huggingface也无法访问了,从其他镜像源clone一个tokenizer仓库,仓库中含有较大体积的模型文件,并不是必要的,只需要将如下文件(6个.json,1个.txt,1个.md)copy到stable-diffusion-webui\openai\clip-vit-large-patch14目录即可(webui环境以工程目录作为根目录)。
接下来再次运行webui并加载模型,即可成功跑图了
cmd打印日志也可以看到加载模型成功
稍后会继续探索windows环境下利用摩尔线程显卡部署stable diffusion的过程。