A collection of Python 3 scripts for working with Stable Diffusion VAEs (Variational Autoencoders). These tools are designed for users who want fine control over VAE merging, precision reduction, and tone curve analysis when working with models like SDXL.
Blend two .safetensors VAE models using weighted interpolation of their tensor data.
Usage:
python vae_merge.py base.vae.safetensors target.vae.safetensors --alpha 0.25 --output user-supplied-output-filename-prefix--alphacontrols the blend ratio (0.0 = base only, 1.0 = target only)- Produces a new
.safetensorsfile with blended weights
π Designed for tone-preserving merges when one VAE has strong stylistic influence
Converts any .safetensors VAE model(s) in the current folder to half-precision (FP16), drastically reducing file size while retaining usable quality.
Usage:
python convert_to_fp16.py- Outputs are written to
./output/folder - File names are suffixed with
.fp16.safetensors
π‘ Recommended for distribution to save disk space and VRAM without sacrificing visual fidelity
-
Merge SDXL VAE with Fancy VAE at 25% strength:
python vae_merge.py sdxl.vae.safetensors fancy.vae.safetensors --alpha 0.25 --output fancynew
-
Convert result to FP16:
python convert_to_fp16.py
-
Upload
fancynew-025.fp16.safetensorsto your WebUI or share it for testing.
This repository is released under the MIT License β do what you want, but I'm not liable.