import{s as dt,n as lt,o as ut}from"../chunks/scheduler.53228c21.js";import{S as ct,i as mt,e as i,s as o,c,h as pt,a as d,d as n,b as r,f as _,g as m,j as v,k as b,l as t,m as u,n as p,t as f,o as g,p as h}from"../chunks/index.100fac89.js";import{C as ft}from"../chunks/CopyLLMTxtMenu.999d3d86.js";import{D as $}from"../chunks/Docstring.46d0934e.js";import{C as gt}from"../chunks/CodeBlock.d30a6509.js";import{H as ze,E as ht}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.d27ae4df.js";function _t(Fe){let y,de,se,le,A,ue,C,ce,K,qe='The 3D variational autoencoder (VAE) model with KL loss used in <a href="https://github.com/Tencent/HunyuanVideo1-1.5" rel="nofollow">HunyuanVideo1.5</a> by Tencent.',me,M,Be="The model can be loaded with the following code snippet.",pe,E,fe,k,ge,a,I,De,q,Re=`A VAE model with KL loss for encoding videos into latents and decoding latent representations into videos. Used for
HunyuanVideo-1.5.`,Ae,B,Qe=`This model inherits from <a href="/docs/diffusers/main/en/api/models/overview#diffusers.ModelMixin">ModelMixin</a>. Check the superclass documentation for it’s generic methods implemented
for all models (such as downloading or saving).`,Ce,R,O,Ke,Q,W,Me,w,J,Ee,X,Xe=`Disable sliced VAE decoding. If <code>enable_slicing</code> was previously enabled, this method will go back to computing
decoding in one step.`,ke,V,U,Ie,Y,Ye=`Disable tiled VAE decoding. If <code>enable_tiling</code> was previously enabled, this method will go back to computing
decoding in one step.`,Oe,T,G,We,ee,et=`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`,Je,L,Z,Ue,te,tt=`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`,Ge,ne,P,Ze,H,S,Pe,oe,nt="Decode a batch of images using a tiled decoder.",Se,D,N,Ne,re,ot="Encode a batch of images using a tiled encoder.",he,j,_e,x,z,je,ae,rt="Output of decoding method.",be,F,ve,ie,$e;return A=new ft({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),C=new ze({props:{title:"AutoencoderKLHunyuanVideo15",local:"autoencoderklhunyuanvideo15",headingTag:"h1"}}),E=new gt({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0xIdW55dWFuVmlkZW8xNSUwQSUwQXZhZSUyMCUzRCUyMEF1dG9lbmNvZGVyS0xIdW55dWFuVmlkZW8xNS5mcm9tX3ByZXRyYWluZWQoJTIyaHVueXVhbnZpZGVvLWNvbW11bml0eSUyRkh1bnl1YW5WaWRlby0xLjUtRGlmZnVzZXJzLTQ4MHBfdDJ2JTIyJTJDJTIwc3ViZm9sZGVyJTNEJTIydmFlJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDMyKSUwQSUwQSUyMyUyMG1ha2UlMjBzdXJlJTIwdG8lMjBlbmFibGUlMjB0aWxpbmclMjB0byUyMGF2b2lkJTIwT09NJTBBdmFlLmVuYWJsZV90aWxpbmcoKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKLHunyuanVideo15

vae = AutoencoderKLHunyuanVideo15.from_pretrained(<span class="hljs-string">&quot;hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-480p_t2v&quot;</span>, subfolder=<span class="hljs-string">&quot;vae&quot;</span>, torch_dtype=torch.float32)

<span class="hljs-comment"># make sure to enable tiling to avoid OOM</span>
vae.enable_tiling()`,wrap:!1}}),k=new ze({props:{title:"AutoencoderKLHunyuanVideo15",local:"diffusers.AutoencoderKLHunyuanVideo15",headingTag:"h2"}}),I=new $({props:{name:"class diffusers.AutoencoderKLHunyuanVideo15",anchor:"diffusers.AutoencoderKLHunyuanVideo15",parameters:[{name:"in_channels",val:": int = 3"},{name:"out_channels",val:": int = 3"},{name:"latent_channels",val:": int = 32"},{name:"block_out_channels",val:": typing.Tuple[int] = (128, 256, 512, 1024, 1024)"},{name:"layers_per_block",val:": int = 2"},{name:"spatial_compression_ratio",val:": int = 16"},{name:"temporal_compression_ratio",val:": int = 4"},{name:"downsample_match_channel",val:": bool = True"},{name:"upsample_match_channel",val:": bool = True"},{name:"scaling_factor",val:": float = 1.03682"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_hunyuanvideo15.py#L628"}}),O=new $({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLHunyuanVideo15.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/accelerate_utils.py#L43"}}),W=new $({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLHunyuanVideo15.encode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/accelerate_utils.py#L43"}}),J=new $({props:{name:"disable_slicing",anchor:"diffusers.AutoencoderKLHunyuanVideo15.disable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_hunyuanvideo15.py#L740"}}),U=new $({props:{name:"disable_tiling",anchor:"diffusers.AutoencoderKLHunyuanVideo15.disable_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_hunyuanvideo15.py#L726"}}),G=new $({props:{name:"enable_slicing",anchor:"diffusers.AutoencoderKLHunyuanVideo15.enable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_hunyuanvideo15.py#L733"}}),Z=new $({props:{name:"enable_tiling",anchor:"diffusers.AutoencoderKLHunyuanVideo15.enable_tiling",parameters:[{name:"tile_sample_min_height",val:": typing.Optional[int] = None"},{name:"tile_sample_min_width",val:": typing.Optional[int] = None"},{name:"tile_latent_min_height",val:": typing.Optional[int] = None"},{name:"tile_latent_min_width",val:": typing.Optional[int] = None"},{name:"tile_overlap_factor",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLHunyuanVideo15.enable_tiling.tile_sample_min_height",description:`<strong>tile_sample_min_height</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The minimum height required for a sample to be separated into tiles across the height dimension.`,name:"tile_sample_min_height"},{anchor:"diffusers.AutoencoderKLHunyuanVideo15.enable_tiling.tile_sample_min_width",description:`<strong>tile_sample_min_width</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The minimum width required for a sample to be separated into tiles across the width dimension.`,name:"tile_sample_min_width"},{anchor:"diffusers.AutoencoderKLHunyuanVideo15.enable_tiling.tile_latent_min_height",description:`<strong>tile_latent_min_height</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The minimum height required for a latent to be separated into tiles across the height dimension.`,name:"tile_latent_min_height"},{anchor:"diffusers.AutoencoderKLHunyuanVideo15.enable_tiling.tile_latent_min_width",description:`<strong>tile_latent_min_width</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The minimum width required for a latent to be separated into tiles across the width dimension.`,name:"tile_latent_min_width"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_hunyuanvideo15.py#L696"}}),P=new $({props:{name:"forward",anchor:"diffusers.AutoencoderKLHunyuanVideo15.forward",parameters:[{name:"sample",val:": Tensor"},{name:"sample_posterior",val:": bool = False"},{name:"return_dict",val:": bool = True"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLHunyuanVideo15.forward.sample",description:"<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014; Input sample.",name:"sample"},{anchor:"diffusers.AutoencoderKLHunyuanVideo15.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.AutoencoderKLHunyuanVideo15.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"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_hunyuanvideo15.py#L945"}}),S=new $({props:{name:"tiled_decode",anchor:"diffusers.AutoencoderKLHunyuanVideo15.tiled_decode",parameters:[{name:"z",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLHunyuanVideo15.tiled_decode.z",description:"<strong>z</strong> (<code>torch.Tensor</code>) &#x2014; Input batch of latent vectors.",name:"z"},{anchor:"diffusers.AutoencoderKLHunyuanVideo15.tiled_decode.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>~models.vae.DecoderOutput</code> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_hunyuanvideo15.py#L892",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If return_dict is True, a <code>~models.vae.DecoderOutput</code> is returned, otherwise a plain <code>tuple</code> is
returned.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>~models.vae.DecoderOutput</code> or <code>tuple</code></p>
`}}),N=new $({props:{name:"tiled_encode",anchor:"diffusers.AutoencoderKLHunyuanVideo15.tiled_encode",parameters:[{name:"x",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLHunyuanVideo15.tiled_encode.x",description:"<strong>x</strong> (<code>torch.Tensor</code>) &#x2014; Input batch of videos.",name:"x"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_hunyuanvideo15.py#L844",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The latent representation of the encoded videos.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.Tensor</code></p>
`}}),j=new ze({props:{title:"DecoderOutput",local:"diffusers.models.autoencoders.vae.DecoderOutput",headingTag:"h2"}}),z=new $({props:{name:"class diffusers.models.autoencoders.vae.DecoderOutput",anchor:"diffusers.models.autoencoders.vae.DecoderOutput",parameters:[{name:"sample",val:": Tensor"},{name:"commit_loss",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"diffusers.models.autoencoders.vae.DecoderOutput.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
The decoded output sample from the last layer of the model.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/vae.py#L47"}}),F=new ht({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoder_kl_hunyuan_video15.md"}}),{c(){y=i("meta"),de=o(),se=i("p"),le=o(),c(A.$$.fragment),ue=o(),c(C.$$.fragment),ce=o(),K=i("p"),K.innerHTML=qe,me=o(),M=i("p"),M.textContent=Be,pe=o(),c(E.$$.fragment),fe=o(),c(k.$$.fragment),ge=o(),a=i("div"),c(I.$$.fragment),De=o(),q=i("p"),q.textContent=Re,Ae=o(),B=i("p"),B.innerHTML=Qe,Ce=o(),R=i("div"),c(O.$$.fragment),Ke=o(),Q=i("div"),c(W.$$.fragment),Me=o(),w=i("div"),c(J.$$.fragment),Ee=o(),X=i("p"),X.innerHTML=Xe,ke=o(),V=i("div"),c(U.$$.fragment),Ie=o(),Y=i("p"),Y.innerHTML=Ye,Oe=o(),T=i("div"),c(G.$$.fragment),We=o(),ee=i("p"),ee.textContent=et,Je=o(),L=i("div"),c(Z.$$.fragment),Ue=o(),te=i("p"),te.textContent=tt,Ge=o(),ne=i("div"),c(P.$$.fragment),Ze=o(),H=i("div"),c(S.$$.fragment),Pe=o(),oe=i("p"),oe.textContent=nt,Se=o(),D=i("div"),c(N.$$.fragment),Ne=o(),re=i("p"),re.textContent=ot,he=o(),c(j.$$.fragment),_e=o(),x=i("div"),c(z.$$.fragment),je=o(),ae=i("p"),ae.textContent=rt,be=o(),c(F.$$.fragment),ve=o(),ie=i("p"),this.h()},l(e){const s=pt("svelte-u9bgzb",document.head);y=d(s,"META",{name:!0,content:!0}),s.forEach(n),de=r(e),se=d(e,"P",{}),_(se).forEach(n),le=r(e),m(A.$$.fragment,e),ue=r(e),m(C.$$.fragment,e),ce=r(e),K=d(e,"P",{"data-svelte-h":!0}),v(K)!=="svelte-byy59e"&&(K.innerHTML=qe),me=r(e),M=d(e,"P",{"data-svelte-h":!0}),v(M)!=="svelte-1vuni30"&&(M.textContent=Be),pe=r(e),m(E.$$.fragment,e),fe=r(e),m(k.$$.fragment,e),ge=r(e),a=d(e,"DIV",{class:!0});var l=_(a);m(I.$$.fragment,l),De=r(l),q=d(l,"P",{"data-svelte-h":!0}),v(q)!=="svelte-13uen37"&&(q.textContent=Re),Ae=r(l),B=d(l,"P",{"data-svelte-h":!0}),v(B)!=="svelte-1hyu2ru"&&(B.innerHTML=Qe),Ce=r(l),R=d(l,"DIV",{class:!0});var at=_(R);m(O.$$.fragment,at),at.forEach(n),Ke=r(l),Q=d(l,"DIV",{class:!0});var st=_(Q);m(W.$$.fragment,st),st.forEach(n),Me=r(l),w=d(l,"DIV",{class:!0});var ye=_(w);m(J.$$.fragment,ye),Ee=r(ye),X=d(ye,"P",{"data-svelte-h":!0}),v(X)!=="svelte-189cc7b"&&(X.innerHTML=Xe),ye.forEach(n),ke=r(l),V=d(l,"DIV",{class:!0});var xe=_(V);m(U.$$.fragment,xe),Ie=r(xe),Y=d(xe,"P",{"data-svelte-h":!0}),v(Y)!=="svelte-1f366pl"&&(Y.innerHTML=Ye),xe.forEach(n),Oe=r(l),T=d(l,"DIV",{class:!0});var we=_(T);m(G.$$.fragment,we),We=r(we),ee=d(we,"P",{"data-svelte-h":!0}),v(ee)!=="svelte-14bnrb6"&&(ee.textContent=et),we.forEach(n),Je=r(l),L=d(l,"DIV",{class:!0});var Ve=_(L);m(Z.$$.fragment,Ve),Ue=r(Ve),te=d(Ve,"P",{"data-svelte-h":!0}),v(te)!=="svelte-1xwrf7t"&&(te.textContent=tt),Ve.forEach(n),Ge=r(l),ne=d(l,"DIV",{class:!0});var it=_(ne);m(P.$$.fragment,it),it.forEach(n),Ze=r(l),H=d(l,"DIV",{class:!0});var Te=_(H);m(S.$$.fragment,Te),Pe=r(Te),oe=d(Te,"P",{"data-svelte-h":!0}),v(oe)!=="svelte-1vrxp2b"&&(oe.textContent=nt),Te.forEach(n),Se=r(l),D=d(l,"DIV",{class:!0});var Le=_(D);m(N.$$.fragment,Le),Ne=r(Le),re=d(Le,"P",{"data-svelte-h":!0}),v(re)!=="svelte-1un5fcn"&&(re.textContent=ot),Le.forEach(n),l.forEach(n),he=r(e),m(j.$$.fragment,e),_e=r(e),x=d(e,"DIV",{class:!0});var He=_(x);m(z.$$.fragment,He),je=r(He),ae=d(He,"P",{"data-svelte-h":!0}),v(ae)!=="svelte-18u8upa"&&(ae.textContent=rt),He.forEach(n),be=r(e),m(F.$$.fragment,e),ve=r(e),ie=d(e,"P",{}),_(ie).forEach(n),this.h()},h(){b(y,"name","hf:doc:metadata"),b(y,"content",bt),b(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(a,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,s){t(document.head,y),u(e,de,s),u(e,se,s),u(e,le,s),p(A,e,s),u(e,ue,s),p(C,e,s),u(e,ce,s),u(e,K,s),u(e,me,s),u(e,M,s),u(e,pe,s),p(E,e,s),u(e,fe,s),p(k,e,s),u(e,ge,s),u(e,a,s),p(I,a,null),t(a,De),t(a,q),t(a,Ae),t(a,B),t(a,Ce),t(a,R),p(O,R,null),t(a,Ke),t(a,Q),p(W,Q,null),t(a,Me),t(a,w),p(J,w,null),t(w,Ee),t(w,X),t(a,ke),t(a,V),p(U,V,null),t(V,Ie),t(V,Y),t(a,Oe),t(a,T),p(G,T,null),t(T,We),t(T,ee),t(a,Je),t(a,L),p(Z,L,null),t(L,Ue),t(L,te),t(a,Ge),t(a,ne),p(P,ne,null),t(a,Ze),t(a,H),p(S,H,null),t(H,Pe),t(H,oe),t(a,Se),t(a,D),p(N,D,null),t(D,Ne),t(D,re),u(e,he,s),p(j,e,s),u(e,_e,s),u(e,x,s),p(z,x,null),t(x,je),t(x,ae),u(e,be,s),p(F,e,s),u(e,ve,s),u(e,ie,s),$e=!0},p:lt,i(e){$e||(f(A.$$.fragment,e),f(C.$$.fragment,e),f(E.$$.fragment,e),f(k.$$.fragment,e),f(I.$$.fragment,e),f(O.$$.fragment,e),f(W.$$.fragment,e),f(J.$$.fragment,e),f(U.$$.fragment,e),f(G.$$.fragment,e),f(Z.$$.fragment,e),f(P.$$.fragment,e),f(S.$$.fragment,e),f(N.$$.fragment,e),f(j.$$.fragment,e),f(z.$$.fragment,e),f(F.$$.fragment,e),$e=!0)},o(e){g(A.$$.fragment,e),g(C.$$.fragment,e),g(E.$$.fragment,e),g(k.$$.fragment,e),g(I.$$.fragment,e),g(O.$$.fragment,e),g(W.$$.fragment,e),g(J.$$.fragment,e),g(U.$$.fragment,e),g(G.$$.fragment,e),g(Z.$$.fragment,e),g(P.$$.fragment,e),g(S.$$.fragment,e),g(N.$$.fragment,e),g(j.$$.fragment,e),g(z.$$.fragment,e),g(F.$$.fragment,e),$e=!1},d(e){e&&(n(de),n(se),n(le),n(ue),n(ce),n(K),n(me),n(M),n(pe),n(fe),n(ge),n(a),n(he),n(_e),n(x),n(be),n(ve),n(ie)),n(y),h(A,e),h(C,e),h(E,e),h(k,e),h(I),h(O),h(W),h(J),h(U),h(G),h(Z),h(P),h(S),h(N),h(j,e),h(z),h(F,e)}}}const bt='{"title":"AutoencoderKLHunyuanVideo15","local":"autoencoderklhunyuanvideo15","sections":[{"title":"AutoencoderKLHunyuanVideo15","local":"diffusers.AutoencoderKLHunyuanVideo15","sections":[],"depth":2},{"title":"DecoderOutput","local":"diffusers.models.autoencoders.vae.DecoderOutput","sections":[],"depth":2}],"depth":1}';function vt(Fe){return ut(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Lt extends ct{constructor(y){super(),mt(this,y,vt,_t,dt,{})}}export{Lt as component};
