VAE (Variational AutoEncoder) variational autoencoder is an important generative model. Imagine that VAE is like a very smart painter:
1. Encoder: First, the painter will carefully observe a painting and remember the key features in the painting in his mind. It's like compressing complex drawings into simple points.
2. Latent Space: The key points recorded in the painter's mind form an imagination space. In this space, painters can freely combine these features.
3. Decoder: Then, the painter can draw a similar but not exactly the same painting based on these key points in his mind. It's like reverting simple points to complex paintings.
The role of VAE models in AI drawing is to help the model better understand and generate the details of images, especially when dealing with complex visual elements.
In AI drawing models such as Stable Diffusion, VAE is mainly responsible for:
1. Image compression and reconstruction: Compress the input image into the latent space and then reconstruct it, which helps the model learn the essential features of the image.
2. Improve image quality: Especially in processing facial details, light and shadow effects, more realistic and high-quality images can be generated.
3. Style consistency: Helps maintain consistency in the overall style and visual effects of the generated image.
4. Reduce calculation complexity: By operating in the compressed latent space, the calculation complexity can be reduced.
VAE models are usually available from the following channels:
1.civitai: https://civitai.com
2. Hugging Face: https://huggingface.co/
3. The official website of the model publisher or GitHub repository
On these platforms, you can search for "VAE" or "Stable Diffusion VAE" to find the appropriate model. For example, in the Civitai Model Library, Model types filtering, it is easy to find the corresponding VAEcivitai_filters using VAE.
Download VAE model files from the above channels, usually with .pt or .safetensors as the extension.
Put the downloaded VAE model file into the specified directory of ComfyUI:
ComfyUI_windows_portableComfyUImodelsvae
In order to better manage models, it is recommended that you create subfolders in the vae directory and organize VAE model files according to large model versions or other classification methods, because usually different types of drawing models such as different versions of stable diffusion models and the VAE of Flux drawing models may not be common, for example:
ComfyUI_windows_portableComfyUImodelsvaeSD1.5your_vae_model.safetensors
After placing the model file, restart ComfyUI or refresh the web interface to ensure that the newly added VAE model is loaded correctly.
If you are sharing model files with other AI drawing software, please refer to the instructions on the sharing model section in Installing comfyui to copy or link the VAE model file to the corresponding folder.
Using the VAE model in ComfyUI mainly passes the following nodes:
1.VAE Decode: Used to decode potential representations into images.
2.VAE Encode: Used to encode images into potential representations.
3.Load VAE: Used to load a specific VAE model.
Steps to use:
1. Add the "Load VAE" node and select the VAE model you want to use.
2. Connect the "Load VAE" node to other nodes that need to use VAE (such as VAE Decode or VAE Encode).
3. Configure other relevant nodes according to your workflow needs.
Some Checkpoint models may already include the default VAE. If you want to use a custom VAE, make sure to load explicitly in the workflow and use the VAE model of your choice.
1.vae-ft-mse-840000-ema-pruned: A widely used VAE model suitable for a variety of Stable Diffusion versions. Download link
2.kl-f8-anime2: VAE model optimized for anime-style images. Download link
3.sdxl_vae.safetensors: VAE model specially designed for SDXL (Stable Diffusion XL). Download link
4.orangemix.vae.pt: A VAE widely used in Anything V3 and V4 models, suitable for generating anime-style images. Download link
5.clearvae_v2.2.safetensors: A VAE model designed to improve image clarity. Download link
You can try different VAE models to see which one will bring the best results for your specific use case. Remember that VAE selection may affect the quality and style of the final generated image, so it is worth spending time experimenting with different options.
Please note that some links may require you to log in to the corresponding platform (such as Hugging Face or Civitai) to download the model file. Also, when using these models, make sure to comply with the relevant licenses and terms of use.