AI PaintingStable Diffusion WebUI

Welcome to my blog, I’m glad to meet you here! I hope you can feel a relaxed and pleasant atmosphere here, where you can not only obtain interesting content and knowledge, but also speak freely and share your thoughts and insights.
img

  • Recommended: kuan’s homepage, keep learning, keep summarizing, make progress together, live and learn
  • Navigation
    • Tan Yue Sword Points to Big Factory Series: Comprehensive summary of core Java technology points, such as collections, jvm, concurrent programming redis, kafka, Spring, microservices, Netty, etc.
    • Common development tool series: List of commonly used development tools, such as IDEA, Mac, Alfred, electerm, Git, typora, apifox, etc.
    • Database series: Detailed summary of commonly used database MySQL technical points, as well as MySQL problems encountered in work, etc.
    • Lazy man’s operation and maintenance series: Summarize useful commands, wouldn’t it be nice to free your hands? It can be completed with one command and never requires two operations
    • Data structure and algorithm series: summarize data structure and algorithm, different types of targeted training, improve programming thinking, and target big manufacturers

I look forward to exploring, learning and growing with you in this small online world. Welcome to subscribe to this column

Blog Directory

    • 1. Brief introduction
      • 1.What is Stable Diffusion?
      • 2.Stable Diffusion function
      • 3.Github address
      • 4. Install on mac
    • 2. Introduction to use
      • 1. Start
      • 2.Model download
      • 3. Video deployment tutorial
    • 3. Model download
      • 1. Enter the model download page
      • 2.Select type
      • 3. Sorting method
      • 4. Download the model
      • 5. Location
      • 6. Instructions for use
    • 4. UI introduction
      • 1. Regional division
      • 2. Model area
      • 3. Functional area
      • 4. Parameter area
      • 5. Picture output area
      • 6. Chinese plug-in
    • 5.text2img
      • 1.text2img
      • 2. Parameter description
    • 6. Chinese plug-in
      • 1. Chinese plug-in Github
      • 2. Extension list installation
      • 3. Website installation
      • 4.zip package installation
      • 5.How to use
      • 6.Renderings
    • 7. Test use
      • 1.Access address
      • 2. Effect

1. Brief introduction

1.What is Stable Diffusion

Stable Diffusion Web UI is a basic application based on Stable Diffusion. It uses the gradio module to build an interactive program. Stable Diffusion can be accessed immediately in the low-code GUI, allowing us to quickly generate the images we want.

2.Stable Diffusion function

  1. Stable Diffusion is a portrait-generating AI capable of simulating and recreating virtually any concept imaginable in visual form, without any guidance beyond text prompt input
  2. Stable Diffusion Web UI provides a variety of functions, such as txt2img, img2img, inpaint, etc., and also includes many additional upgrades such as model fusion improvements and image quality repairs.
  3. Different effects can be generated by adjusting different parameters, and users can create according to their own needs and preferences.
  4. We can train our own models through the Stable Diffusion Web UI, which provides a variety of training methods. By mastering the training methods, we can make our own models.

3.Github address

Code download

stable-diffusion-webui

image-20230926004741309

Installation on 4.mac

Installation tutorial

image-20230926004812921

2. Introduction to use

1. Start

#Download source code from github
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

#Enter the code root directory
cd stable-diffusion-webui

#Configure the python environment
I installed the python=3.10.6 version using conda.

#Start Stable Diffusion WebUI
./webui.sh

2. Model download

Different models have different drawing effects. Download different models according to your needs to achieve the effects that meet your expectations. The following are 2 commonly used model download addresses.

  • huggingface
  • civitai

3. Video deployment tutorial

Video deployment tutorial

3. Model download

1. Enter the model download page

huggingface model

2.Select type

Choose a Vincentian diagram

image-20230925093246581

3. Sorting method

  • Trending
  • Most Likes Most Likes
  • Most Downloads
  • Recently Updated Recently Updated

image-20230925093322004

4. Download model

It is best to download the file ending with .safetensors

image-20230925093447659

5. Location

Put the downloaded file into the /stable-diffusion-webui/models/Stable-diffusion directory

image-20230926005355312

6. Instructions for use

  • Refer to the usage instructions and cases of the model when using it.
  • Note adding additional files
  • Pay attention to the special prompt word. The effect of the picture depends largely on the prompt parameter adjustment.

image-20230925093647816

IV. UI introduction

1. Regional division

The startup interface can be roughly divided into four areas: [Model] [Function] [Parameter] [Plot]

image-20230925111008281

2. Model area

Model area:The model area is used to switch the model we need. After the model is downloaded, the relative path is placed in the /modes/Stable-diffusion directory. Please place the safetensors, ckpt, and pt model files downloaded online above. path, the refresh arrow in the model area can be selected after refreshing.

3. Functional area

Functional area:The functional area is mainly used for us to switch to use the corresponding function and after we install the corresponding plug-in and reload the UI interface, a shortcut entry for the corresponding plug-in will be added to the functional area. Common functions in the functional area Described as follows

  • txt2img (wenshengtu) – standard text generation image;
  • img2img (pictures generate pictures) – generate images based on image text templates and combined with text;
  • Extras – Optimize (clear, expand) images;
  • PNG Info – basic image information
  • Checkpoint Merger – model merging
  • Textual inversion – train a model for a certain image style
  • Settings – Default parameter modification

