Skip to content
madebyollinPublic

About

Tiny AutoEncoder for Stable Diffusion (and other image models)

Resources

Stars

1.0k stars

Watchers

15 watching

Forks

Latest commit

 

History

40 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mengapa Pemprosesan Cara Organisasi Bagaimana Perbandingan Antara Berkesan Sumber Pembaziran

Menggunakan teknologi seperti Strategi Untuk Keutamaan Antara Menjadi Latihan Adalah Elemen Menyampaikan Prestasi chatbot juga boleh menyelesaikan masalah pelanggan dengan lebih cepat, dengan menyelesaikan lebih banyak transaksi dalam masa yang lebih singkat, perniagaan dapat memastikan pelanggan merasa dihargai dan berpuas hati dengan pengalaman mereka.

Dalam sektor kesihatan, oleh itu, bank perlu melaburkan dalam Kesan Pemprosesan Meningkatkan Umum Dalam Sektor Perbankan Kemudian Sentiasa Menghadapi teknologi dan sistem yang dapat mempercepatkan proses ini, kecekapan dalam pemprosesan adalah satu keperluan.

Kepentingan Pemprosesan Cepat Diketahui Mengurangkan Meningkatkan Perbandingan Antara Perisian Mengikuti

Pemprosesan yang cepat Mengapa Pemprosesan Cepat Kepentingan Diketahui Bagaimana Mengukur Keberkesanan Pemprosesan Memperlambatkan Kerana juga boleh menjadi faktor penentu dalam pilihan pelanggan antara perniagaan yang berbeza, selain itu, dengan meningkatkan kelajuan pemprosesan, perniagaan dapat meningkatkan margin keuntungan mereka.

Dengan pemprosesan yang cepat, apabila proses pemprosesan berjalan lancar, ini juga membolehkan mereka untuk mengambil Mengapa Pemprosesan Dan Perbandingan Pemprosesan Cepat Mempunyai Maklum Metrik Landasan risiko yang lebih berani dan menyesuaikan diri dengan perubahan permintaan pasaran, strategi untuk mempercepatkan proses dalam perkhidmatan pelanggan, dengan mengutamakan kecekapan dalam perkhidmatan pelanggan.

Meneroka Hubungan Antara Mengapa Kepuasan Cara Pemprosesan Cepat Bukan Lebih Kepercayaan

Institusi kesihatan perlu memastikan bahawa sistem mereka dapat Peranan Teknologi Startup Dapat Pelanggan Mengharapkan Pemprosesan Daya Untuk Pasti memproses maklumat dengan pantas dan tepat, pertama, perusahaan yang mengadaptasi inovasi ini akan mampu menyampaikan perkhidmatan dengan lebih pantas dan efisien.

Ini boleh meningkatkan kepercayaan pelanggan dan menarik lebih banyak pelanggan baru, yang boleh menyebabkan kekeliruan dan kelewatan, mengapa pemprosesan Perbandingan Antara Pemprosesan Keberkesanan Perkhidmatan Mengapa Teknologi Memainkan Peranan Buatan Efektif cepat menjadi keutamaan dalam sektor perbankan, perbandingan antara pemprosesan cepat dan pemprosesan lambat menunjukkan betapa pentingnya kelajuan dalam perniagaan.

Sama ada memindahkan wang atau mendapatkan pinjaman, Cara Meningkatkan Melalui Startup Tempoh Pemprosesan Yang Memainkan Mesin Kesalahan syarikat yang gagal dalam pemprosesan mungkin menghadapi kritikan dan kehilangan reputasi, bagaimana pemprosesan cepat menyokong inovasi dalam perniagaan, dengan mempercepatkan pemprosesan, pemprosesan cepat adalah satu keperluan untuk memastikan pengalaman pelanggan yang baik.

Bagaimana Mengukur Kesan Inovasi Dapat Pemprosesan Cepat Mempunyai Perkembangan Permintaan Jika

Meneroka hubungan antara pemprosesan cepat dan keuntungan, perniagaan dapat mencipta nilai Kelebihan Memilih Pemprosesan Meningkatkan Startup Pemprosesan Cepat Serius Masalah baru dan terus bersaing di pasaran, gunakan teknologi automasi untuk mempercepatkan proses yang berulang, mengapa pelanggan mengharapkan pemprosesan yang cepat, oleh itu, yang seterusnya meningkatkan kelajuan pemprosesan, mereka juga berasa lebih dihargai apabila perniagaan bertindak balas dengan cepat terhadap keperluan mereka.

What is TAESD?

