Skip to main content

Module vae

Module vae 

Source
Expand description

Stable-Diffusion VAE decoder composition.

The forward path mirrors diffusers.AutoencoderKL.decode(z).sample for runwayml/stable-diffusion-v1-5:

z (pre-divided by scaling_factor)
  -> post_quant_conv
  -> Decoder.conv_in
  -> Decoder.mid_block
  -> Decoder.up_blocks[0..N]
  -> Decoder.conv_norm_out -> SiLU -> Decoder.conv_out

The decode_with_scaling helper applies z / scaling_factor first, matching AutoencoderKL.decode(z).sample. forward(z) is the post-scaling path and accepts an already-divided latent.

Structs§

Decoder
The bare Decoder half — matches diffusers.models.autoencoders.vae.Decoder.
VaeDecoder
AutoencoderKL-style VAE decoder = post_quant_conv + Decoder.