B580 安装 AI 绘图软件

真难装啊。

Intel AI Playground

安装界面的Open Developer Logs 打开开发者日志。

错误1:找不到文件 ls_level_zero.exe

index-BQ9fiPcb.js:133 [lslevelzero] Failed to detect device due to Error: File at C:\Program Files\AI Playground\resources\ai-backend-env\Library\bin\ls_level_zero.exe does not exist

这个目录下有这个文件,复制一份过去。C:\Program Files\AI Playground\resources\service\tools

错误2:ls_level_zero.exe failed 3221225781

index-BQ9fiPcb.js:133 [lslevelzero] Failed to detect device due to Error: command C:\Program Files\AI Playground\resources\ai-backend-env\Library\bin\ls_level_zero.exe failed 3221225781

直接运行 ls_level_zero.exe 报错误3。

错误3:找不到 sycl7.dll

由于找不到 sycl7.dll ,无法继续执行代码,重新安装程序可能会解决此问题。

需要安装 Intel® oneAPI DPC++/C++ Compiler Runtime for Windows* https://www.intel.com/content/www/us/en/developer/articles/tool/compilers-redistributable-libraries-by-version.html

然后把C:\Users\用户名\AppData\Local\uv\cache\archive-v0\1SsnX0ZnTVYaIo5iF-vqh\intel_sycl_rt-2024.2.1.data\data\Library\bin添加到系统变量的path里面。 或者直接把这两个文件,pi_win_proxy_loader.dll,sycl7.dll复制到C:\Program Files\AI Playground\resources\ai-backend-env\Library\bin\。

错误4:找不到 requirements-unknown.txt

ai-backend executing in stage Detecting intel device. Debugmessage: detected intel hardware unknown index-BQ9fiPcb.js:21 ai-backend executing in stage install dependencies. Debugmessage: installing dependencies index-BQ9fiPcb.js:133 [ai-backend] Set up of service failed due to Error: File at C:\Program Files\AI Playground\resources\service\requirements-unknown.txt does not exist

requirements.txt 是 python 储存依赖信息的文件,程序根据其内容来下载所依赖的程序。Intel根据不同硬件准备了不同的 requirements-设备名.txt,但是这里检测不到硬件,所以硬件类型是unknown。鉴于我的显卡是B580,Battlemage,所以我把requirements-bmg.txt复制了一份,改成requirements-unknown.txt。

出错就多运行几次,或者上午0-12点再安装,这个时候国内外网络比较通畅。

Stable Diffusion

只有SD.next 和 ComfyUI ,按说明安装后,就能运行。

ComfyUI

git clone https://github.com/comfyanonymous/ComfyUI.git
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/xpu
python main.py

SD.Next

git clone https://github.com/vladmandic/sdnext
cd sdnext
.\webui.bat --use-ipex

openvinotoolkit/stable-diffusion-webui

它的问题在于无法启用 GPU 加速,只能用 CPU ,但是它又可以占用GPU显存,就很奇怪。

git clone https://github.com/openvinotoolkit/stable-diffusion-webui 安装 python 3.10 ,有高版本的要卸载掉。 创建pip 文件,换成国内源。C:\Users\用户名\pip\pip.ini

[global]
timeout = 6000
index-url = https://mirrors.aliyun.com/pypi/simple
trusted-host = mirrors.aliyun.com

下载 https://huggingface.co/openai/clip-vit-large-patch14/tree/main 放到 stable-diffusion-webui/openai

报错1:加载脚本出错: openvino_accelerate.py

*** Error loading script: openvino_accelerate.py Traceback (most recent call last): File “D:\github\stable-diffusion-webui\modules\scripts.py”, line 382, in load_scripts script_module = script_loading.load_module(scriptfile.path) File “D:\github\stable-diffusion-webui\modules\script_loading.py”, line 10, in load_module module_spec.loader.exec_module(module) File “”, line 883, in exec_module File “”, line 241, in call_with_frames_removed File “D:\github\stable-diffusion-webui\scripts\openvino_accelerate.py”, line 47, in from diffusers import ( File “D:\github\stable-diffusion-webui\venv\lib\site-packages\diffusers_init.py”, line 5, in from .utils import ( File “D:\github\stable-diffusion-webui\venv\lib\site-packages\diffusers\utils_init_.py”, line 38, in from .dynamic_modules_utils import get_class_from_dynamic_module File “D:\github\stable-diffusion-webui\venv\lib\site-packages\diffusers\utils\dynamic_modules_utils.py”, line 28, in from huggingface_hub import HfFolder, cached_download, hf_hub_download, model_info ImportError: cannot import name ‘cached_download’ from ‘huggingface_hub’ (D:\github\stable-diffusion-webui\venv\lib\site-packages\huggingface_hub_init_.py)

解决方法如下,来源:

  1. 把 huggingface_hub==0.20.2 添加到 requirements_versions.txt
  2. 进入 venv ( windows 系统就是打开命令提示符 cmd 或者 powershell 运行 venv\Scripts\activate.bat)
  3. 运行 pip install -r requirements_versions.txt
  4. 运行 webui-user.bat

开了OpenVINO加速脚本,居然8分钟一张图,用CPU也就3分钟一张,怎么负优化了,我不理解。 :evil:

秋叶一键包

环境安装界面,pythorch 下拉菜单没有任何项目,无法安装。