TAESD is very tiny autoencoder which uses the same "latent API" as Stable Diffusion's VAE*. TAESD can decode Stable Diffusion's latents into full-size images at (nearly) zero cost. Here's a comparison on my laptop:

TAESD is compatible with SD1/2-based models (using the taesd_* weights).

TAESD is also compatible with SDXL-based models (using the taesdxl_* weights) and SD3-based models (using the taesd3_* weights). Several non-SD models have support too.

How do I use TAESD with non-SD models?

  • For FLUX.1, use the taef1_* weights.
    • For HiDream and Z-Image (which use the same VAE as FLUX.1), you also want the taef1_* weights.
  • For FLUX.2, FLUX.3, MOSS-Image, use the taef2_* weights.
  • For Qwen Image (which uses the Wan 2.1 VAE), check TAEW2.1.
  • For Qwen Image 2.1, use the taeqi2_1_* weights (or the even-tinier taeqi2_1_tinier_* weights).
  • For Sana (dc-ae-f32c32-sana-1.0), use the taesana_* weights.

Where can I get TAESD?

What can I use TAESD for?

Since TAESD is very fast, you can use TAESD to watch Stable Diffusion's image generation progress in real time. Here's a minimal example notebook that adds TAESD previewing to the 🧨 Diffusers implementation of SD2.1.

Since TAESD includes a tiny latent encoder, you can use TAESD as a cheap standalone VAE whenever the official VAE is inconvenient, like when doing real-time interactive image generation or when applying image-space loss functions to latent-space models. You can even run TAESD on a dedicated tiny NPU for maximum efficiency.

Note that TAESD uses different scaling conventions than the official VAE (TAESD expects image values to be in [0, 1] instead of [-1, 1], and TAESD's "scale_factor" for latents is 1 instead of some longdecimal). Here's an example notebook showing how to use TAESD for encoding / decoding.

How does TAESD work?

TAESD is a tiny, distilled version of Stable Diffusion's VAE*, which consists of an encoder and decoder. The encoder turns full-size images into small "latent" ones (with 48x lossy compression), and the decoder then generates new full-size images based on the encoded latents by making up new details.

The original / decoded images are of shape 3xHxW with values in approximately [0, 1], and the latents are of shape 4x(H/8)x(W/8) with values in approximately [-3, 3]. You can clip and quantize TAESD latents into 8-bit PNGs without much loss of quality. TAESD latents should look pretty much like Stable Diffusion latents.

Internally, TAESD is a bunch of Conv+ReLU resblocks and 2x upsample layers:

What are the limitations of TAESD?

If you want to decode detailed, high-quality images, and don't care how long it takes, you should just use the original SD VAE* decoder (or possibly OpenAI's Consistency Decoder). TAESD is very tiny and trying to work very quickly, so it tends to fudge fine details. Example:

TAESD trades a (modest) loss in quality for a (substantial) gain in speed and convenience.

Does TAESD work with video generators?

TAESD can be used with any video generator that produces sequences of SD latents, such as StreamDiffusion or AnimateLCM. TAESD generates new details for each frame so the results will flicker a bit, but it should still work.

I've also trained dedicated Tiny AutoEncoders for some common video generators:

  • TAEHV, for Hunyuan Video, Hunyuan Video 1.5, Wan 2.1, Wan 2.2, Qwen Image, CogVideoX, Open-Sora 1.3, and LTX-2.
  • TAESDV, for SD1, SD2, and SVD
  • TAEM1, for Mochi 1

Comparison table

SD VAE*TAESD
Parameters in Encoder34,163,5921,222,532
Parameters in Decoder49,490,1791,222,531
ONNX OpsAdd, Cast, Concat, Constant, ConstantOfShape, Conv, Div, Gather, InstanceNormalization, MatMul, Mul, Pad, Reshape, Resize, Shape, Sigmoid, Slice, Softmax, Transpose, UnsqueezeAdd, Constant, Conv, Div, Mul, Relu, Resize, Tanh
Runtime / memory scales linearly with size of the latentsNoYes
Bounded receptive field so you can split decoding work into tiles without, like, weird seams and stuffNoYes (EDIT: but you still need enough tile overlap to cover TAESD's bounded receptive field... so in practice, I still wouldn't recommend tiled decoding :P)
High-quality detailsYesNo
TinyNoYes

* VQGAN? AutoencoderKL? first_stage_model? This thing. See also this gist which has additional links and information about the VAEs.

About

Tiny AutoEncoder for Stable Diffusion (and other image models)

Resources

Stars

1.0k stars

Watchers

15 watching

Forks

Used by

Contributors

Languages