import{s as pe,n as ge,o as he}from"../chunks/scheduler.8c3d61f6.js";import{S as $e,i as ve,g as l,s as o,r as f,A as be,h as d,f as n,c as r,j as V,u as p,x as O,k as I,y as i,a,v as g,d as h,t as $,w as v}from"../chunks/index.da70eac4.js";import{D as Q}from"../chunks/Docstring.6b390b9a.js";import{C as _e}from"../chunks/CodeBlock.00a903b3.js";import{H as re,E as ye}from"../chunks/EditOnGithub.1e64e623.js";function we(se){let u,j,Z,P,b,H,_,le='The 3D variational autoencoder (VAE) model with KL loss used in <a href="https://github.com/Wan-Video/Wan2.1" rel="nofollow">Wan 2.1</a> by the Alibaba Wan Team.',F,y,de="The model can be loaded with the following code snippet.",R,w,U,T,q,s,L,ee,C,ie=`A VAE model with KL loss for encoding videos into latents and decoding latent representations into videos.
Introduced in [Wan 2.1].`,te,E,me=`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).`,ne,J,W,ae,K,x,z,M,S,c,A,oe,k,ue="Output of decoding method.",X,D,Y,G,B;return b=new re({props:{title:"AutoencoderKLWan",local:"autoencoderklwan",headingTag:"h1"}}),w=new _e({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0xXYW4lMEElMEF2YWUlMjAlM0QlMjBBdXRvZW5jb2RlcktMV2FuLmZyb21fcHJldHJhaW5lZCglMjJXYW4tQUklMkZXYW4yLjEtVDJWLTEuM0ItRGlmZnVzZXJzJTIyJTJDJTIwc3ViZm9sZGVyJTNEJTIydmFlJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDMyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKLWan

vae = AutoencoderKLWan.from_pretrained(<span class="hljs-string">&quot;Wan-AI/Wan2.1-T2V-1.3B-Diffusers&quot;</span>, subfolder=<span class="hljs-string">&quot;vae&quot;</span>, torch_dtype=torch.float32)`,wrap:!1}}),T=new re({props:{title:"AutoencoderKLWan",local:"diffusers.AutoencoderKLWan",headingTag:"h2"}}),L=new Q({props:{name:"class diffusers.AutoencoderKLWan",anchor:"diffusers.AutoencoderKLWan",parameters:[{name:"base_dim",val:": int = 96"},{name:"z_dim",val:": int = 16"},{name:"dim_mult",val:": typing.Tuple[int] = [1, 2, 4, 4]"},{name:"num_res_blocks",val:": int = 2"},{name:"attn_scales",val:": typing.List[float] = []"},{name:"temperal_downsample",val:": typing.List[bool] = [False, True, True]"},{name:"dropout",val:": float = 0.0"},{name:"latents_mean",val:": typing.List[float] = [-0.7571, -0.7089, -0.9113, 0.1075, -0.1745, 0.9653, -0.1517, 1.5508, 0.4134, -0.0715, 0.5517, -0.3632, -0.1922, -0.9497, 0.2503, -0.2921]"},{name:"latents_std",val:": typing.List[float] = [2.8184, 1.4541, 2.3275, 2.6558, 1.2196, 1.7708, 2.6052, 2.0743, 3.2687, 2.1526, 2.8652, 1.5579, 1.6382, 1.1253, 2.8251, 1.916]"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_wan.py#L659"}}),W=new Q({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLWan.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/utils/accelerate_utils.py#L43"}}),x=new Q({props:{name:"forward",anchor:"diffusers.AutoencoderKLWan.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.AutoencoderKLWan.forward.sample",description:"<strong>sample</strong> (<code>torch.Tensor</code>) &#x2014; Input sample.",name:"sample"},{anchor:"diffusers.AutoencoderKLWan.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_wan.py#L835"}}),M=new re({props:{title:"DecoderOutput",local:"diffusers.models.autoencoders.vae.DecoderOutput",headingTag:"h2"}}),A=new Q({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#L46"}}),D=new ye({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoder_kl_wan.md"}}),{c(){u=l("meta"),j=o(),Z=l("p"),P=o(),f(b.$$.fragment),H=o(),_=l("p"),_.innerHTML=le,F=o(),y=l("p"),y.textContent=de,R=o(),f(w.$$.fragment),U=o(),f(T.$$.fragment),q=o(),s=l("div"),f(L.$$.fragment),ee=o(),C=l("p"),C.textContent=ie,te=o(),E=l("p"),E.innerHTML=me,ne=o(),J=l("div"),f(W.$$.fragment),ae=o(),K=l("div"),f(x.$$.fragment),z=o(),f(M.$$.fragment),S=o(),c=l("div"),f(A.$$.fragment),oe=o(),k=l("p"),k.textContent=ue,X=o(),f(D.$$.fragment),Y=o(),G=l("p"),this.h()},l(e){const t=be("svelte-u9bgzb",document.head);u=d(t,"META",{name:!0,content:!0}),t.forEach(n),j=r(e),Z=d(e,"P",{}),V(Z).forEach(n),P=r(e),p(b.$$.fragment,e),H=r(e),_=d(e,"P",{"data-svelte-h":!0}),O(_)!=="svelte-tl45xs"&&(_.innerHTML=le),F=r(e),y=d(e,"P",{"data-svelte-h":!0}),O(y)!=="svelte-1vuni30"&&(y.textContent=de),R=r(e),p(w.$$.fragment,e),U=r(e),p(T.$$.fragment,e),q=r(e),s=d(e,"DIV",{class:!0});var m=V(s);p(L.$$.fragment,m),ee=r(m),C=d(m,"P",{"data-svelte-h":!0}),O(C)!=="svelte-1cxmnva"&&(C.textContent=ie),te=r(m),E=d(m,"P",{"data-svelte-h":!0}),O(E)!=="svelte-1hyu2ru"&&(E.innerHTML=me),ne=r(m),J=d(m,"DIV",{class:!0});var ce=V(J);p(W.$$.fragment,ce),ce.forEach(n),ae=r(m),K=d(m,"DIV",{class:!0});var fe=V(K);p(x.$$.fragment,fe),fe.forEach(n),m.forEach(n),z=r(e),p(M.$$.fragment,e),S=r(e),c=d(e,"DIV",{class:!0});var N=V(c);p(A.$$.fragment,N),oe=r(N),k=d(N,"P",{"data-svelte-h":!0}),O(k)!=="svelte-18u8upa"&&(k.textContent=ue),N.forEach(n),X=r(e),p(D.$$.fragment,e),Y=r(e),G=d(e,"P",{}),V(G).forEach(n),this.h()},h(){I(u,"name","hf:doc:metadata"),I(u,"content",Te),I(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(s,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(c,"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,t){i(document.head,u),a(e,j,t),a(e,Z,t),a(e,P,t),g(b,e,t),a(e,H,t),a(e,_,t),a(e,F,t),a(e,y,t),a(e,R,t),g(w,e,t),a(e,U,t),g(T,e,t),a(e,q,t),a(e,s,t),g(L,s,null),i(s,ee),i(s,C),i(s,te),i(s,E),i(s,ne),i(s,J),g(W,J,null),i(s,ae),i(s,K),g(x,K,null),a(e,z,t),g(M,e,t),a(e,S,t),a(e,c,t),g(A,c,null),i(c,oe),i(c,k),a(e,X,t),g(D,e,t),a(e,Y,t),a(e,G,t),B=!0},p:ge,i(e){B||(h(b.$$.fragment,e),h(w.$$.fragment,e),h(T.$$.fragment,e),h(L.$$.fragment,e),h(W.$$.fragment,e),h(x.$$.fragment,e),h(M.$$.fragment,e),h(A.$$.fragment,e),h(D.$$.fragment,e),B=!0)},o(e){$(b.$$.fragment,e),$(w.$$.fragment,e),$(T.$$.fragment,e),$(L.$$.fragment,e),$(W.$$.fragment,e),$(x.$$.fragment,e),$(M.$$.fragment,e),$(A.$$.fragment,e),$(D.$$.fragment,e),B=!1},d(e){e&&(n(j),n(Z),n(P),n(H),n(_),n(F),n(y),n(R),n(U),n(q),n(s),n(z),n(S),n(c),n(X),n(Y),n(G)),n(u),v(b,e),v(w,e),v(T,e),v(L),v(W),v(x),v(M,e),v(A),v(D,e)}}}const Te='{"title":"AutoencoderKLWan","local":"autoencoderklwan","sections":[{"title":"AutoencoderKLWan","local":"diffusers.AutoencoderKLWan","sections":[],"depth":2},{"title":"DecoderOutput","local":"diffusers.models.autoencoders.vae.DecoderOutput","sections":[],"depth":2}],"depth":1}';function Le(se){return he(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ce extends $e{constructor(u){super(),ve(this,u,Le,we,pe,{})}}export{Ce as component};
