Diffusers documentation

AutoencoderKLLTX2Audio

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.42.1).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

AutoencoderKLLTX2Audio

O modelo de autoencoder variacional 3D (VAE) com perda KL usado em LTX-2 foi introduzido pela Lightricks. Ele é utilizado para codificar e decodificar representações latentes de áudio.

O modelo pode ser carregado com o seguinte trecho de código.

from diffusers import AutoencoderKLLTX2Audio

vae = AutoencoderKLLTX2Audio.from_pretrained("Lightricks/LTX-2", subfolder="vae", dtype=torch.float32).to("cuda")  # or "mps", "xpu", "cpu"

AutoencoderKLLTX2Audio

classe diffusers.AutoencoderKLLTX2Audio

< >

( base_channels: int = 128output_channels: int = 2ch_mult: tuple = (1, 2, 4)num_res_blocks: int = 2attn_resolutions: tuple[int, ...] | None = Nonein_channels: int = 2resolution: int = 256latent_channels: int = 8norm_type: str = 'pixel'causality_axis: str | None = 'height'dropout: float = 0.0mid_block_add_attention: bool = Falsesample_rate: int = 16000mel_hop_length: int = 160is_causal: bool = Truemel_bins: int | None = 64double_z: bool = True )

VAE de áudio LTX2 para codificação e decodificação de representações latentes de áudio.

encode

< >

( x: Tensorreturn_dict: bool = True )

decode

< >

( z: Tensorreturn_dict: bool = True )

forward

< >

( sample: Tensorsample_posterior: bool = Falsereturn_dict: bool = Truegenerator: typing.Optional[torch.Generator] = None ) → DecoderOutput or tuple

Parâmetros

  • sample (torch.Tensor) — Amostra de entrada.
  • sample_posterior (bool, opcional, padrão False) — Se deve amostrar da posterior.
  • return_dict (bool, opcional, padrão True) — Se deve ou não retornar um DecoderOutput em vez de uma tupla simples.
  • generator (torch.Generator, opcional) — Um torch.Generator para tornar a amostragem determinística.

Retorna

DecoderOutput ou tuple

Se return_dict for True, um DecoderOutput é retornado; caso contrário, uma tuple simples é retornada.

Update on GitHub