stable-diffusion-webui quick installation tutorial

Introduction

stable-diffusion-webui is a webpage used to load the Stable Diffusion model, which can easily call the model to generate pictures.
The github address of stable-diffusion-webui is: https://github.com/AUTOMATIC1111/stable-diffusion-webui
This library has a lot of dependencies. Although there are codes for installing dependent libraries in the code, they are almost all foreign resources. It is difficult to download in the domestic network environment and code errors occur.

This article downloads almost all the required dependencies locally, and changes some of the installation links to domestic sources, so it can be installed more conveniently.

[Note]: The environment of this tutorial is linux, and the windows environment can find some lazy packages

step

The Baidu cloud link of the code file is: Link: https://pan.baidu.com/s/1cvPzMTtb_nqMZFbPuieFRw?pwd=d6ln Extraction code: d6ln
This file has 500M and contains many dependent libraries and their original compressed packages. The compressed package part can delete itself.

Enter the main directory after decompression, and then execute the following codes in order:

conda create -n sdw python=3.10
conda activate sdw

cd ./repositories/k-diffusion
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
python setup.py build install # 会报错,但好像没问题

cd ../../hmt_install
pip install tb-nightly -i https://pypi.mirrors.ustc.edu.cn/simple/
pip install GFPGAN-master.zip -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install CLIP-main.zip -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install open_clip-main.zip -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install xformers -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install torchvision -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install ngrok -i https://pypi.tuna.tsinghua.edu.cn/simple

cd ../
python launch.py # 这个会安装一些依赖库,不要直接用 webui.py
等待
Installing requirements for CodeFormer
Installing requirements

python webui.py --no-half-vae # 执行完 launch.py 后,可以用这个命令启动

operation result

insert image description here

There will be some mistakes here, but it seems that the generation process is fine. If anyone who sees here knows how to solve the problems inside, please tell me in the comment area ( ̄︶ ̄)↗

insert image description here
This means that the startup was successful.

interface

insert image description here

some other resources

[Note]: The weight of the model needs to be downloaded by yourself, and then put in

models/Stable-diffusion/

in this path

  • Integration package (different from the method in this article): https://www.bilibili.com/video/BV1iM4y1y7oA/
  • Model sharing: https://www.bilibili.com/video/BV1em4y1z7Dg/
  • Some tutorials: https://www.bilibili.com/read/cv21362202

model selection

insert image description here
You can select a model in the upper left corner.

Guess you like

Origin blog.csdn.net/qq_42464569/article/details/131295203