Buckets:

hf-doc-build/doc / diffusers /main /ru /api /models /autoencoderkl_audio_ltx_2.md
mishig's picture
|
download
raw
3.52 kB

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]]

diffusers.AutoencoderKLLTX2Audio[[diffusers.AutoencoderKLLTX2Audio]]

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

Источник

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

encode[[diffusers.AutoencoderKLLTX2Audio.encode]]

encode(x: Tensor, return_dict: bool = True)

Источник

decode[[diffusers.AutoencoderKLLTX2Audio.decode]]

decode(z: Tensor, return_dict: bool = True)

Источник

forward[[diffusers.AutoencoderKLLTX2Audio.forward]]

forward(sample: Tensor, sample_posterior: bool = False, return_dict: bool = True, generator: typing.Optional[torch.Generator] = None)

Источник

Параметры:

sample (torch.Tensor) : Входящий образец.

sample_posterior (bool, необязательный, по умолчанию False) : Флаг, определяющий, следует ли выполнять выборку из апостериорного распределения.

return_dict (bool, необязательный, по умолчанию True) : Возвращать ли DecoderOutput вместо обычного кортежа.

generator (torch.Generator, необязательный) : torch.Generator для обеспечения детерминированности выборки.

Возвращает: DecoderOutput или tuple

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

Xet Storage Details

Size:
3.52 kB
·
Xet hash:
faa9b1e541706cb5a261ffd35020061f546bf86375726f9e41899028a3d8393d

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.