Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

Recently, I spent a week debugging and solving problems encountered during the installation process, and finally completed the startup of stable-diffusion-webui and successfully generated pictures.

I'll make a note here and share it with everyone, hoping it can help you avoid some pitfalls.

Next, let's learn stable-difffusion-webui together.

Preliminary preparation

Hardware

Huawei Matebook 16s

Processor 13th Gen Intel(R) Core(TM) i9-13900H 2.60 GHz

Onboard RAM 32.0 GB (31.7 GB available)

System Type 64-bit operating system, x64-based processor

Pen and Touch provides touch support for 10 touch points

Version Windows 11 Home Chinese Edition
Version 23H2
Installation date 2023/‎10/‎12
OS version 22631.3593
Experience Windows Feature Experience Pack 1000.22700.1003.0

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

Procedure

  1. Install Python.
  2. Install Git.
  3. Install Rust.
  4. Clone stable-diffusion-webui to your local computer.
  5. Download the stable-diffusion model.
  6. Run stable-diffusion-webui.

Precautions

The computer is equipped with Intel(R) Iris(R) Xe Graphics, so the selected stable-diffusion-webui needs to use the version that supports Intel graphics, that is, the OpenVINO version.

OpenVINO download link:https://github.com/openvinotoolkit/stable-diffusion-webui

Python version: Python 3.10.11

PS: Regarding the Python version, I first downloaded Python 3.12.3, but when I installed the dependency package, it said it was not supported and I needed to download Python 3.8.x. Then I downloaded and installed 3.8.x, but when I installed the dependency package, it said it was not supported again. Finally, I downloaded Python 3.10.11 to install the necessary dependency packages.

Install Python

References[AI Learning] Nanny-level tutorial, step-by-step on how to install Python on your computer (Windows users), and complete the Python installation.

PS: You need to pay attention to the Python version. Download the latest 3.12.3 version. When installing the dependent package, it will prompt that it is not supported. It is recommended to choose version 3.10.x.

Install Git

References[AI Learning] Nanny-level tutorial, step-by-step on how to install Git on your computer (Windows users), complete the Git installation.

Git is installed to make it easier to clone stable-diffusion-webui to your local computer.

Install Rust

References[AI Learning] Nanny-level tutorial! Teach you step by step how to download and install Rust? (AI helps solve problems), and you are done with the Rust installation.

Rust is installed to resolve an error when building the tokenizers package.

Clone the CPU version of stable-diffusion-webui

Go to the stable-diffusion folder in the D drive of the local computer and create a new folder openvino.

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

Run the command prompt window as an administrator and enter the openvino folder path.

Enter the command line as follows:

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

Use Git to clone the https://github.com/openvinotoolkit/stable-diffusion-webui.git project.

Enter the command line:

  1. :

The project was cloned successfully, and the openvino folder had an additional stable-diffusion-webui folder project.

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

At this point, the stable-diffusion-webui project cloning of the CPU version is completed.

downloadStable DiffusionModel

Enter https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.safetensors in the browser and press Enter to enter the stable diffusion model download page. Click the [download] text in the red box to download the model.

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

Downloading. With 4G, the download may take some time.

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

After downloading the model, copy and paste it into the models/Stable-diffusion folder of the current project.

D:\stable-diffusion\openvino\stable-diffusion-webui\models\Stable-diffusion

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

PS: If you need to enable a new model later, just put it in this path.

More models can be downloaded from the following two websites:

https://civitai.com/

https://www.liblib.art/

Create a Python Virtual Environment

Run the command prompt as an administrator to enter the command prompt window.

Enter the D drive and enter the command line: D:

Enter the stable-diffusion-webui folder and enter the command line: cd D:\stable-diffusion\openvino\stable-diffusion-webui

Create a virtual environment named sd and enter the command line: python -m venv sd

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

Activate Python Virtual Environment

Run the command prompt as an administrator to enter the command prompt window.

Enter the D drive and enter the command line: D:

Go to the folder D:\stable-diffusion\openvino\stable-diffusion-webui\venv\Scripts and enter the command line: cd D:\stable-diffusion\openvino\stable-diffusion-webui\venv\Scripts.

After entering the folder, enter the command line: activate to activate the environment.

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

Enter the sd virtual environment.

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

At this point, we have successfully activated the sd virtual environment. Next, we can start stable-diffusion-webui here.

Start stable-diffusion-webui

Upgrade pip version

In the sd virtual environment, before installing dependent packages, upgrade pip to the latest version to avoid subsequent installation failures due to pip versions.

Command line: python.exe -m pip install --upgrade pip

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

Start stable-diffusion-webui

When you start stable-diffusion-webui for the first time, the missing dependency packages will be automatically downloaded and installed.

Enter (sd) D:\stable-diffusion\openvino\stable-diffusion-webui> and enter the start project command line: py launch.py --skip-torch-cuda-test --precision full --no-half

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

PS: Since my computer does not have an NVIDIA graphics card, I need to add "skip PyTorch CUDA test, use full precision, disable half precision" when running launch.py. The command line is as follows: py launch.py --skip-torch-cuda-test --precision full --no-half

It takes a long time to download and install the dependency packages for the first startup. The network speed of Guotou is about 1M/S, and it takes about 1 hour and 20 minutes.

  1. ():--->.---
  2. ::----(23.0.1)
  3. -24.0---.(2.1)
  4. ---------------------------------------- 2.1/2.1940.0/0:00:00
  5. :
  6. :
  7. :23.0.1
  8. -23.0.1:
  9. -23.0.1
  10. -24.0
  11. ():--->.----------
  12. :.::---.
  13. . :
  14. :----.: :://127.0.0.1:7860
  15. , .
  16. : (: , : , : ,: ,: ,: ,: ,: ,: ,: ).
  17. [] :----.
  18. ::----.
  19. : ... .
  20. (: ,: ,: ,: ,(): ,: ).

Successfully opened stable-diffusion-webui.

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright
Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

Try to generate a graph.

Prompt word: a dog smile.

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

Switching models can also generate images normally.

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright
Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

But the memory was suddenly increased to 27.7G, which was almost used up.

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

CPU: 13th Gen Intel(R) Core(TM) i9-13900H, much higher performance.

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

GPU: Intel(R) Iris(R) Xe Graphics, not used.

Complete and detailed stable diffusion webUI local deployment, AI painting to create pictures with your own copyright

At this point, we have completed the installation and operation of stable-diffusion-webui and successfully drawn pictures on the local computer.

However, due to limited hardware conditions and the lack of NVIDIA graphics cards, Vincent Image still takes a long time to run, and this computer still has difficulty running Vincent Image.

 

statement:The content of the source of public various media platforms, if the inclusion of the content violates your rights and interests, please contact the mailbox, this site will be the first time to deal with.
TutorialEncyclopedia

Stable Diffusion AI beginner tutorial, teach you to turn photos into anime style

2024-5-29 10:32:49

TutorialEncyclopedia

AI beginner basic tutorial, teach you how to download and install Rust step by step

2024-5-30 9:35:02

Search