Buckets:

download
raw
6.32 kB
import"../chunks/DsnmJJEf.js";import{i as y,h as j,C as k,H as g,a as w,D as o,E as X,s as K}from"../chunks/BLbO27j4.js";import{p as I,o as J,s as e,f as q,a as v,b as G,c as t,d as _,r,n as Z}from"../chunks/jDjavuwI.js";const F='{"title":"AutoencoderKLLTX2Audio","local":"autoencoderklltx2audio","sections":[{"title":"AutoencoderKLLTX2Audio","local":"diffusers.AutoencoderKLLTX2Audio","sections":[],"depth":2}],"depth":1}';var H=_('<meta name="hf:doc:metadata"/>'),U=_('<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 W(b,L){I(L,!1),J(()=>{new URLSearchParams(window.location.search).get("fw")}),y();var s=U();j("14z5tsq",f=>{var h=H();K(h,"content",F),v(f,h)});var l=e(q(s),2);k(l,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var i=e(l,2);g(i,{title:"AutoencoderKLLTX2Audio",local:"autoencoderklltx2audio",headingTag:"h1"});var c=e(i,6);w(c,{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0xMVFgyQXVkaW8lMEElMEF2YWUlMjAlM0QlMjBBdXRvZW5jb2RlcktMTFRYMkF1ZGlvLmZyb21fcHJldHJhaW5lZCglMjJMaWdodHJpY2tzJTJGTFRYLTIlMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ2YWUlMjIlMkMlMjBkdHlwZSUzRHRvcmNoLmZsb2F0MzIpLnRvKCUyMmN1ZGElMjIpJTIwJTIwJTIzJTIwb3IlMjAlMjJtcHMlMjIlMkMlMjAlMjJ4cHUlMjIlMkMlMjAlMjJjcHUlMjI=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKLLTX2Audio
vae = AutoencoderKLLTX2Audio.from_pretrained(<span class="hljs-string">&quot;Lightricks/LTX-2&quot;</span>, subfolder=<span class="hljs-string">&quot;vae&quot;</span>, dtype=torch.float32).to(<span class="hljs-string">&quot;cuda&quot;</span>) <span class="hljs-comment"># or &quot;mps&quot;, &quot;xpu&quot;, &quot;cpu&quot;</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=t(a);o(p,{name:"class diffusers.AutoencoderKLLTX2Audio",anchor:"diffusers.AutoencoderKLLTX2Audio",source:"https://github.com/huggingface/diffusers/blob/vr_14921/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=t(n);o(T,{name:"encode",anchor:"diffusers.AutoencoderKLLTX2Audio.encode",source:"https://github.com/huggingface/diffusers/blob/vr_14921/src/diffusers/models/autoencoders/autoencoder_kl_ltx2_audio.py#L759",parameters:[{name:"x",val:": Tensor"},{name:"return_dict",val:": bool = True"}]}),r(n);var d=e(n,2),M=t(d);o(M,{name:"decode",anchor:"diffusers.AutoencoderKLLTX2Audio.decode",source:"https://github.com/huggingface/diffusers/blob/vr_14921/src/diffusers/models/autoencoders/autoencoder_kl_ltx2_audio.py#L775",parameters:[{name:"z",val:": Tensor"},{name:"return_dict",val:": bool = True"}]}),r(d);var m=e(d,2),A=t(m);o(A,{name:"forward",anchor:"diffusers.AutoencoderKLLTX2Audio.forward",source:"https://github.com/huggingface/diffusers/blob/vr_14921/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>) &#x2014; 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>) &#x2014;
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>) &#x2014;
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>) &#x2014;
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>
`}),r(m),r(a);var x=e(a,2);X(x,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoderkl_audio_ltx_2.md"}),Z(2),v(b,s),G()}export{W as component};

Xet Storage Details

Size:
6.32 kB
·
Xet hash:
de665415cee680389f1285ade33681745b38077c9093e2a5a3e1ef4cc7de0b3a

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