Buckets:
| import"../chunks/DsnmJJEf.js";import{i as M,h as X,C as k,H as g,a as w,D as o,E as K,s as j}from"../chunks/BtE7mKSK.js";import{p as G,o as Z,s as e,f as F,a as v,b as J,c as r,d as _,r as t,n as E}from"../chunks/jDjavuwI.js";const R='{"title":"AutoencoderKLLTX2Audio","local":"autoencoderklltx2audio","sections":[{"title":"AutoencoderKLLTX2Audio","local":"diffusers.AutoencoderKLLTX2Audio","sections":[],"depth":2}],"depth":1}';var W=_('<meta name="hf:doc:metadata"/>'),z=_('<p></p> <!> <!> <p>The 3D variational autoencoder (VAE) model with KL loss used in <a href="https://huggingface.co/Lightricks/LTX-2" rel="nofollow">LTX-2</a> was introduced by Lightricks. This is for encoding and decoding audio latent representations.</p> <p>The model can be loaded with the following code snippet.</p> <!> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>LTX2 audio VAE for encoding and decoding audio latent representations.</p> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!></div></div> <!> <p></p>',1);function U(b,L){G(L,!1),Z(()=>{new URLSearchParams(window.location.search).get("fw")}),M();var s=z();X("14z5tsq",f=>{var h=W();j(h,"content",R),v(f,h)});var i=e(F(s),2);k(i,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var l=e(i,2);g(l,{title:"AutoencoderKLLTX2Audio",local:"autoencoderklltx2audio",headingTag:"h1"});var c=e(l,6);w(c,{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0xMVFgyQXVkaW8lMEElMEF2YWUlMjAlM0QlMjBBdXRvZW5jb2RlcktMTFRYMkF1ZGlvLmZyb21fcHJldHJhaW5lZCglMjJMaWdodHJpY2tzJTJGTFRYLTIlMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ2YWUlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MzIpLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKLLTX2Audio | |
| vae = AutoencoderKLLTX2Audio.from_pretrained(<span class="hljs-string">"Lightricks/LTX-2"</span>, subfolder=<span class="hljs-string">"vae"</span>, torch_dtype=torch.float32).to(<span class="hljs-string">"cuda"</span>)`,lang:"python",wrap:!1});var u=e(c,2);g(u,{title:"AutoencoderKLLTX2Audio",local:"diffusers.AutoencoderKLLTX2Audio",headingTag:"h2"});var a=e(u,2),p=r(a);o(p,{name:"class diffusers.AutoencoderKLLTX2Audio",anchor:"diffusers.AutoencoderKLLTX2Audio",source:"https://github.com/huggingface/diffusers/blob/vr_14246/src/diffusers/models/autoencoders/autoencoder_kl_ltx2_audio.py#L668",parameters:[{name:"base_channels",val:": int = 128"},{name:"output_channels",val:": int = 2"},{name:"ch_mult",val:": tuple = (1, 2, 4)"},{name:"num_res_blocks",val:": int = 2"},{name:"attn_resolutions",val:": tuple[int, ...] | None = None"},{name:"in_channels",val:": int = 2"},{name:"resolution",val:": int = 256"},{name:"latent_channels",val:": int = 8"},{name:"norm_type",val:": str = 'pixel'"},{name:"causality_axis",val:": str | None = 'height'"},{name:"dropout",val:": float = 0.0"},{name:"mid_block_add_attention",val:": bool = False"},{name:"sample_rate",val:": int = 16000"},{name:"mel_hop_length",val:": int = 160"},{name:"is_causal",val:": bool = True"},{name:"mel_bins",val:": int | None = 64"},{name:"double_z",val:": bool = True"}]});var n=e(p,4),T=r(n);o(T,{name:"encode",anchor:"diffusers.AutoencoderKLLTX2Audio.encode",source:"https://github.com/huggingface/diffusers/blob/vr_14246/src/diffusers/models/autoencoders/autoencoder_kl_ltx2_audio.py#L759",parameters:[{name:"x",val:": Tensor"},{name:"return_dict",val:": bool = True"}]}),t(n);var d=e(n,2),A=r(d);o(A,{name:"decode",anchor:"diffusers.AutoencoderKLLTX2Audio.decode",source:"https://github.com/huggingface/diffusers/blob/vr_14246/src/diffusers/models/autoencoders/autoencoder_kl_ltx2_audio.py#L775",parameters:[{name:"z",val:": Tensor"},{name:"return_dict",val:": bool = True"}]}),t(d);var m=e(d,2),y=r(m);o(y,{name:"forward",anchor:"diffusers.AutoencoderKLLTX2Audio.forward",source:"https://github.com/huggingface/diffusers/blob/vr_14246/src/diffusers/models/autoencoders/autoencoder_kl_ltx2_audio.py#L788",parameters:[{name:"sample",val:": Tensor"},{name:"sample_posterior",val:": bool = False"},{name:"return_dict",val:": bool = True"},{name:"generator",val:": typing.Optional[torch.Generator] = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLLTX2Audio.forward.sample",description:"<strong>sample</strong> (<code>torch.Tensor</code>) — Input sample.",name:"sample"},{anchor:"diffusers.AutoencoderKLLTX2Audio.forward.sample_posterior",description:`<strong>sample_posterior</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to sample from the posterior.`,name:"sample_posterior"},{anchor:"diffusers.AutoencoderKLLTX2Audio.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <code>DecoderOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.AutoencoderKLLTX2Audio.forward.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) — | |
| A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make sampling | |
| deterministic.`,name:"generator"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>If <code>return_dict</code> is True, a <code>DecoderOutput</code> is returned, otherwise a plain <code>tuple</code> is returned.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>DecoderOutput</code> or <code>tuple</code></p> | |
| `}),t(m),t(a);var x=e(a,2);K(x,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoderkl_audio_ltx_2.md"}),E(2),v(b,s),J()}export{U as component}; | |
Xet Storage Details
- Size:
- 6.17 kB
- Xet hash:
- 3afd5e0abf9d26e5699cad1e27895a753d1a2946c411589ed14c639fb1124f71
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.