Sign In

VAE comparison (SDXL / PDXL/ ILXL / NoobAI)

42
VAE comparison (SDXL / PDXL/ ILXL / NoobAI)

Update 5.6.2025: Complete rework of the article. Proper test image, model independent, more parameters and explanations.

There are many different VAE for SDXL/PDXL/ILXL on CivitAI but most people just stick to the default SDXL VAE. In most use cases it makes sense to just stick with this default VAE, but there are exceptions and some models definitely profit from using a different VAE to boost its color saturation or contrast.

The whole idea of creating this article started when I realized that at CFG 1 the generation speed is much higher compared to other CFG values. Sadly only a few models are able to create good images at CFG 1. ToonMerge Illustrious v1.0 is one of them, but the images still look a bit pale at CFG 1. So I decided to try out different VAE to compensate this.

I created the following test image to see the VAEs effects on different colors and shades. It contains 64 different RGB values in an 8x8 grid. The top left corner is 90% black, the bottom right corner is 90% white.

Using ComfyUI I encoded the test image with the default SDXL VAE and decoded it again using almost all available VAE as well as some additional on Hugging Face.

I then compared the following parameters of the resulting image with the default sdxl_vae:

Brightness: The brightness of the whole image in comparison with sdxl_vae. +100% is completely white, -100% is completely black. Depending on the model a range of -10% - +5% is desired.

Contrast: The contrast is measured by comparing the brightness of the 20 brightest squares with the 20 darkest squares. -100% means that the 20 brightest squares are equally bright as the 20 darkest squares. Depending on the model a range of 0% - +10% is desired.

Saturation: The saturation is defined as the difference of the highest to lowest value within one RGB value. It is measured using the three right squares in line 4 and three left squares in line 5. It is calculated for each square independently and averaged over all six squares. -100% means that all squares are grey. Depending on the model a range of 0% - +20% is desired.

Color Cast Red/Green/Blue: The color cast is measured using the whole image. +100% means that the image is completely red/green/blue. If the model does not have an undesired color cast by itself, this value should be as close to 0% as possible.

Highlights: This value is calculated with only the bottom right square. By itself it is 90% white/10% black (229,229,229). +100% means that this square turns completely white (255,255,255). Most of the time this value should be as low as possible (but not negative). Otherwise you will lose details in bright areas.

Shadows: This value is calculated with only the top left square. By itself it is 10% white/90% black (26,26,26). +100% means that this square turns completely black (0,0,0). Most of the time this value should be as low as possible (but not negative). Otherwise you will lose details in dark areas.

So in general the ideal VAE for models that are too faint would be a small decrease in brightness, increase in contrast and saturation, only small increase in highlights and shadows and no color cast. In other cases different parameters might be desired.

But there is more to a VAE than just its effect on colors although this is the most important aspect. Aside from these parameters mentioned above, there are also differences in the image sharpness, although that's harder to measure. There is also a VAE that pixelates the images: pixelateX8VAEForSDXL_v10.

If you upscale your images, I recommend using the default SDXL VAE during generation and only use the desired VAE during upscaling. Otherwise the effects (saturation, brightness etc.) are applied twice.

Since CivitAI sadly has no table feature, I attached the table in a zip file to this article (xlsx for Excel and ods for Open/LibreOffice ect.) where you can sort the list by individual parameters.

My favorite VAE at the moment is xlVAEC_f22. It has +11% saturation, almost no color cast and only moderate increases in highlights and shadows. Here is an example using the default sdxl_vae on the left and xlVAEC_f22 on the right. Click here and here to see the two images at a higher resolution. Here is a short transition video to compare both.

42

Comments