DCAI
Loading Light/Dark Toggl

[ Stable Diffusion web UI ] Generate vivid images using VAE

⏱️10min read
📅 Apr 27, 2024
🔄 Jul 26, 2024
Category:📂 Novice
[ Stable Diffusion web UI ] Generate vivid images using VAE featured Image
Supported by

What is VAE (variational autoencoding)?

When we look at the description of Stable Diffusion’s checkpoint model, we often see things like the VAE designation. What kind of technology is this VAE?

PR
Image of ASUS TUF Gaming GeForce RTX™ 4090 OG OC Edition Gaming Graphics Card (PCIe 4.0, 24GB GDDR6X, DLSS 3, HDMI 2.1, DisplayPort 1.4a)
ASUS TUF Gaming GeForce RTX™ 4090 OG OC Edition Gaming Graphics Card (PCIe 4.0, 24GB GDDR6X, DLSS 3, HDMI 2.1, DisplayPort 1.4a)
🔗Amazon-Usa Link
Image of Seasonic Focus V4 GX-1000 (ATX3) -1000W -80+ Gold -Full-Modular -ATX Form Factor -Premium Japanese Capacitor -10 Year Warranty -Nvidia RTX 30/40 Super & AMD GPU Compatible -Focus V4 GX-1000 (ATX3)
Seasonic Focus V4 GX-1000 (ATX3) -1000W -80+ Gold -Full-Modular -ATX Form Factor -Premium Japanese Capacitor -10 Year Warranty -Nvidia RTX 30/40 Super & AMD GPU Compatible -Focus V4 GX-1000 (ATX3)
🔗Amazon-Usa Link

A VAE (variational autoencoder) is a tool used to convert an image into a form that is easily understood by a computer. This technology converts an image into a collection of smaller data, which can then be converted back to the original image. This allows the computer to process the image faster.

a London-based company called Stability AI, a leading AI developer and creator of the Stable Diffusion model, has released two improved VAEs, EMA and MSE. These are measures of how well a VAE is performing; EMA indicates how stable the data is over time, and MSE indicates how small the average error in the data is.

Originally, a default VAE was built into the model, so there is no need to install a separate VAE when using Stable Diffusion. However, a better VAE may be developed. This is an improved version of the original VAE that can reproduce the finer details of an image more clearly. With this improved VAE, colors are more vivid and fine details such as eyes and text are displayed more clearly.

How to install VAE

The installation procedure for VAE is the same as for NegativeEmbedding, just put the files in the specified folder.

Download

First, let’s install the one you prefer from the two models introduced earlier.

If there is no particular reason, download the safetensors file.

EMA MSE

Move to folder

Move the downloaded file to the /stable-diffusion-webui/models/VAE folder.

How to display the VAE selector

Although there is a way to select VAE from the VAE on the “Setting” page, we recommend using the “VAE Selector” as it is by far the most convenient way to select VAE.

  • Open settings: Open the Stable Diffusion web UI browser and go to the “Settings” page.
  • Move to the user interface: Select “User Interface” from the menu on the left.
  • Search from the Quicksettings list: Type sd_vae in the search box and select the appropriate item from the search results.
    sd_vae
  • Apply settings: After making your selection, click the “Apply Settings” button.
  • Restart the UI:Press “Reload UI” to restart the user interface.
Image after VAE selector adaptation
The installation is complete when the settings are applied and the UI shown above appears.
Open Image

How to use VAE

Choose from the VAE selector that you have just adapted.

About Automatic

“Automatic” in the VAE selection list is a function that is automatically applied when the name of the checkpoint model and the name of the VAE match. Note that it does not select a good VAE for the checkpoint model.

Here are some commonly used and recommended VAE models.

There are many other VAEs in SD1.5 besides the two Stability AI models introduced earlier. The sample comparison images are generated using “darkSushiMixMix_2.25D”.

kl-f8-anime2 VAE

  • Creator: 🔗migatte2001388
  • Download: 385.84 MB
  • Upload: 2023/3/25
  • Data Format: safetensors

migatte2001388’s “kl-f8-anime2 VAE” produces an overall clearer image.

Color101 VAE

  • Creator: 🔗Rexts
  • Download: 319.14 MB
  • Upload: 2023/5/29
  • Data Format: safetensors

Rexs’ “Color101 VAE” also has good overall contrast.

difConsistency RAW VAE

  • Creator: 🔗rMada
  • Download: 319.19 MB
  • Upload: 2023/6/12
  • Data Format: pt

rMada’s “difConsistency RAW VAE” is a bit more subdued in tone. The site recommends using a set of checkpoint models, negative embedding, Lora, etc.

Matrix-VAE

  • Creator: 🔗lawsuit
  • Download: 147.42 MB
  • Upload: 2023/7/10
  • Data Format: pt

the “Matrix-VAE” by lawsuit is a VAE developed for “Matrix-Anime”, but it also affects “darkSushiMixMix_2.25D” in the sample image. It also calms the contrast.

Tone Range Compressor (VAE)

  • Creator: 🔗Z_phyr
  • Download: 159.58 MB
  • Upload: 2023/6/10
  • Data Format: safetensors

Z_phyr’s “Tone Range Compressor (VAE)” eliminates the white out and black out. In the sample image, the shadow area around the back of the head is brightened.

VAEs for the SDXL model are still few, but we will introduce them. Samples are generated using “bluePencilXL_v500”.

sdxl-vae

  • Creator: 🔗Stability AI
  • Download: 335 MB
  • Upload: 2023/7/27
  • Data Format: safetensors

Stability AI’s “sdxl-vae” looks almost unchanged, but if you look at the skintone, you can see that the color is natural.

FIX FP16 Errors SDXL – Lower Memory use

“FIX FP16 Errors SDXL – Lower Memory use” by nucleardiffusion is a model of “sdxl-vae” introduced earlier, adjusted to compute with fp-16 low memory. The generation is fast, but the result is almost the same as “sdxl-vae”.

XL_VAE_F

  • Creator: 🔗atw44qb
  • Download: 159.58 MB
  • Upload: 2023/6/10
  • Data Format: safetensors

“XL_VAE_F” by atw44qb produces an image with a clear contrast. Several other versions are available on the site page.

Conclusion

In this article, we have introduced how to use VAE and recommended models. VAE is a tool to transform images into a computer-friendly form, and the improved VAE improves the quality of images. However, if you are looking for better results, the improved VAE may be worth a try.

PR
Image of Corsair Vengeance i7400 Series Gaming PC - Liquid Cooled Intel® Core™ i9 12900K CPU - NVIDIA® GeForce RTX™ RTX 4090 GPU - 2TB M.2 SSD - 64GB Vengeance RGB DDR5 Memory - Black
Corsair Vengeance i7400 Series Gaming PC - Liquid Cooled Intel® Core™ i9 12900K CPU - NVIDIA® GeForce RTX™ RTX 4090 GPU - 2TB M.2 SSD - 64GB Vengeance RGB DDR5 Memory - Black
🔗Amazon-Usa Link
Image of MSI Gaming RTX 4080 Super 16G Expert Graphics Card (NVIDIA RTX 4080 Super, 256-Bit, Extreme Clock: 2625 MHz, 16GB GDRR6X 23 Gbps, HDMI/DP, Ada Lovelace Architecture)
MSI Gaming RTX 4080 Super 16G Expert Graphics Card (NVIDIA RTX 4080 Super, 256-Bit, Extreme Clock: 2625 MHz, 16GB GDRR6X 23 Gbps, HDMI/DP, Ada Lovelace Architecture)
🔗Amazon-Usa Link
Supported by