SD - 3. How to use diffusion web ui? - Scripts, Extras, Extensions

In this post, I will briefly walk through some of the auxiliary functions provided in stable diffusion web ui for earlier idea testing and experience enhancement.

Script

  • At the beginning of generation, it is often the case that you need to test different prompts and parameter settings. Besides manually trying all combinations, webui has built-in scripts that automates this process.

  • This feature could be enabled by selecting the corresponding scripts. The script could be selected at the bottom-left corner of the webui.

  • diffusion webui script location

Prompt form file or textbox

  • Used for testing different prompts using files or handwritten prompts.
  • It's pretty easy and straightforward to use so I would leave it for you to play with.

prompt matrix

Overview

  • Used for testing different tags' (in prompt) influence on the generation result.

  • This feature could be further enhanced by the extension dynamic-prompts

  • Below is a screen shot of the available settings.

    • diffusion-webui-prompt-matrix-script
  • For those interested in reading the source code, check here

Usage

  • To properly invoke this plugin, you need to append the tags you want to experiment with | symbol, follow the format below:
    • ```txt basic_prompt, | tag1 | tag2 | ...
      1
      2
      3
      4
      5
      6
      7
      8
      - Put a `|` symbol before each tag you want to try solely, and separate other tags using `|`.
      - I used `tag` here for simplicity, but you could also try prompt snippets.
      - In this way, prompt matrix would try the below combinations
      - ```
      basic_prompt,
      basic_prompt, tag1
      basic_prompt, tag2
      basic_prompt, tag1, tag2

Example

  • You could find the tags used is displayed in bold, while the tags not used are underscored
  • One common thing you want to experiment with is probably the style of the output.
    • Here is an example, I tried different medium of generating a girl's portrait with the following prompt
      • 1girl, masterpiece, | pencil sketch | oil painting | photo | watercolor
      • diffusion-webui-prompt-matrix-result-1
  • Another thing you may want to try is that whether certain tags are taking effects.
    • Here is another example, I tried different quality tags
      • 1girl, | masterpiece | best quality | extremely detailed
      • diffusion-webui-prompt-matrix-result-2
  • Or you want to try different lighting options
    • 1girl, RAW photo, masterpiece, best quality, extremely detailed, | spotlight | rim lighting | sunlight | natural lighting
    • diffusion-webui-prompt-matrix-result-3
  • I would strongly recommend this website - promptmania if you are struggling with finding suitable tags for a specific aspect of the generation (e.g. medium, lighting, camera setting, etc.). This website providers wonderful visual cue for different tags.
    • promptmania-example-screenshot

XYZ plot

Overview

  • Used for testing different parameter settings
  • Below is a screen shot of the available settings.
    • diffusion-webui-xyzplot-script
  • For those interested in reading the source code, check here

Usage

  • The interaction logic is straightforward, select the parameter you would like to play with, fill in the values by hand or use the 📒 icon to automatically import all available options (for checkpoints, sampler, etc.)
  • In my previous blog, I used this script for doing experiments with testing different checkpoints' performance and parameter setting's impact.
  • Example usage
    • Test different models performance on a given prompt
      • diffusion-webui-xyzplotscript-different-model
    • Test different parameter settings' impact (like sampling steps, CFG scale)
      • X type = CFG scale, X values = 3,5,7,9
      • diffusion-webui-xyzplotscript-different-CFG-scale
      • X type = Steps, X values = 10,20,30,40
      • diffusion-webui-xyzplotscript-different-sampling-steps
    • Test different parameter combinations.
      • By the way, it is often best practice to use recommended sampling method.

      • X type = Checkpoint name, X values = filled
      • Y type = sampler, Y values = filled
      • diffusion-webui-xyzplotscript-different-model-sample-combination

Auxiliary tabs

  • Skip the training related part for a later post (like checkpoinst merger, training, etc.)

Extras

  • This step is dedicated for upscaling images. It plays a similar role as txt2img tab's hires fix, or img2img tab's SD upscale script
  • diffusion-webui-extra-tab-screenshot
  • Upload a image and choose a upscaler for the task.
    • RealESRGAN_x4plus_anime_6B is good for animation characters
    • realesr-general-wdn-x4v3 is good for realistic characters or scenery.
  • When an upscaler is used for the first time, it may take some time to download.
    • If failed to download for some reason, check this website to download upscaler manually (and place them in stable-diffusion-webui/models/ESRGAN/ - not sure about all other upscaler, but worked for the above two)

PNG info

  • A useful tab for extracting generation data stored in images.
  • diffusion-webui-example-pnginfo-tab
  • Enable setting to store the generation data
    • In the Settings tab, check the following path
    • saving images/grids > Save text information about generation parameters as chunks to png files

    • You would then be able to retrieve generation data.

Extensions

  • Used to install and manage extensions.
  • Check the official extension list
  • Could also be downloaded locally and manually add to path/to/your/webui/root/dir/extensions folder
  • Recommended extensions
    • Prompting
      • tagcomplete
        • when writing prompt, give you tag recommendations
      • tagger
        • Provided an image, use extra models to deduct the possible
      • dynamic-prompts
        • Mentioned in previous section, for quickly create different prompts
    • Better Control
      • ⭐️Controlnet
        • One of the most helpful and important extension for creating aligned images.
        • Next blog post would be on this topic, discuss the detail usage of each one and share my workflow.
      • lora-block-weight
        • Used to control lora's performance
      • openpose-editor
        • Used as an auxiliary for character generation with fixed pose.
      • depthmap
        • used as an auxiliary for character generation with depth information (usually used for hand recreation)
    • UI enhancement

SD - 3. How to use diffusion web ui? - Scripts, Extras, Extensions
https://delusion4013.github.io/2023/05/21/How-to-use-diffusion-web-ui-Scripts-Extras-Extensions/
Author
Chenkai
Posted on
May 21, 2023
Licensed under