Series Article Directory
Stable Diffusion interface parameters and model usage
Google Colab Cloud Deploys Stable Diffusion for Drawing
Article directory
foreword
Recently, intelligent AI painting has become popular all over the Internet due to its low cost, high efficiency, multiple styles, and easy operation, which has had a huge impact on original painting, graphic design and other fields. It is reported that many companies (especially game companies) have already applied AI painting Introducing a workflow, what's more, half of the company's original artists have been laid off.
With the upsurge of AI painting learning, the author can't wait to experience the Stable Diffusion WebUI, which is known as the strongest in the industry
1. What is Stable Diffusion?
Stable Diffusion is an AI drawing software (open source model), which can be deployed locally and can switch between multiple models. New models and open source libraries are updated and released every day. The most important thing is that it is free and there is no limit on the number of drawings.
2. Preparation before installation
1. Check whether your computer configuration meets the requirements
Computer memory at least 2G or more
Tips: How to check the video memory size of your computer:
Right-click on Windows [Start], select [Task Manager (T)], select [GPU] in the [Performance] column to view "Dedicated GPU Memory"
2. Download and install Git
Tips: Git is a free, open source distributed version control system
Click Git Bash Here to open the Git terminal
Check whether Git has been installed on your computer: [Win+R] to call out [Run], enter "cmd", press Enter, and enter in the command line
git --version
As shown in the figure below, if the version number appears, it means that it has been installed
3. Download and install Python
It is best to download this version.
Note that you must check this option and add python to the system environment variable PATH.
Because I installed python when I was in school, I am afraid that the old version does not support Stable Diffusion, so I also take this opportunity to update the version.
Check whether the upgrade is successful: [Win+R] to call out [Run], enter "cmd", press Enter, and enter in the command line
python --version
As shown in the figure below, the version number appears, successfully upgraded to version 3.10
3. Download the stable-diffusion-webui warehouse
https://github.com/AUTOMATIC1111/stable-diffusion-webui
Create a new folder in a disk with a relatively large space, as shown in the picture below named [AI] folder, then click the right mouse button in this folder, select [ Git Bash Here] Open the Git terminal,
as shown in the figure below, successfully opened a Git terminal
Clone and download the code through the Git command
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
Problem occurs:
OpenSSL SSL_read: Connection was reset, errno 10054
Solution:
Turn off git's https certificate verification
git config --global http.sslVerify false
Then clone the code again, success!
At the same time, you can see that the folder is also downloaded
4. Run webui-user.bat
Find it in the downloaded folder above, double-click to run it. A new problem appears
during the download : Prompt for pip update? Solution: To upgrade the pip command, you can reopen a command line and run the green command it prompts once (because the folder name may be different, this command varies from person to person)
H:\AI\stable-diffusion-webui\venv\Scripts\python.exe -m pip install --upgrade pip
After that reopen webui-user.bat again
Because the author did not use magic to surf the Internet during the installation process, there was a prompt that gfpgan, clip, and open clip were not successfully installed during the download process, or the reason for the domestic network environment. Solution: edit the stable-diffusion-webui directory
. For example, if the launch.py file
is stuck in gfpgan, find the line where run_pip(f"install {gfpgan_package}", "gfpgan") is located, as shown in line 263 of the launch.py file as shown below, and change it to run_pip(f"install - i https://pypi.douban.com/simple/ {gfpgan_package}”, “gfpgan”), save and close after modification, and use the domestic mirror source (-i https://pypi.douban.com/simple/), improve download speed
run_pip(f"install -i https://pypi.douban.com/simple/ {gfpgan_package}", "gfpgan")
Then save the launch.py file and open the webui-user.bat again
(every time there is a problem with the download, modify the corresponding content in the launch.py file, for example, if there is a problem with the clip, just run_pip(f"install { clip_package}", "clip") to run_pip(f"install -i https://pypi.douban.com/simple/{clip_package}", "clip")), gfpgan, clip, open clip are the same Operation, so repeatedly (modify launch.py, close the command line, reopen webui-user.bat)
If it is still stuck, find the prepare_environment() part in the launch.py file, and add https://github.moeyy.xyz/ in front of the corresponding https://github.com/ to
accelerate through the proxy git
After many revisions, shutdowns, and restarts, I finally came to the Web UI.
If everything goes well, the next step is to download a 3.97G big thing. If you get stuck in the middle, close the command line and reopen webui-user.bat
. After waiting for a while, the progress bar finally filled up, and the content we most wanted to see appeared. It
means that the local computer has started a service, and the port is 127.0.0.1:7860.
Copy http://127.0.0.1:7860 to the browser Open it in the browser and enter the Stable Diffusion interface
Try to generate a little girl with the basic model, the generation speed depends on the computer configuration
emmm, revealing a strange beauty,
and then generate a tiger to see
Summarize
Improve download speed and stability by using domestic mirroring.
The next blog will introduce the interface parameters of Stable Diffusion and try other models.
It's over, thank you for watching!