4. Parameter area

Parameter area: Depending on the function module you choose, the parameter settings that may need to be adjusted are also different. For example, in the Vincentian diagram module you can specify the number of iterations to use, mask probabilities and image size and other parameter configurations

5. Picture output area

Plot area:The plot area is where we see the final result of AI drawing. In this area we can see relevant parameters used in drawing and other information.

6. Chinese plug-in

Chinese plug-in

五.text2img

1.text2img

text2img is a text2img. In the settings page, you can enter text, select a model and configure other parameters. Text is required and will form the basis for image generation. You can choose a predefined model or upload your own. You can also choose some other parameters such as batch size, generated image dimensions, etc.

2. Parameter description

  • Sampling method (Sampler): This parameter allows you to select the sampling method used to generate the image. By default, this parameter is set to “Eulea”, but you can also select the new option after “DPM + +”, which will generate richer image details than the default.
  • Sampling steps: This parameter allows you to specify the number of iterations for image generation. A higher number of iterations may result in better image quality, but will also take longer to complete the generation. The default starts at 50.
  • Width & Height: This parameter allows you to specify the height and width of the image generated. Larger height and width require more video memory computing resources. The default here is 512*512. If we need to enlarge the image, we can go to the send to extras module and use the amplification algorithm to enlarge the image.
  • Batch count: This parameter allows you to specify the maximum number of iterations that the model will run for each generated image. Increasing this value will generate images multiple times, but the generation time will also be longer (If you need multiple images, it is recommended to reduce the number of image generation batches and instead increase the number of images generated at a time.).
  • Batch size: This parameter allows you to specify the maximum number of images that can be generated at one time. This may be useful if you have limited system resources and need to generate images in smaller batches.
  • Prompt Word Correlation (CFG Scale): This parameter can change the degree of consistency between the image and the prompt (increasing this value will cause the image to be closer to your prompt, but too high will make the image color too saturated. The smaller the value, the greater the room for AI drawing to play and the more likely it is to produce creative results (default is 7).
  • Seed: This parameter allows you to specify a random seed that will be used to initialize the image generation process. The same seed value will produce the same set of images every time, which is useful for reproducibility and consistency. If you leave the seed value at -1, a random seed will be generated each time the text-image feature is run.
  • Optimize faces (Restore faces): Optimize drawing of facial images can be checked. Checking it when the avatar is from a close angle seems to be prone to overfitting and blurring. It is suitable to check this option when the avatar is from a far angle.
  • Tiling: Used to generate an image that can be tiled.
  • Highres.fix: Generate using a two-step process that creates an image at a smaller resolution and then improves the details within it without changing the composition. Selecting this section will result in two new The parameterScale latent scales the image in latent space. Another approach is to generate a complete image from a latent representation, upgrade it, and then move it back to the latent space. Denoising strength determines how well the algorithm preserves image content. At 0, nothing changes, while at 1, you get an irrelevant image;

6. Chinese plug-in

1. Chinese plug-in Github

Chinese plug-in github

There are three installation methods below, all of which can be selected. It is recommended to choose the zip decompression method, which is simple and fast.

image-20230926005558796

2. Extension list installation

This extension can be installed directly in the Extension tab by loading the official plug-in list

  • Click the Extension tab, click the Avaliable subtab
  • Uncheck localization, check others, and then click the orange button, as shown below

image-20230925102718410

Click install to the right of the zh_CN Localization item and wait for the installation to complete.

image-20230925102735823

3. Website installation

  • Click the Extension tab, click the Install from URL subtab
  • Copy this git warehouse URL:
https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN
  • Paste it into the URL bar and click Install, as shown in the figure
  • The installation is complete

image-20230925102834032

4.zip package installation

image-20230925102915083

Unzip it and place the folder in the extensions folder in the webui root directory. After placing it, it should look like the following picture

image-20230925102930345

5. How to use

  • Restart webUI to ensure extension is loaded
  • In the Settings tab, click the orange Reload UI button in the upper right corner of the page to refresh the extension list

image-20230925103517111

In the Extensions tab, make sure this extension is checked; if not, click the orange button to enable this extension.

image-20230925103527437

Select Simplified Chinese language pack (zh_CN)

  • In the Settings tab, find the User interface sub-option

Then go to the top of the page, find the Localization (requires restart) small item, find and select zh_CN in the drop-down menu (if not, click the button), as shown in the figure

image-20230925103554716

Then click the orange Apply settings button on the left at the top of the page to save the settings, and then click the orange Reload UI button on the right Restart webUI

image-20230925103610672

6. Renderings

image-20230925103626329

7. Test use

1. Access address

http://127.0.0.1:7860/

2. Effect

image-20230925100632182

If you find it useful, please give it a like .
My level is limited, if there are any mistakes, you are welcome to comment, criticize and correct me!

If you think this article is helpful to you, please give it a like and save it. Thank you very much!

Stay Hungry Stay Foolish The road is long and difficult, but the journey is about to begin. Let’s work hard together!

img