Repository navigation
Installation on Intel Silicon
Stable Diffusion WebUI can now be run on hardware like Intel CPUs and GPUs (both integrated and discrete Graphics) with Intel® Distribution of OpenVINO™ toolkit. This is a preview support in active development and we actively welcome feedback and contributions from the community.
OpenVINO support is provided through a custom script [Link to custom scripts]. The custom script uses PyTorch's torch.compile feature and HuggingFace Diffusers library for improved performance. Below are the instructions to get started:
- Follow the instructions on Automatic1111 WebUI Github to set up the WebUI
- Install the prerequisites by following the instructions here
- Install OpenVINO in the same python environment by following the instructions here
- Set the environment variable COMMANDLINE_ARGS to
"--skip-torch-cuda-test --precision full --no-half". To access WebUI through a public URL from a remote machine, add additional arguments to COMMANDLINE_ARGS"--listen --share"
We use the diffusers library for improved performance with torch.compile. The recommended version is >= v0.17.0. Diffusers can be installed from PyPi: pip install diffusers
OpenVINO is integrated as a TorchDynamo backend in PyTorch and can be leveraged using "torch.compile". TorchDynamo is available from PyTorch 2.0 onwards.
Install PyTorch from PyPi using pip install torch
PyTorch doesn't support torch.compile officially on windows yet. However, the below workaround can be used
- Install the validated PyTorch nightly wheel file (2.1.0.dev20230713) from here [Add instruction]
- Update the file at <conda_env_root>/Lib/site-packages/torch/_dynamo/eval_frames.py
- Find the function called "check_if_dynamo_supported()" which looks like this (line 484):
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")
- Comment out the first two lines of this function. It should look like this:
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")
This is the Stable Diffusion web UI wiki. Wiki Home