Buckets:
| import{s as ot,n as rt,o as st}from"../chunks/scheduler.53228c21.js";import{S as at,i as it,e as i,s as r,c as p,h as lt,a as l,d as t,b as s,f as _,g as u,j as b,k as v,l as o,m as d,n as c,t as f,o as g,p as h}from"../chunks/index.100fac89.js";import{C as dt}from"../chunks/CopyLLMTxtMenu.c36f1912.js";import{D as $}from"../chunks/Docstring.00e63d45.js";import{C as mt}from"../chunks/CodeBlock.d30a6509.js";import{H as Te,E as pt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c6997d0b.js";function ut(Ne){let w,ae,re,ie,D,le,k,de,E,We='The 3D variational autoencoder (VAE) model with KL loss used in <a href="https://github.com/aigc-apps/EasyAnimate" rel="nofollow">EasyAnimate</a> was introduced by Alibaba PAI.',me,K,Ze="The model can be loaded with the following code snippet.",pe,C,ue,O,ce,a,V,De,R,qe=`A VAE model with KL loss for encoding images into latents and decoding latent representations into images. This | |
| model is used in <a href="https://huggingface.co/papers/2405.18991" rel="nofollow">EasyAnimate</a>.`,ke,z,Re=`This model inherits from <a href="/docs/diffusers/pr_12509/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).`,Ee,F,I,Ke,J,j,Ce,L,P,Oe,Y,ze=`Disable sliced VAE decoding. If <code>enable_slicing</code> was previously enabled, this method will go back to computing | |
| decoding in one step.`,Ve,x,S,Ie,X,Fe=`Disable tiled VAE decoding. If <code>enable_tiling</code> was previously enabled, this method will go back to computing | |
| decoding in one step.`,je,A,H,Pe,Q,Je=`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.`,Se,T,B,He,ee,Ye=`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.`,Be,te,U,fe,G,ge,M,N,Ue,ne,Xe="Output of AutoencoderKL encoding method.",he,W,_e,y,Z,Ge,oe,Qe="Output of decoding method.",ve,q,be,se,$e;return D=new dt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),k=new Te({props:{title:"AutoencoderKLMagvit",local:"autoencoderklmagvit",headingTag:"h1"}}),C=new mt({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0xNYWd2aXQlMEElMEF2YWUlMjAlM0QlMjBBdXRvZW5jb2RlcktMTWFndml0LmZyb21fcHJldHJhaW5lZCglMjJhbGliYWJhLXBhaSUyRkVhc3lBbmltYXRlVjUuMS0xMmItemglMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ2YWUlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKLMagvit | |
| vae = AutoencoderKLMagvit.from_pretrained(<span class="hljs-string">"alibaba-pai/EasyAnimateV5.1-12b-zh"</span>, subfolder=<span class="hljs-string">"vae"</span>, torch_dtype=torch.float16).to(<span class="hljs-string">"cuda"</span>)`,wrap:!1}}),O=new Te({props:{title:"AutoencoderKLMagvit",local:"diffusers.AutoencoderKLMagvit",headingTag:"h2"}}),V=new $({props:{name:"class diffusers.AutoencoderKLMagvit",anchor:"diffusers.AutoencoderKLMagvit",parameters:[{name:"in_channels",val:": int = 3"},{name:"latent_channels",val:": int = 16"},{name:"out_channels",val:": int = 3"},{name:"block_out_channels",val:": typing.Tuple[int, ...] = [128, 256, 512, 512]"},{name:"down_block_types",val:": typing.Tuple[str, ...] = ['SpatialDownBlock3D', 'SpatialTemporalDownBlock3D', 'SpatialTemporalDownBlock3D', 'SpatialTemporalDownBlock3D']"},{name:"up_block_types",val:": typing.Tuple[str, ...] = ['SpatialUpBlock3D', 'SpatialTemporalUpBlock3D', 'SpatialTemporalUpBlock3D', 'SpatialTemporalUpBlock3D']"},{name:"layers_per_block",val:": int = 2"},{name:"act_fn",val:": str = 'silu'"},{name:"norm_num_groups",val:": int = 32"},{name:"scaling_factor",val:": float = 0.7125"},{name:"spatial_group_norm",val:": bool = True"}],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/models/autoencoders/autoencoder_kl_magvit.py#L666"}}),I=new $({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLMagvit.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/utils/accelerate_utils.py#L43"}}),j=new $({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLMagvit.encode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/utils/accelerate_utils.py#L43"}}),P=new $({props:{name:"disable_slicing",anchor:"diffusers.AutoencoderKLMagvit.disable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/models/autoencoders/autoencoder_kl_magvit.py#L822"}}),S=new $({props:{name:"disable_tiling",anchor:"diffusers.AutoencoderKLMagvit.disable_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/models/autoencoders/autoencoder_kl_magvit.py#L808"}}),H=new $({props:{name:"enable_slicing",anchor:"diffusers.AutoencoderKLMagvit.enable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/models/autoencoders/autoencoder_kl_magvit.py#L815"}}),B=new $({props:{name:"enable_tiling",anchor:"diffusers.AutoencoderKLMagvit.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_sample_min_num_frames",val:": typing.Optional[int] = None"},{name:"tile_sample_stride_height",val:": typing.Optional[float] = None"},{name:"tile_sample_stride_width",val:": typing.Optional[float] = None"},{name:"tile_sample_stride_num_frames",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLMagvit.enable_tiling.tile_sample_min_height",description:`<strong>tile_sample_min_height</strong> (<code>int</code>, <em>optional</em>) — | |
| The minimum height required for a sample to be separated into tiles across the height dimension.`,name:"tile_sample_min_height"},{anchor:"diffusers.AutoencoderKLMagvit.enable_tiling.tile_sample_min_width",description:`<strong>tile_sample_min_width</strong> (<code>int</code>, <em>optional</em>) — | |
| The minimum width required for a sample to be separated into tiles across the width dimension.`,name:"tile_sample_min_width"},{anchor:"diffusers.AutoencoderKLMagvit.enable_tiling.tile_sample_stride_height",description:`<strong>tile_sample_stride_height</strong> (<code>int</code>, <em>optional</em>) — | |
| The minimum amount of overlap between two consecutive vertical tiles. This is to ensure that there are | |
| no tiling artifacts produced across the height dimension.`,name:"tile_sample_stride_height"},{anchor:"diffusers.AutoencoderKLMagvit.enable_tiling.tile_sample_stride_width",description:`<strong>tile_sample_stride_width</strong> (<code>int</code>, <em>optional</em>) — | |
| The stride between two consecutive horizontal tiles. This is to ensure that there are no tiling | |
| artifacts produced across the width dimension.`,name:"tile_sample_stride_width"}],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/models/autoencoders/autoencoder_kl_magvit.py#L772"}}),U=new $({props:{name:"forward",anchor:"diffusers.AutoencoderKLMagvit.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.AutoencoderKLMagvit.forward.sample",description:"<strong>sample</strong> (<code>torch.Tensor</code>) — Input sample.",name:"sample"},{anchor:"diffusers.AutoencoderKLMagvit.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.AutoencoderKLMagvit.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"}],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/models/autoencoders/autoencoder_kl_magvit.py#L1068"}}),G=new Te({props:{title:"AutoencoderKLOutput",local:"diffusers.models.modeling_outputs.AutoencoderKLOutput",headingTag:"h2"}}),N=new $({props:{name:"class diffusers.models.modeling_outputs.AutoencoderKLOutput",anchor:"diffusers.models.modeling_outputs.AutoencoderKLOutput",parameters:[{name:"latent_dist",val:": DiagonalGaussianDistribution"}],parametersDescription:[{anchor:"diffusers.models.modeling_outputs.AutoencoderKLOutput.latent_dist",description:`<strong>latent_dist</strong> (<code>DiagonalGaussianDistribution</code>) — | |
| Encoded outputs of <code>Encoder</code> represented as the mean and logvar of <code>DiagonalGaussianDistribution</code>. | |
| <code>DiagonalGaussianDistribution</code> allows for sampling latents from the distribution.`,name:"latent_dist"}],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/models/modeling_outputs.py#L7"}}),W=new Te({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>) — | |
| The decoded output sample from the last layer of the model.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/models/autoencoders/vae.py#L47"}}),q=new pt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoderkl_magvit.md"}}),{c(){w=i("meta"),ae=r(),re=i("p"),ie=r(),p(D.$$.fragment),le=r(),p(k.$$.fragment),de=r(),E=i("p"),E.innerHTML=We,me=r(),K=i("p"),K.textContent=Ze,pe=r(),p(C.$$.fragment),ue=r(),p(O.$$.fragment),ce=r(),a=i("div"),p(V.$$.fragment),De=r(),R=i("p"),R.innerHTML=qe,ke=r(),z=i("p"),z.innerHTML=Re,Ee=r(),F=i("div"),p(I.$$.fragment),Ke=r(),J=i("div"),p(j.$$.fragment),Ce=r(),L=i("div"),p(P.$$.fragment),Oe=r(),Y=i("p"),Y.innerHTML=ze,Ve=r(),x=i("div"),p(S.$$.fragment),Ie=r(),X=i("p"),X.innerHTML=Fe,je=r(),A=i("div"),p(H.$$.fragment),Pe=r(),Q=i("p"),Q.textContent=Je,Se=r(),T=i("div"),p(B.$$.fragment),He=r(),ee=i("p"),ee.textContent=Ye,Be=r(),te=i("div"),p(U.$$.fragment),fe=r(),p(G.$$.fragment),ge=r(),M=i("div"),p(N.$$.fragment),Ue=r(),ne=i("p"),ne.textContent=Xe,he=r(),p(W.$$.fragment),_e=r(),y=i("div"),p(Z.$$.fragment),Ge=r(),oe=i("p"),oe.textContent=Qe,ve=r(),p(q.$$.fragment),be=r(),se=i("p"),this.h()},l(e){const n=lt("svelte-u9bgzb",document.head);w=l(n,"META",{name:!0,content:!0}),n.forEach(t),ae=s(e),re=l(e,"P",{}),_(re).forEach(t),ie=s(e),u(D.$$.fragment,e),le=s(e),u(k.$$.fragment,e),de=s(e),E=l(e,"P",{"data-svelte-h":!0}),b(E)!=="svelte-9t4ux3"&&(E.innerHTML=We),me=s(e),K=l(e,"P",{"data-svelte-h":!0}),b(K)!=="svelte-1vuni30"&&(K.textContent=Ze),pe=s(e),u(C.$$.fragment,e),ue=s(e),u(O.$$.fragment,e),ce=s(e),a=l(e,"DIV",{class:!0});var m=_(a);u(V.$$.fragment,m),De=s(m),R=l(m,"P",{"data-svelte-h":!0}),b(R)!=="svelte-17d0uff"&&(R.innerHTML=qe),ke=s(m),z=l(m,"P",{"data-svelte-h":!0}),b(z)!=="svelte-18gkr4p"&&(z.innerHTML=Re),Ee=s(m),F=l(m,"DIV",{class:!0});var et=_(F);u(I.$$.fragment,et),et.forEach(t),Ke=s(m),J=l(m,"DIV",{class:!0});var tt=_(J);u(j.$$.fragment,tt),tt.forEach(t),Ce=s(m),L=l(m,"DIV",{class:!0});var we=_(L);u(P.$$.fragment,we),Oe=s(we),Y=l(we,"P",{"data-svelte-h":!0}),b(Y)!=="svelte-189cc7b"&&(Y.innerHTML=ze),we.forEach(t),Ve=s(m),x=l(m,"DIV",{class:!0});var Me=_(x);u(S.$$.fragment,Me),Ie=s(Me),X=l(Me,"P",{"data-svelte-h":!0}),b(X)!=="svelte-1f366pl"&&(X.innerHTML=Fe),Me.forEach(t),je=s(m),A=l(m,"DIV",{class:!0});var ye=_(A);u(H.$$.fragment,ye),Pe=s(ye),Q=l(ye,"P",{"data-svelte-h":!0}),b(Q)!=="svelte-14bnrb6"&&(Q.textContent=Je),ye.forEach(t),Se=s(m),T=l(m,"DIV",{class:!0});var Le=_(T);u(B.$$.fragment,Le),He=s(Le),ee=l(Le,"P",{"data-svelte-h":!0}),b(ee)!=="svelte-1xwrf7t"&&(ee.textContent=Ye),Le.forEach(t),Be=s(m),te=l(m,"DIV",{class:!0});var nt=_(te);u(U.$$.fragment,nt),nt.forEach(t),m.forEach(t),fe=s(e),u(G.$$.fragment,e),ge=s(e),M=l(e,"DIV",{class:!0});var xe=_(M);u(N.$$.fragment,xe),Ue=s(xe),ne=l(xe,"P",{"data-svelte-h":!0}),b(ne)!=="svelte-1vsc7ag"&&(ne.textContent=Xe),xe.forEach(t),he=s(e),u(W.$$.fragment,e),_e=s(e),y=l(e,"DIV",{class:!0});var Ae=_(y);u(Z.$$.fragment,Ae),Ge=s(Ae),oe=l(Ae,"P",{"data-svelte-h":!0}),b(oe)!=="svelte-18u8upa"&&(oe.textContent=Qe),Ae.forEach(t),ve=s(e),u(q.$$.fragment,e),be=s(e),se=l(e,"P",{}),_(se).forEach(t),this.h()},h(){v(w,"name","hf:doc:metadata"),v(w,"content",ct),v(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(a,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(y,"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,n){o(document.head,w),d(e,ae,n),d(e,re,n),d(e,ie,n),c(D,e,n),d(e,le,n),c(k,e,n),d(e,de,n),d(e,E,n),d(e,me,n),d(e,K,n),d(e,pe,n),c(C,e,n),d(e,ue,n),c(O,e,n),d(e,ce,n),d(e,a,n),c(V,a,null),o(a,De),o(a,R),o(a,ke),o(a,z),o(a,Ee),o(a,F),c(I,F,null),o(a,Ke),o(a,J),c(j,J,null),o(a,Ce),o(a,L),c(P,L,null),o(L,Oe),o(L,Y),o(a,Ve),o(a,x),c(S,x,null),o(x,Ie),o(x,X),o(a,je),o(a,A),c(H,A,null),o(A,Pe),o(A,Q),o(a,Se),o(a,T),c(B,T,null),o(T,He),o(T,ee),o(a,Be),o(a,te),c(U,te,null),d(e,fe,n),c(G,e,n),d(e,ge,n),d(e,M,n),c(N,M,null),o(M,Ue),o(M,ne),d(e,he,n),c(W,e,n),d(e,_e,n),d(e,y,n),c(Z,y,null),o(y,Ge),o(y,oe),d(e,ve,n),c(q,e,n),d(e,be,n),d(e,se,n),$e=!0},p:rt,i(e){$e||(f(D.$$.fragment,e),f(k.$$.fragment,e),f(C.$$.fragment,e),f(O.$$.fragment,e),f(V.$$.fragment,e),f(I.$$.fragment,e),f(j.$$.fragment,e),f(P.$$.fragment,e),f(S.$$.fragment,e),f(H.$$.fragment,e),f(B.$$.fragment,e),f(U.$$.fragment,e),f(G.$$.fragment,e),f(N.$$.fragment,e),f(W.$$.fragment,e),f(Z.$$.fragment,e),f(q.$$.fragment,e),$e=!0)},o(e){g(D.$$.fragment,e),g(k.$$.fragment,e),g(C.$$.fragment,e),g(O.$$.fragment,e),g(V.$$.fragment,e),g(I.$$.fragment,e),g(j.$$.fragment,e),g(P.$$.fragment,e),g(S.$$.fragment,e),g(H.$$.fragment,e),g(B.$$.fragment,e),g(U.$$.fragment,e),g(G.$$.fragment,e),g(N.$$.fragment,e),g(W.$$.fragment,e),g(Z.$$.fragment,e),g(q.$$.fragment,e),$e=!1},d(e){e&&(t(ae),t(re),t(ie),t(le),t(de),t(E),t(me),t(K),t(pe),t(ue),t(ce),t(a),t(fe),t(ge),t(M),t(he),t(_e),t(y),t(ve),t(be),t(se)),t(w),h(D,e),h(k,e),h(C,e),h(O,e),h(V),h(I),h(j),h(P),h(S),h(H),h(B),h(U),h(G,e),h(N),h(W,e),h(Z),h(q,e)}}}const ct='{"title":"AutoencoderKLMagvit","local":"autoencoderklmagvit","sections":[{"title":"AutoencoderKLMagvit","local":"diffusers.AutoencoderKLMagvit","sections":[],"depth":2},{"title":"AutoencoderKLOutput","local":"diffusers.models.modeling_outputs.AutoencoderKLOutput","sections":[],"depth":2},{"title":"DecoderOutput","local":"diffusers.models.autoencoders.vae.DecoderOutput","sections":[],"depth":2}],"depth":1}';function ft(Ne){return st(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wt extends at{constructor(w){super(),it(this,w,ft,ut,ot,{})}}export{wt as component}; | |
Xet Storage Details
- Size:
- 16.6 kB
- Xet hash:
- 4701adebf724810b941dcfe9a90d57d83d053501c9c03a7544f376bcc2b7511d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.