AUTOMATIC1111/stable-diffusion-webui installation tutorial

github project address: AUTOMATIC1111/stable-diffusion-webui

premise:

Git has been installed (this is very simple, you can go to other tutorials to see)
install python 3.10.9, here is a little talk, it is possible to use Anaconda or python official website environment. As long as you can find the location of the following python.exe file.
insert image description here

Use git to download novel AI source code

①Right click on the blank space - "Git Bash Here -" input:

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

insert image description here
②After success, the following file will appear:
insert image description here
③After entering this folder, you will find the following file webui-user.bat
insert image description here
④Use Notepad to open it, put the python.exe file path you just found into it, and save it
insert image description here
⑤Double-click webui -user.bat file
If your network is good enough, it can be downloaded, just wait and go to step ⑦
If your network is not good, follow me to the next step.
Go to torchvision and download torchvision-0.14.1+cpu-cp310-cp310-win_amd64.whl
Go to torch and download torch-1.13.1+cu117-cp310-cp310-win_amd64.whl
Find this python.exe file
insert image description here
Then open cmd and enter the following code

D:\csdn\stable-diffusion-webui\venv\Scripts\python.exe -m pip config set global.index-url https://pypi.douban.com/simple/

insert image description here

⑥Install the two files just downloaded and
enter

D:\csdn\stable-diffusion-webui\venv\Scripts\python.exe -m pip install D:\chromeDownLoad\torch-1.13.1+cu117-cp310-cp310-win_amd64.whl

Wait for the installation to complete, then enter

D:\csdn\stable-diffusion-webui\venv\Scripts\python.exe -m pip install D:\chromeDownLoad\torchvision-0.14.1+cu117-cp310-cp310-win_amd64.whl

⑦After double-clicking webui-user.bat, you will find that you don’t need to install torch and torchvision. Then it will be stuck at Installing gfpgan. We close this window.
insert image description here
Open cmd and enter again

D:\csdn\stable-diffusion-webui\venv\Scripts\python.exe -m pip config set global.index-url https://pypi.douban.com/simple/

enter

D:\csdn\stable-diffusion-webui\venv\Scripts\python.exe -m pip install gfpgan

insert image description here
insert image description here

Wait for the installation to complete.
⑧Double-click the webui-user.bat file, and the Installing clip will be displayed at this time. At this time,
insert image description here
we should not use pip to install it directly.
We use Notepad to open the launch.py ​​file in the same directory as webui-user.bat, and ctrl+f to search clip, find the following code, there is an address on the right https://github.com/openai/CLIP.git
insert image description here
Let’s find a place and right click - "git bash here
input

git clone https://ghproxy.com/https://github.com/openai/CLIP.git

insert image description here
cmd cut into this newly downloaded directory, enter

D:\csdn\stable-diffusion-webui\venv\Scripts\python.exe setup.py install

insert image description here
⑨Double-click the webui-user.bat file, and it will display that Installing open_clip
insert image description here
is similar to clip. Install it in the same way, so I won’t write it.
⑩Installation
We open the repositories directory in the same directory as webui-user.bat, and use it in this directory

git clone https://ghproxy.com/https://github.com/Stability-AI/stablediffusion.git
git clone https://ghproxy.com/https://github.com/CompVis/taming-transformers.git
git clone https://ghproxy.com/https://github.com/crowsonkb/k-diffusion.git
git clone https://ghproxy.com/https://github.com/salesforce/BLIP.git
git clone https://ghproxy.com/https://github.com/sczhou/CodeFormer.git

One thing to note is that the directory name after the first command is downloaded is insert image description here
We need to change it to the file name written in launch.py
insert image description here
​​Finally, the file obtained in repositories is as follows
insert image description here
11. Double-click the webui-user.bat file and wait After a while, it will show that there is a missing ftfy file.
insert image description here
We use the command

D:\csdn\stable-diffusion-webui\venv\Scripts\python.exe -m pip install ftfy

12. Double-click the webui-user.bat file to start downloading the model.
insert image description here
After the download is complete, it can be run.
insert image description here
Enter http://127.0.0.1:7860 in the browser and you're
done
insert image description here
insert image description here
[Supplement: No module 'xformers'. Proceeding without will appear at the end it. Problem, it doesn’t matter if this problem is added. Adding this package will save a little video memory and increase speed.
If you want to solve this problem, you can refer to this link: https://www.bilibili.com/read/cv20259334 . However, after I configured it according to his method, an error was reported when it was running. If someone knows what the problem is, you can tell it in the comment area. ]

Guess you like

Origin blog.csdn.net/weixin_43732022/article/details/129336297