-
Notifications
You must be signed in to change notification settings - Fork 107
Run OneDiff on Windows by WSL2
If you have NVIDIA GPU driver installed locally, then you can use it directly in WSL. If not, please install the graphics card driver first.
1、Install WSL with the following command:
wsl --install
After successful execution, the result will look like this:
2、Enable the Linux subsystem with administrator privileges using the following command:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
After successful execution, the result will look like this:
3、Enable the Virtual Machine feature with administrator privileges using the following command:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
After successful execution, the result will look like this:
4、Set the default version of WSL to 2 with administrator privileges using the following command:
wsl --set-default-version 2
After successful execution, the result will look like this:
5、After restarting the computer, you can download the Ubuntu system from the Microsoft Store as shown below:
6、Next, you can open the Ubuntu system as shown in the following image:
**NOTE:**If you run into such a problem
Prompt when WSL2 starts: The referenced object type does not support the attempted operation
Here are some things you can try
https://github.com/microsoft/WSL/issues/4177#issuecomment-1429113508
After you have set up the Ubuntu system, the subsequent steps are exactly the same as installing and using OneDiff on Linux. For detailed steps, please refer to OneDiff-README.md.
Please refer to automatic-installation-on-linux to install Stable Diffusion WebUI on WSL.
After you successfully install Stable Diffusion web UI, you can install the OneDiff extension through the following steps.
git clone https://github.com/siliconflow/onediff.git
Use the following command to install OneDiff for Stable Diffusion web UI.
ln -s "$(pwd)/onediff/onediff_sd_webui_extensions" "$(pwd)/stable-diffusion-webui/extensions/onediff_sd_webui_extensions"
cd $(pwd)/stable-diffusion-webui
venv_dir=- bash webui.sh
# Exit webui server and upgrade some of the components that conflict with onediff.
cd repositories/generative-models && git checkout 9d759324 && cd -
Then install the following packages in your environment.
pip install -U einops==0.7.0
Then go to the cloned Stable Diffusion web UI directory.
cd /path/to/your/stable-diffusion-webui
Then run the following commands in this folder:
python webui.py
You can access this address directly to visit Stable Diffusion web UI http://127.0.0.1:7860.
Then to activate OneDiff extension acceleration, follow these steps:
Select onediff_diffusion_model
from the Script menu, enter a prompt in the text box (e.g., "a black dog"), and then click the "Generate" button.
https://learn.microsoft.com/zh-cn/windows/wsl/install
https://github.com/siliconflow/onediff/blob/main/README.md