Skip to content

odyss3y/vae-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vae-tools

Project status: Shelved for now. convert_to_fp16.py worked for the author, but vae_merge.py did not produce observable changes in the tested VAEs. This may have been user error or an unsuitable test case; no claims about VAE merge effectiveness or output quality can be made.

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.


📜 Contents

vae_merge.py

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
  • --alpha controls the blend ratio (0.0 = base only, 1.0 = target only)
  • Produces a new .safetensors file with blended weights

📌 Designed for tone-preserving merges when one VAE has strong stylistic influence


convert_to_fp16.py

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


🧪 Example Workflow

  1. Merge SDXL VAE with Fancy VAE at 25% strength:

    python vae_merge.py sdxl.vae.safetensors fancy.vae.safetensors --alpha 0.25 --output fancynew
  2. Convert result to FP16:

    python convert_to_fp16.py
  3. Upload fancynew-025.fp16.safetensors to your WebUI or share it for testing.


🛡 License

This repository is released under the MIT License — do what you want, but I'm not liable.

About

A collection of python3 scripts for working with Stable Diffusion VAEs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages