Window installation Stable-Diffusion-WebUI detailed tutorial

Directly upload the effect picture, which is a picture generated by using the ancient style model through the stable diffusion webui, it is really beautiful! ! !

Looking at these pictures, do you feel itchy? Come and take everyone in today! Get the software up first!

【Preface】

Stable Diffusion is a deep learning text-to-image generation model released in 2022 . It is mainly used to generate detailed images based on text descriptions. Official projects are not suitable for novices to use directly. Fortunately, there are some open  source projects based on stable-diffusion packaging  webui , which can be used through interface interaction  stable-diffusion, which greatly reduces the threshold for use. We It can be accessed and used through local deployment, but this has high requirements for our computers, and the specific configuration needs to continue to look down.

According to the above tutorial on GitHub, it is actually very simple, just four steps, as shown in the figure below: From the figure, you can see that the required python version is 3.10.6, so remember to install python3.10 version, remember to install python3.10 version, remember to install python3 .10 version , important things are said three times:

【Installation Tutorial】

1. Hardware environment

1. Computer with N card. N card refers to NVIDIA graphics card, above 1060, with at least 4G of video memory, and above 16G of memory, of course, the bigger the better.

2. Prepare at least 20G hard disk space. (Python environment, support library, model, especially the model is about 5.5G).

Two, install python

There are many python installation tutorials on the Internet, which are basically fool-like installations, just keep going to the next step.

You can refer to the tutorial: Python Detailed Installation Steps Graphic Tutorial-Knowledge

2 points to note:

1. When installing, remember to add to the environment variable environment;

2. Be sure to install the python3.10 version, because this project is developed based on python3.10.6. If you use a lower version, there will be many problems with the installation package version inconsistency (pro-test), and finally it will not be installed;

After installing python, enter cmd with win+R to enter the command line to execute python. If the following version information appears, it means that Python has been installed successfully.

3. Install git

Git is mainly used to download stable diffusion webui and project dependency packages from GitHub, and it is also a fool's installation.

Just refer to the tutorial: Windows System Git Installation Tutorial (Detailed Git Installation Process) bazyd

4. Download the stable diffusion webui project

There are two ways to download this project:

The first one is to download directly using the git tool installed above

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

The second method: directly download the zip package of the project, and then unzip it. Visit GitHub - AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI , and click "Download ZIP". After the download is complete, unzip it. The way to download the project is exactly the same.

 5. Modify the project launch.py ​​file

Change five lines in the function prepare_environment from https://github.com to https://ghproxy.com/https://github.com 

Screenshot after replacement:

  6. Download the model

Model download address: https://civitai.com/ , need to go online scientifically, here I choose to download the ancient style model, click to enter, and then download, each model is several GB 

 The downloaded model needs to be placed in the models\Stable-diffusion\ directory under the project directory

For example, my project directory is: E:\stable diffusion\stable-diffusion-webui\

Then you need to put the model under: E:\stable diffusion\stable-diffusion-webui\models\Stable-diffusion

Seven, execute the installation

At this point, everything is ready and only the east wind is owed

In the project directory, double-click webui.bat and it will be installed automatically. The whole process will take about 30~60 minutes depending on the computer or network conditions.

The installation process actually creates a venv python virtual environment in the project directory, and all involved installation packages are installed in this directory. After the installation is complete, run 

Browser running: http://127.0.0.1:7860/

Problems during installation

There was only one problem during the installation process: the clip could not be installed, and the python package could not be downloaded and installed no matter whether it was scientific or not. In the end, I had no choice but to download the program separately and install it separately; after the separate installation was completed, restart Execute webui.bat.

Note: The clip in the stable diffusion webui environment is actually open_clip , which cannot be pip install clipinstalled with

How to manually install the cli steps are as follows:

1. Go directly to github to download  the open_clip  code locally and install it locally

2. Download the source file of open_clip from github to the local. In this step, you can use git clone or download the zip file directly. After downloading, unzip it (not necessary if you use git clone) to the E:\stable diffusion\stable-diffusion-webui\venv\Scripts directory (E:\stable diffusion\stable-diffusion-webui is your stable diffusion webui project Root directory, this address is only in my computer, please adjust it according to your own location);
3. Open cmd, cd to E:\stable diffusion\stable-diffusion-webui\venv\Scripts\, execute activate to enter the virtual environment , and then continue to cd open_clip-main to enter the code package, and then execute the command:
..\python.exe setup.py build install to install open_clip;

4. After the installation in step 3 is completed, continue to execute ..\pip install clip, so far, the installation of open_cli is complete

5. Then re-execute the webui.bat , and then find that it will not be stuck in the cli installation.

If you have other problems during the installation process, you can also contact me for communication! ! ! !

Eight, start alchemy

about me

I am a project manager who understands technology. I have been on the Internet all year round, embracing technological changes, and constantly struggling in life. Roll up your sleeves and work hard! ! ! ! !

Guess you like

Origin blog.csdn.net/qq_20663229/article/details/129876892