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.43.0).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

AutoencoderKLLTX2Audio

Модель трёхмерного вариационного автоэнкодера (VAE) с потерей KL, используемая в LTX-2, была представлена компанией Lightricks. Она предназначена для кодирования и декодирования латентных представлений аудио.

Модель можно загрузить с помощью следующего фрагмента кода.

from diffusers import AutoencoderKLLTX2Audio

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

AutoencoderKLLTX2Audio

класс diffusers.AutoencoderKLLTX2Audio

< >

( base_channels: int = 128output_channels: int = 2ch_mult: tuple[int, ...] = (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 )

LTX2 audio VAE для кодирования и декодирования латентных представлений аудио.

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

Параметры

  • sample (torch.Tensor) — Входной образец.
  • sample_posterior (bool, необязательный, по умолчанию False) — Следует ли извлекать выборку из апостериорного распределения.
  • return_dict (bool, необязательный, по умолчанию True) — Определяет, следует ли возвращать DecoderOutput вместо обычного кортежа.
  • generator (torch.Generator, необязательный) — torch.Generator для обеспечения детерминированности выборки.

Возвращает

DecoderOutput или tuple

Если return_dict равно True, возвращается DecoderOutput, в противном случае возвращается обычный tuple.

Update on GitHub