Stable Diffusion - Environment Configuration for Easy Diffusion Image Generation Tool

Welcome to my CSDN: https://spike.blog.csdn.net/
This article address: https://blog.csdn.net/caroline_wendy/article/details/131524075

Version v2.5.41

Img

Stable Diffusion image generation tool is a deep learning-based technology that can generate high-quality images from random noise, and use the probability model of Diffusion Probabilistic Models to gradually convert noise into target images while maintaining image stability and diversity sex. The advantage of the Stable Diffusion image generation tool is that it does not need to pre-train a generator network, but can directly sample images from the data distribution, and can also adapt to different image domains, such as faces, animals, landscapes, etc. Stable Diffusion image generation tool is an innovative image synthesis technology that can provide efficient and practical solutions for various application scenarios.

  • Installation page: https://stable-diffusion-ui.github.io/docs/installation/

  • GitHub:https://github.com/AUTOMATIC1111/stable-diffusion-webui

In the system, the conda environment needs to be included, and no additional creation is required. During the operation, the default environment will be created in the folder.

Software download path:

  1. Download Easy-Diffusion-Linuxthe zip file.
  2. Unzip the compressed package, cd easy-diffusion.
  3. run bash start.sh.
### Linux

1. [**Download** for Linux](https://github.com/cmdr2/stable-diffusion-ui/releases/download/v2.5.24/Easy-Diffusion-Linux.zip)
2. Extract:
   - Extract the file with your favourite file manager, or use `unzip Easy-Diffusion-Linux.zip` in a terminal.
   - After extracting the .zip file, please open a terminal, and go to the `easy-diffusion` directory.
3. Run:
   - In the terminal, run `./start.sh` (or `bash start.sh`)

This will automatically install Easy Diffusion, set it up, and start the interface. No additional steps are needed.

Execute bash start.sh and start the installation environment. If you encounter a Git project that cannot be downloaded, you can download it manually. Points to note are as follows:

  1. Due to the speed of the domestic network, some packages cannot be installed and need to be installed manually. Refer to Bugs 2~5.
  2. The GitHub project cannot be downloaded, and it needs to be downloaded manually. It is recommended to use git sshthe method.
  3. The GitHub model cannot be downloaded. After manual download, put it into the corresponding folder, that is easy-diffusion/models, refer to the source code for details.

If you encounter a bug, you need to reinstall the Python package, first activate the Conda environment conda activate easy-diffusion/installer_files/env, and then install the corresponding Python package.

conda activate stable_diffusion/easy-diffusion/installer_files/env

pip install facexlib==0.3.0 tb-nightly==2.14.0a20230702 sdkit==1.0.112 xformers==0.0.20 -i https://mirrors.aliyun.com/pypi/simple

Model manual download address, refer to stable-diffusion-webui source code:

# codeformer
https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/codeformer.pth

# gfpgan, gfpgan_model.py
https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth

# realesrgan, realesrgan_model.py
https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth
https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-wdn-x4v3.pth
https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-animevideov3.pth
https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth
https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth
https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.1/RealESRGAN_x2plus.pth

# ESRGAN, esrgan_model.py
https://github.com/cszn/KAIR/releases/download/v1.0/ESRGAN.pth

# midas, d_models.py
# dpt_large
https://github.com/intel-isl/DPT/releases/download/1_0/dpt_large-midas-2f21e586.pt
# dpt_hybrid
https://github.com/intel-isl/DPT/releases/download/1_0/dpt_hybrid-midas-501f0c75.pt
# midas_v21
https://github.com/AlexeyAB/MiDaS/releases/download/midas_dpt/midas_v21-f6b98070.pt
# midas_v21_small
https://github.com/AlexeyAB/MiDaS/releases/download/midas_dpt/midas_v21_small-70d6b9c8.pt

Bug1: 遇到 Bug “Failed to connect to github.com port 443: Connection timed out”

Right now:

fatal: unable to access 'https://github.com/cmdr2/stable-diffusion-ui.git/': Failed to connect to github.com port 443: Connection timed out

EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

ERROR: git clone failed

Error downloading Stable Diffusion UI. Sorry about that, please try to:
 1. Run this installer again.
 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting
 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB
 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues

Thanks!

Located in: on_env_start.shScript, enter easy-diffusion/scriptsthe folder, manually download https://github.com/cmdr2/stable-diffusion-ui.git/, that’s it, it’s recommended to use git sshdownload

git clone [email protected]:easydiffusion/easydiffusion.git

Bug2: Encountered Bug "No module named facexlib"

This problem will also be encountered when installing sdkit, namely:

  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.exit code: 1
  ╰─> [17 lines of output]
      Traceback (most recent call last):
        File "/tmp/pip-install-ftrx1th1/gfpgan_051d13278c764431bd5491fa888528ee/setup.py", line 48, in get_hash
          from facexlib.version import __version__
      ModuleNotFoundError: No module named 'facexlib'
...

You can install it manually directly, that is,pip install facexlib==0.3.0

Bug3: Encountered Bug "gfpgan 1.3.8 depends on tb-nightly"

Switch the installation source to aliyun:

pip install tb-nightly==2.14.0a20230702 -i https://mirrors.aliyun.com/pypi/simple

Bug4: Encountered Bug "No module named sdkit"

This is the key installation package, namely

  File "easy-diffusion/ui/easydiffusion/utils/save_utils.py", line 10, in <module>
    from sdkit.utils import save_dicts, save_images
ModuleNotFoundError: No module named 'sdkit'

First install facexliband tb-nightly, and then directly pip install sdkit==1.0.112 , you can.

Bug5: 遇到 Bug “No module ‘xformers’. Proceeding without it.”

Right now

No module 'xformers'. Proceeding without it.

Switch the installation source to aliyun:

pip install xformers==0.0.20 -i https://mirrors.aliyun.com/pypi/simple

The operation is successful, and the log is as follows:

21:25:07.312 INFO cuda:1 Global seed set to 0                                      seed.py:65
Sampling:   0%|                                                        | 0/1 [00:00<?, ?it/s]21:25:07.484 INFO cuda:1 seeds used = [0]                                  sampler_main.py:64
100%|████████████████████████████████████████████████████████| 25/25 [00:01<00:00, 22.85it/s]
Sampling: 100%|████████████████████████████████████████████████| 1/1 [00:01<00:00,  1.53s/it]
21:25:09.258 INFO cuda:1 Task completed                                        renderer.py:73
21:25:09.507 INFO cuda:1 Session 1688389496479 task 139918897684288       task_manager.py:367
completed by NVIDIA A100-SXM4-80GB. 

The output test image is as follows:

Img

reference:

Guess you like

Origin blog.csdn.net/u012515223/article/details/131524075