Stable Diffusion Getting Started Guide, Stable Diffusion WebUI Local Deployment Tutorials

Stable Diffusion Getting Started Guide, Stable Diffusion WebUI Local Deployment Tutorials

Recently took over a project that required the use of Stable Diffusion I've been working on a project that requires me to redeploy an SD environment. This is not quite the same as my previous SD deployment, and I encountered some problems during the deployment process, and summarized a more perfect installation plan, which I'd like to share with you here.

Project address: https://github.com/AUTOMATIC1111/stable-diffusion-webui

environmental preparation

Before I start deploying, I use the following environment:

  • Python 3.10.6 (this version is recommended to avoid some compatibility issues)
  • NVIDIA RTX 4090 24GB
  • Windows 11
  • Native CUDA 12.4

deployment process

At first I was installing the dependencies one by one in a step-by-step fashion, but found it tedious to switch directories too many times. Then I wrote a simple script to automate the process.

First, clone the main project:

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

condaEnvironmental Creation

conda create -p . \Dlab python=3.10.6 -y

Then create a dependency library directory:

mkdir -p repositories && cd repositories

Here's the auto-install script I wrote to get all the dependencies installed at once:


repos=(
    "Stability-AI/stablediffusion:stable-diffusion-stability-ai"
    "CompVis/taming-transformers:taming-transformers"
    "sczhou/CodeFormer:CodeFormer"
    "salesforce/BLIP:BLIP"
    "Stability-AI/generative-models:generative-models"
)


for repo in "${repos[@]}"; do
    IFS=':' read -r github_path local_path <<< "$repo"
    echo "Cloning and installing $github_path..."
    git clone "https://github.com/$github_path.git" "$local_path"
    cd "$local_path"
    pip install -e .
    cd ...
cd ... done

The next step is to install the other necessary dependencies, these are the versions I've summarized after stepping through the pits and they work perfectly:

# installs the base dependencies
pip install transformers==4.19.2 diffusers invisible-watermark --prefer-binary

# k-diffusion must install the latest version from git
pip install git+https://github.com/crowsonkb/k-diffusion.git --prefer-binary

# Go back to the home directory and install the project dependencies
cd ...
pip install -r requirements.txt --prefer-binary

# These are the versions I've tested over and over again, so I recommend installing them as follows
pip install pytorch_lightning==1.9
pip install -U xformers==0.0.28.post2 torchvision==0.20.0 torchaudio==2.5.0 --index-url https://download.pytorch.org/whl/cu124
pip install pydantic==1.10.11
pip install wandb==0.15.12

Finally start the service:

python launch.py --xformers --no-gradio-queue

Pothole Record

  1. Dependency version conflict
    The pitfall is the dependency versioning issue, in particular the versions of PyTorch and xformers have to match. The version combinations I listed above are tested over and over again and work perfectly.
  2. network problem
    Scientific Internet access. If you really can't download it, we recommend using a mirror source.

Chinese localization

After entering the interface select Extensions and click Load from to load

Stable Diffusion Getting Started Guide, Stable Diffusion WebUI Local Deployment Tutorials

Find zh_CN Localization and click Install.

Stable Diffusion Getting Started Guide, Stable Diffusion WebUI Local Deployment Tutorials

Once installed you can see in the installed plugins screen the

Stable Diffusion Getting Started Guide, Stable Diffusion WebUI Local Deployment Tutorials

Then you come to the User interface screen

Stable Diffusion Getting Started Guide, Stable Diffusion WebUI Local Deployment Tutorials

Select zh_CN

Stable Diffusion Getting Started Guide, Stable Diffusion WebUI Local Deployment Tutorials

Apply settings and restart the UI

Stable Diffusion Getting Started Guide, Stable Diffusion WebUI Local Deployment Tutorials

After restarting the webui, the interface is now in Chinese.

Stable Diffusion Getting Started Guide, Stable Diffusion WebUI Local Deployment Tutorials

Generated images for testing and ran successfully!

Stable Diffusion Getting Started Guide, Stable Diffusion WebUI Local Deployment Tutorials

statement:The content is collected from various media platforms such as public websites. If the included content infringes on your rights, please contact us by email and we will deal with it as soon as possible.
TutorialEncyclopedia

ai beauty video a key to create tutorials, using AI to do sexy young lady street shooting short video

2025-1-4 10:36:30

Encyclopedia

Beanbag and Kimi don't work well, it's really because you don't know how to use them! These command templates will help you get professional-grade output

2025-1-5 8:36:05

Search