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

LTX-2で使用されているKL損失付き3次元変分オートエンコーダ(VAE)モデルは、Lightricksによって導入されました。これは、音声の潜在表現をエンコードおよびデコードするために使用されます。

モデルは、以下のコードスニペットで読み込むことができます。

from diffusers import AutoencoderKLLTX2Audio

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

AutoencoderKLLTX2Audio

class 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のオーディオ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