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
MSI Suprim GeForce RTX 4090 24GB GDDR6X PCI Express 4.0 Video Card RTX 4090 SUPRIM LIQUID X 24Gの商品画像
MSI Suprim GeForce RTX 4090 24GB GDDR6X PCI Express 4.0 Video Card RTX 4090 SUPRIM LIQUID X 24G
🔗Newegg Link
Seasonic FOCUS GX-1000 1000W 80+ Gold Full-Modular ATX Form Factor Low Noise Premium Japanese Capacitor 10 Year Warranty Nvidia RTX 30/40 Super AMD GPU Compatible Ref# SSR-1000FXの商品画像
Seasonic FOCUS GX-1000 1000W 80+ Gold Full-Modular ATX Form Factor Low Noise Premium Japanese Capacitor 10 Year Warranty Nvidia RTX 30/40 Super AMD GPU Compatible Ref# SSR-1000FX
🔗Newegg 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
ABS Tempest Aqua High Performance Gaming PC - Intel i9 14900KF - GeForce RTX 4090 - DLSS 3.5 - AI-Powered Performance - 32GB DDR5 6000MHz - 2TB M.2 NVMe SSD - TA14900KF4090-3の商品画像
ABS Tempest Aqua High Performance Gaming PC - Intel i9 14900KF - GeForce RTX 4090 - DLSS 3.5 - AI-Powered Performance - 32GB DDR5 6000MHz - 2TB M.2 NVMe SSD - TA14900KF4090-3
🔗Newegg Link
GIGABYTE GeForce RTX 4090 WINDFORCE V2 24G Graphics Card 3x WINDFORCE Fans 24GB 384-bit GDDR6X GV-N4090WF3V2-24GD Video Cardの商品画像
GIGABYTE GeForce RTX 4090 WINDFORCE V2 24G Graphics Card 3x WINDFORCE Fans 24GB 384-bit GDDR6X GV-N4090WF3V2-24GD Video Card
🔗Newegg Link
Supported by