To a person needs GUI
Solution in this post doesn't provide GUI. If GUI is required, recommend to install as GIMP plugin. The next post introduces its how-to.
FYI, regardless of with or without GUI, time for image output has no change.
|OS||Windows 11 Pro 22H2|
|CPU||Intel Core i7-6650U|
SD card: 32GB (D drive in this post)
Container and WSL are not used in this post. On limited resource environment, it is better run SDOV directly than to use them. Actually, SDOV can run stably even on a PC with RAM=8GB.
Computational resource assignment is done by Windows OS to them, and it sometime causes OOM kill, which a process is killed forcibly due to out of memory. Although there are workaround to avoid it, they are not recommended.
You should not try to circumvent these safeguards by manually setting --oom-score-adj to an extreme negative number on the daemon or a container, or by setting --oom-kill-disable on a container.
To proceed the work below, following tools are required. "version" is the one in this post.
|Visual Studio 2022||17.5.1|
Visual Studio and C++ build tools
C++ builder is required to install Python packages. This tool is included in Visual Studio, or "Build Tools for Visual Studio". In advance of starting procedure below, one of both must be installed with appropriate options.
Tools > Get Tools and Features...
conda update conda -y cond aupdate anaconda -y
At the moment of this post, Anaconda provides Python 3.9.16. Although the latest Python is version 3.11, it has not been supported by Intel OpenVINO*2 yet. The next version of OpenVINO may support 3.11.
Python 3.11 is in progress and will be available in 2023.0 release.
In this post, all works are done under the next folder. Call this folder as "project folder" in this post.
If the Anaconda is installed at "d:\myapp\anaconda3\", its Python virtual environment is hosted under the "envs" folder there. If the name of this project environment is "myenv", its path will be
and cloned SDOV will be downloaded under the next folder. Call this folder "SDOV folder" in this post.
Images are also output there as
If the same named flle is existed, it is overwritten.
Use GitHub Desktop to clone (download) SDOV,
or run the next command at the project folder. The folder of SDOV is automatically created.
- use latest numpy
- add "openvino-dev"
- use scipy older than version 1.9.0
🔎Descriptions of new "requirements.txt"
diffusers==0.2.4 ftfy==6.1.1 huggingface_hub==0.9.0 numpy opencv-python==126.96.36.199 openvino==2022.3.0 openvino-dev[onnx,pytorch]==2022.3.0 piexif==1.1.3 pillow==9.0.1 scipy<1.9.0 streamlit_drawable_canvas==0.9.1 streamlit==1.12.0 tqdm==4.64.0 transformers==4.16.2 watchdog==2.1.9
Command operation from here is performed on "Anaconda Powershell Prompt (anaconda3)". Especially execution of "demo.py" requires administrator privileges. Don't forget to run it as Administrator.
Run next commands to enter the project folder, create Python virtual environment "myenv", and enter there.
cd d:\2023\testrun\ conda create -n myenv python=3.9 -y conda activate myenv
Run next commands to enter the SDOV folder and install required packages.
cd .\stable_diffusion.openvino\ pip install -r ./requirements.txt
Run Stable Diffusion
Run the command with prompts the picture you want.
python demo.py --seed 1 --num-inference-steps 18 --prompt "Emilia Clarke in style of MuCha" python demo.py --seed 1 --num-inference-steps 18 --prompt "Emilia Clarke in style of Utamaro" python demo.py --seed 1 --num-inference-steps 18 --prompt "Emilia Clarke in style of MuCha and Utamaro"
The default value of "num-inference-steps" is 32. To make processing time shorter, inference step is reduced this time. After some downloads of models, it will output images as them.
Starting with small inference number to catch direction earlier, and go deeper if it is ok. To reproduce a common inference deeper, set the seed number and reuse it.
python demo.py --seed 1 --num-inference-step 6 --prompt "AI painter in style of MuCha" python demo.py --seed 1 --prompt "AI painter in style of MuCha"
6 x inference for 2 min outputs the 1st image, and 32 x inference for 8 min outputs the 2nd one. The woman becomes more MuCha with deeper inference.