Deploy Stable Diffusion XL Gradio Demo WebUI locally

0. First show a few pictures generated by StableDiffusion XL

insert image description here
insert image description here
insert image description here
insert image description here

1. What is Stable Diffusion XL Gradio Demo WebUI

A Web UI interface for Stable Diffusion based on the Gradio library.

2. Github address

https://github.com/TonyLianLong/stable-diffusion-xl-demo

3. Install Miniconda3

Download the Conda install script,

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

Run the install script,

bash Miniconda3-latest-Linux-x86_64.sh

Follow the prompts. When prompted whether to initialize Conda, enter "yes",

insert image description here

Once the installation is complete, close the current terminal and open a new one, this will activate Conda,

sudo su - root

Update Conda to the latest version,

conda update conda

insert image description here
insert image description here

4. Create a virtual environment

conda create -n sdxldemo python==3.10.6 -y
conda activate sdxldemo 

5. Install Stable Diffusion XL Gradio Demo WebUI

Clone the code and install dependent libraries,

git clone https://github.com/FurkanGozukara/stable-diffusion-xl-demo; cd stable-diffusion-xl-demo
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install xformers==0.0.21.dev564
pip install -r requirements2.txt

set huggingface access_token,

vi app2.py

---
access_token = "hf_ovfazhEBOXmTpUsfdfdshfdydZIfMNJVKrcZ"
---

6. Start the Stable Diffusion XL Gradio Demo WebUI

start up,

export ENABLE_REFINER=true
python app2.py

7. Access the Stable Diffusion XL Gradio Demo WebUI

Use a browser to open http://localhost:7860/and generate a picture to try, how do you feel?

insert image description here

insert image description here
insert image description here

refer: https://github.com/FurkanGozukara/Stable-Diffusion/blob/main/Tutorials/How-To-Use-Stable-Diffusion-SDXL-Locally-And-Also-In-Google-Colab.md

end!

Guess you like

Origin blog.csdn.net/engchina/article/details/131693862