0 Stable Diffusion Webui OpenVINO 脚本安装教程 (预览)
Qiacheng Li edited this page 2023-08-17 11:57:38 -07:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Stable Diffusion Webui + Intel OpenVINO 加速脚本 (预览版)

Stable Diffusion Webui 现在可以使用Intel® Distribution of OpenVINO™ 在Intel CPU和GPU集成和独立显卡等硬件上运行。这是一个正在开发中的项目我们热烈欢迎社区提供反馈与支持。

重要注意事项

为了能在Windows上获得最佳性能 请按以下步骤运行 webui-user.bat

  • 以管理员身份启动命令提示符。
  • cd stable-diffusion-webui
  • .\webui-user.bat

以下的一些功能在OpenVINO加速脚本中尚不支持

  • hires fix
  • custom scripts

安装说明

Windows:

git clone https://github.com/openvinotoolkit/stable-diffusion-webui.git
cd stable-diffusion-webui
first-time-runner.bat
torch-install.bat
  • 在所有WebUI环境条件安装完成后以管理员身份启动命令提示符并 cdstable-diffusion-webui 目录。
  • 运行webui-user.bat
  • 按照此处的说明使用OpenVINO的自定义脚本。

PyTorch 目前在Windows上尚未官方支持torch.compile。使用以下方法可以在Windows上利用该功能或使用torch-install.bat 自动更改eval_frames.py文件

  • 从此处 下载经过验证的PyTorch预览版2.1.0.dev20230713
  • 更改文件venv/Lib/site-packages/torch/_dynamo/eval_frames.py。
def check_if_dynamo_supported():
    if sys.platform == "win32":
        raise RuntimeError("Windows not yet supported for torch.compile")
    if sys.version_info >= (3, 11):
        raise RuntimeError("Python 3.11+ not yet supported for torch.compile")
  • 找到名为check_if_dynamo_supported()的函数,将位于该函数的前两行注释掉。
def check_if_dynamo_supported():
    #if sys.platform == "win32":
    #    raise RuntimeError("Windows not yet supported for torch.compile")
    if sys.version_info >= (3, 11):
        `raise RuntimeError("Python 3.11+ not yet supported for torch.compile")

已知问题

将采样方法更改为DPM++或Karras方法会重新编译模型因为它对图表进行了修改。建议在性能测量中排除首次生成图像所需的时间。 目前Regular Stable Diffusion 2.1在独显上存在已知问题。建议使用Stable Diffusion 2.1-base版本。