stable-diffusion.cpp/docs/models/taesd.md

5.1 KiB

TAESD and related tiny autoencoders

Tiny autoencoders provide an alternative to full VAE encoding, decoding, or previews. Choose the file matching the base model.

Model files

Component Weights and downloads CLI option Requirement
TAESD Safetensors weights --taesd / --tae For compatible SD 1.x models
TAEHV for Wan 2.1 taew2_1.safetensors --taesd / --tae Qwen Image, Wan 2.1, and Wan 2.2 A14B
TAEHV for Wan 2.2 5B taew2_2.safetensors --taesd / --tae Wan 2.2 TI2V 5B only
TAEQI2.1 taeqi2_1.safetensors --taesd / --tae Qwen Image 2.1, including RGBA

Qwen-Image and wan (TAEHV)

TAEHV provides tiny autoencoders for the model families in the table. Replace --vae PATH with --taesd PATH using the matching file. A tiny autoencoder can reduce VAE memory requirements, with a possible quality tradeoff.

Qwen Image 2.1 (TAEQI2.1)

TAEQI2.1 supports Qwen Image 2.1 RGBA images. Download the official file directly; conversion is unnecessary. Replace --vae PATH with --taesd taeqi2_1.safetensors in the Qwen Image 2.1 examples.

Download commands

Save the files under the repository's models/vae/ directory. From the build directory, create it if needed:

Windows (PowerShell)

New-Item -ItemType Directory -Force ..\models\vae | Out-Null

Linux/macOS

mkdir -p ../models/vae

Windows (PowerShell)

curl.exe -L -o ..\models\vae\diffusion_pytorch_model.safetensors https://huggingface.co/madebyollin/taesd/resolve/main/diffusion_pytorch_model.safetensors

Linux/macOS

curl -L -o ../models/vae/diffusion_pytorch_model.safetensors https://huggingface.co/madebyollin/taesd/resolve/main/diffusion_pytorch_model.safetensors

Windows (PowerShell)

curl.exe -L -o ..\models\vae\taew2_1.safetensors https://github.com/madebyollin/taehv/raw/refs/heads/main/safetensors/taew2_1.safetensors

Linux/macOS

curl -L -o ../models/vae/taew2_1.safetensors https://github.com/madebyollin/taehv/raw/refs/heads/main/safetensors/taew2_1.safetensors

Windows (PowerShell)

curl.exe -L -o ..\models\vae\taew2_2.safetensors https://github.com/madebyollin/taehv/raw/refs/heads/main/safetensors/taew2_2.safetensors

Linux/macOS

curl -L -o ../models/vae/taew2_2.safetensors https://github.com/madebyollin/taehv/raw/refs/heads/main/safetensors/taew2_2.safetensors

Windows (PowerShell)

curl.exe -L -o ..\models\vae\taeqi2_1.safetensors https://huggingface.co/madebyollin/taeqi2_1/resolve/main/taeqi2_1.safetensors

Linux/macOS

curl -L -o ../models/vae/taeqi2_1.safetensors https://huggingface.co/madebyollin/taeqi2_1/resolve/main/taeqi2_1.safetensors

Usage

Web UI

Use a compatible base model recipe that offers the tae slot, and select the tiny autoencoder matching that model. See Web UI guide.

DGL

The SD 1.5 example uses TAESD to decode the final image and passes the same decoder to preview(decoder = vae). Running it with sd-cli -M dgl writes the final PNG. To receive intermediate images, run it in a host that registers a DGL preview callback in "tae" mode. See progress and previews.

Run a script

Edit paths, prompts and settings in the script's var block, then run from the build directory. Paths inside the script resolve from the working directory.

Windows (PowerShell)

.\bin\Release\sd-cli.exe -M dgl --script ..\docs\dgl\taesd\sd1-5-taesd-preview.dgl

Linux/macOS

./bin/sd-cli -M dgl --script ../docs/dgl/taesd/sd1-5-taesd-preview.dgl

Add --check to validate syntax and types without loading weights. See the shared run instructions for build paths and the server's file-access rules.

Legacy CLI

CLI examples use the shared path and shell conventions.

Windows (PowerShell)

.\bin\Release\sd-cli.exe `
  -m ..\models\checkpoints\v1-5-pruned-emaonly.safetensors `
  --taesd ..\models\vae\diffusion_pytorch_model.safetensors `
  -p "a lovely cat"

Linux/macOS

./bin/sd-cli \
  -m ../models/checkpoints/v1-5-pruned-emaonly.safetensors \
  --taesd ../models/vae/diffusion_pytorch_model.safetensors \
  -p "a lovely cat"

Options

For previews only, keep the full --vae PATH and add --taesd PATH --taesd-preview-only --preview tae.

sd-server accepts --taesd and --taesd-preview-only at startup; choose the preview method in each request. For device placement and convolution settings, see backend selection.