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

LTX-2에서 KL 손실을 사용하여 적용된 3D 변분 오토인코더(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 = (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