Buckets:
| import{s as tt,n as nt,o as ot}from"../chunks/scheduler.8c3d61f6.js";import{S as st,i as rt,g as i,s,r as u,A as at,h as l,f as t,c as r,j as _,u as c,x as b,k as v,y as n,a as m,v as p,d as g,t as f,w as h}from"../chunks/index.da70eac4.js";import{D as $}from"../chunks/Docstring.9419aa1d.js";import{C as it}from"../chunks/CodeBlock.a9c4becf.js";import{H as xe,E as lt}from"../chunks/getInferenceSnippets.39110341.js";function dt(Ue){let w,re,oe,ae,T,ie,k,Ge='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.',le,E,Ne="The model can be loaded with the following code snippet.",de,K,me,C,ue,a,O,Ae,q,We=`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>.`,De,R,Ze=`This model inherits from <a href="/docs/diffusers/pr_11340/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).`,Te,F,V,ke,J,I,Ee,L,j,Ke,z,qe=`Disable sliced VAE decoding. If <code>enable_slicing</code> was previously enabled, this method will go back to computing | |
| decoding in one step.`,Ce,x,P,Oe,Y,Re=`Disable tiled VAE decoding. If <code>enable_tiling</code> was previously enabled, this method will go back to computing | |
| decoding in one step.`,Ve,A,H,Ie,X,Fe=`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,D,S,Pe,Q,Je=`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.`,He,ee,B,ce,U,pe,M,G,Se,te,ze="Output of AutoencoderKL encoding method.",ge,N,fe,y,W,Be,ne,Ye="Output of decoding method.",he,Z,_e,se,ve;return T=new xe({props:{title:"AutoencoderKLMagvit",local:"autoencoderklmagvit",headingTag:"h1"}}),K=new it({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}}),C=new xe({props:{title:"AutoencoderKLMagvit",local:"diffusers.AutoencoderKLMagvit",headingTag:"h2"}}),O=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_11340/src/diffusers/models/autoencoders/autoencoder_kl_magvit.py#L666"}}),V=new $({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLMagvit.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_11340/src/diffusers/utils/accelerate_utils.py#L43"}}),I=new $({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLMagvit.encode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_11340/src/diffusers/utils/accelerate_utils.py#L43"}}),j=new $({props:{name:"disable_slicing",anchor:"diffusers.AutoencoderKLMagvit.disable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_11340/src/diffusers/models/autoencoders/autoencoder_kl_magvit.py#L822"}}),P=new $({props:{name:"disable_tiling",anchor:"diffusers.AutoencoderKLMagvit.disable_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_11340/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_11340/src/diffusers/models/autoencoders/autoencoder_kl_magvit.py#L815"}}),S=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_11340/src/diffusers/models/autoencoders/autoencoder_kl_magvit.py#L772"}}),B=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_11340/src/diffusers/models/autoencoders/autoencoder_kl_magvit.py#L1068"}}),U=new xe({props:{title:"AutoencoderKLOutput",local:"diffusers.models.modeling_outputs.AutoencoderKLOutput",headingTag:"h2"}}),G=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_11340/src/diffusers/models/modeling_outputs.py#L6"}}),N=new xe({props:{title:"DecoderOutput",local:"diffusers.models.autoencoders.vae.DecoderOutput",headingTag:"h2"}}),W=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_11340/src/diffusers/models/autoencoders/vae.py#L46"}}),Z=new lt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoderkl_magvit.md"}}),{c(){w=i("meta"),re=s(),oe=i("p"),ae=s(),u(T.$$.fragment),ie=s(),k=i("p"),k.innerHTML=Ge,le=s(),E=i("p"),E.textContent=Ne,de=s(),u(K.$$.fragment),me=s(),u(C.$$.fragment),ue=s(),a=i("div"),u(O.$$.fragment),Ae=s(),q=i("p"),q.innerHTML=We,De=s(),R=i("p"),R.innerHTML=Ze,Te=s(),F=i("div"),u(V.$$.fragment),ke=s(),J=i("div"),u(I.$$.fragment),Ee=s(),L=i("div"),u(j.$$.fragment),Ke=s(),z=i("p"),z.innerHTML=qe,Ce=s(),x=i("div"),u(P.$$.fragment),Oe=s(),Y=i("p"),Y.innerHTML=Re,Ve=s(),A=i("div"),u(H.$$.fragment),Ie=s(),X=i("p"),X.textContent=Fe,je=s(),D=i("div"),u(S.$$.fragment),Pe=s(),Q=i("p"),Q.textContent=Je,He=s(),ee=i("div"),u(B.$$.fragment),ce=s(),u(U.$$.fragment),pe=s(),M=i("div"),u(G.$$.fragment),Se=s(),te=i("p"),te.textContent=ze,ge=s(),u(N.$$.fragment),fe=s(),y=i("div"),u(W.$$.fragment),Be=s(),ne=i("p"),ne.textContent=Ye,he=s(),u(Z.$$.fragment),_e=s(),se=i("p"),this.h()},l(e){const o=at("svelte-u9bgzb",document.head);w=l(o,"META",{name:!0,content:!0}),o.forEach(t),re=r(e),oe=l(e,"P",{}),_(oe).forEach(t),ae=r(e),c(T.$$.fragment,e),ie=r(e),k=l(e,"P",{"data-svelte-h":!0}),b(k)!=="svelte-9t4ux3"&&(k.innerHTML=Ge),le=r(e),E=l(e,"P",{"data-svelte-h":!0}),b(E)!=="svelte-1vuni30"&&(E.textContent=Ne),de=r(e),c(K.$$.fragment,e),me=r(e),c(C.$$.fragment,e),ue=r(e),a=l(e,"DIV",{class:!0});var d=_(a);c(O.$$.fragment,d),Ae=r(d),q=l(d,"P",{"data-svelte-h":!0}),b(q)!=="svelte-17d0uff"&&(q.innerHTML=We),De=r(d),R=l(d,"P",{"data-svelte-h":!0}),b(R)!=="svelte-ib2yuf"&&(R.innerHTML=Ze),Te=r(d),F=l(d,"DIV",{class:!0});var Xe=_(F);c(V.$$.fragment,Xe),Xe.forEach(t),ke=r(d),J=l(d,"DIV",{class:!0});var Qe=_(J);c(I.$$.fragment,Qe),Qe.forEach(t),Ee=r(d),L=l(d,"DIV",{class:!0});var be=_(L);c(j.$$.fragment,be),Ke=r(be),z=l(be,"P",{"data-svelte-h":!0}),b(z)!=="svelte-189cc7b"&&(z.innerHTML=qe),be.forEach(t),Ce=r(d),x=l(d,"DIV",{class:!0});var $e=_(x);c(P.$$.fragment,$e),Oe=r($e),Y=l($e,"P",{"data-svelte-h":!0}),b(Y)!=="svelte-1f366pl"&&(Y.innerHTML=Re),$e.forEach(t),Ve=r(d),A=l(d,"DIV",{class:!0});var we=_(A);c(H.$$.fragment,we),Ie=r(we),X=l(we,"P",{"data-svelte-h":!0}),b(X)!=="svelte-14bnrb6"&&(X.textContent=Fe),we.forEach(t),je=r(d),D=l(d,"DIV",{class:!0});var Me=_(D);c(S.$$.fragment,Me),Pe=r(Me),Q=l(Me,"P",{"data-svelte-h":!0}),b(Q)!=="svelte-1xwrf7t"&&(Q.textContent=Je),Me.forEach(t),He=r(d),ee=l(d,"DIV",{class:!0});var et=_(ee);c(B.$$.fragment,et),et.forEach(t),d.forEach(t),ce=r(e),c(U.$$.fragment,e),pe=r(e),M=l(e,"DIV",{class:!0});var ye=_(M);c(G.$$.fragment,ye),Se=r(ye),te=l(ye,"P",{"data-svelte-h":!0}),b(te)!=="svelte-1vsc7ag"&&(te.textContent=ze),ye.forEach(t),ge=r(e),c(N.$$.fragment,e),fe=r(e),y=l(e,"DIV",{class:!0});var Le=_(y);c(W.$$.fragment,Le),Be=r(Le),ne=l(Le,"P",{"data-svelte-h":!0}),b(ne)!=="svelte-18u8upa"&&(ne.textContent=Ye),Le.forEach(t),he=r(e),c(Z.$$.fragment,e),_e=r(e),se=l(e,"P",{}),_(se).forEach(t),this.h()},h(){v(w,"name","hf:doc:metadata"),v(w,"content",mt),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(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(ee,"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,o){n(document.head,w),m(e,re,o),m(e,oe,o),m(e,ae,o),p(T,e,o),m(e,ie,o),m(e,k,o),m(e,le,o),m(e,E,o),m(e,de,o),p(K,e,o),m(e,me,o),p(C,e,o),m(e,ue,o),m(e,a,o),p(O,a,null),n(a,Ae),n(a,q),n(a,De),n(a,R),n(a,Te),n(a,F),p(V,F,null),n(a,ke),n(a,J),p(I,J,null),n(a,Ee),n(a,L),p(j,L,null),n(L,Ke),n(L,z),n(a,Ce),n(a,x),p(P,x,null),n(x,Oe),n(x,Y),n(a,Ve),n(a,A),p(H,A,null),n(A,Ie),n(A,X),n(a,je),n(a,D),p(S,D,null),n(D,Pe),n(D,Q),n(a,He),n(a,ee),p(B,ee,null),m(e,ce,o),p(U,e,o),m(e,pe,o),m(e,M,o),p(G,M,null),n(M,Se),n(M,te),m(e,ge,o),p(N,e,o),m(e,fe,o),m(e,y,o),p(W,y,null),n(y,Be),n(y,ne),m(e,he,o),p(Z,e,o),m(e,_e,o),m(e,se,o),ve=!0},p:nt,i(e){ve||(g(T.$$.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(H.$$.fragment,e),g(S.$$.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),ve=!0)},o(e){f(T.$$.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(H.$$.fragment,e),f(S.$$.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),ve=!1},d(e){e&&(t(re),t(oe),t(ae),t(ie),t(k),t(le),t(E),t(de),t(me),t(ue),t(a),t(ce),t(pe),t(M),t(ge),t(fe),t(y),t(he),t(_e),t(se)),t(w),h(T,e),h(K,e),h(C,e),h(O),h(V),h(I),h(j),h(P),h(H),h(S),h(B),h(U,e),h(G),h(N,e),h(W),h(Z,e)}}}const mt='{"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 ut(Ue){return ot(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _t extends st{constructor(w){super(),rt(this,w,ut,dt,tt,{})}}export{_t as component}; | |
Xet Storage Details
- Size:
- 16.2 kB
- Xet hash:
- 36c156432a62e667ea7668c9a67e7ab667f99291487e90008e03535b256991c9
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.