Skip to content

odyss3y/vae-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

vae-tools

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

No packages published

Languages