-
Notifications
You must be signed in to change notification settings - Fork 44
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.
To achieve the best performance in WebUI on Windows, launch webui-user.bat using the following steps:
- Launch command prompt as administrator
- cd to stable-diffusion-webui directory
- run webui-user.bat
Some features are not supported at the moment with OpenVINO acceleration script:
- Hires Fix
- Other custom scripts
OpenVINO support is provided through a custom script. The custom script uses PyTorch's torch.compile feature and HuggingFace Diffusers library for improved performance. Below are the instructions to get started:
- If you are familiar with the Automatic1111 workflow, use this fork from OpenVINOToolKit instead of Automatic1111 and follow the instructions. Alternatively, follow the below instructions:
# Make sure Python version is 3.10+
python -m venv sd_env
source sd_env/bin/activate
git clone https://github.com/openvinotoolkit/stable-diffusion-webui.git
cd stable-diffusion-webui
export PYTORCH_TRACING_MODE=TORCHFX
export COMMANDLINE_ARGS="--skip-torch-cuda-test --precision full --no-half"
# Launch the WebUI
./webui.sh
- After launching the WebUI by running
./webui.sh
, Use the OpenVINO custom script by following the instructions here
- Download and install git and Python 3.10.6 (tick Add to PATH)
git clone https://github.com/openvinotoolkit/stable-diffusion-webui.git
cd stable-diffusion-webui
webui-user.bat
- Use the OpenVINO custom script by following the instructions here
Notes:
- The steps above will create a virtual environment and install the required packages into this environment. If you want to use your own virtual environment to run Stable Diffusion WebUI, please update
VENV_DIR=
lines toVENV_DIR=-
infirst-time-runner.bat
andtorch-install.ps1
files. - PyTorch doesn't support torch.compile officially on windows yet. Launching torch-install.bat installs PyTorch and enables torch.compile for OpenVINO backend.
To enable public access, please add "--share --listen" arguments into the COMMANLINE_ARGUMENTS
variable (On Windows, you can do this by updating webui-user.bat
file).
OpenVINO with torch.compile support is now available in preview in the OpenVINO prerelease package. Install the latest prerelease package from using the command pip install --pre openvino
OpenVINO can also be built from source using the instructions provided here
- Changing the sampling method to DPM++ or Karras methods recompiles the model due to some modifications it makes to the graph. It is recommended to exclude the time for first image generation for any performance measurements
- Regular Stable Diffusion 2.1 has known issues on discrete GPUs at this time. Please use the Stable Diffusion 2.1-base version instead.
This is the Stable Diffusion web UI wiki. Wiki Home