load_decoder_safetensors

Load HF safetensors VAE weights into the native decoder

Description

Loads the decoder half of a diffusers AutoencoderKL safetensors file (e.g. FLUX.1-schnell’s vae/diffusion_pytorch_model.safetensors). Keys under decoder. map to the native module 1:1; encoder and quant-conv keys are skipped (the FLUX VAE has no quant convs, and txt2img needs no encoder).

Usage

load_decoder_safetensors(native_decoder, path, verbose = TRUE)

Arguments

  • native_decoder: Native VAE decoder module
  • path: Path to the VAE .safetensors file (or a directory containing diffusion_pytorch_model.safetensors)
  • verbose: Print loading progress

Value

The native decoder with loaded weights (invisibly)