Buckets:
| import{s as Se,n as Ge,o as Ve}from"../chunks/scheduler.53228c21.js";import{S as Be,i as Ie,e as l,s as n,c as u,h as Pe,a as d,d as t,b as a,f as b,g as p,j as B,k as w,l as i,m as r,n as c,t as f,o as g,p as h}from"../chunks/index.100fac89.js";import{C as Ue}from"../chunks/CopyLLMTxtMenu.f7e332d5.js";import{D as I}from"../chunks/Docstring.8934f3ee.js";import{C as He}from"../chunks/CodeBlock.0adb3827.js";import{H as ge,E as We}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.b70fb789.js";function Ze(ye){let _,Y,F,X,L,Q,x,ee,y,Ae='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.',te,A,De="The model can be loaded with the following code snippet.",oe,D,ne,T,ae,s,k,he,P,Te=`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>.`,_e,U,ke=`This model inherits from <a href="/docs/diffusers/pr_13769/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).`,ve,H,K,$e,W,E,be,M,C,we,Z,Ke=`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.`,Me,q,N,re,j,se,v,O,Le,R,Ee="Output of AutoencoderKL encoding method.",ie,S,le,$,G,xe,z,Ce="Output of decoding method.",de,V,me,J,ue;return L=new Ue({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),x=new ge({props:{title:"AutoencoderKLMagvit",local:"autoencoderklmagvit",headingTag:"h1"}}),D=new He({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>)`,lang:"python",wrap:!1}}),T=new ge({props:{title:"AutoencoderKLMagvit",local:"diffusers.AutoencoderKLMagvit",headingTag:"h2"}}),k=new I({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:": tuple = [128, 256, 512, 512]"},{name:"down_block_types",val:": tuple = ['SpatialDownBlock3D', 'SpatialTemporalDownBlock3D', 'SpatialTemporalDownBlock3D', 'SpatialTemporalDownBlock3D']"},{name:"up_block_types",val:": tuple = ['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_13769/src/diffusers/models/autoencoders/autoencoder_kl_magvit.py#L665"}}),K=new I({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLMagvit.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_13769/src/diffusers/utils/accelerate_utils.py#L43"}}),E=new I({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLMagvit.encode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_13769/src/diffusers/utils/accelerate_utils.py#L43"}}),C=new I({props:{name:"enable_tiling",anchor:"diffusers.AutoencoderKLMagvit.enable_tiling",parameters:[{name:"tile_sample_min_height",val:": int | None = None"},{name:"tile_sample_min_width",val:": int | None = None"},{name:"tile_sample_min_num_frames",val:": int | None = None"},{name:"tile_sample_stride_height",val:": float | None = None"},{name:"tile_sample_stride_width",val:": float | None = None"},{name:"tile_sample_stride_num_frames",val:": float | None = 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_13769/src/diffusers/models/autoencoders/autoencoder_kl_magvit.py#L771"}}),N=new I({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:": torch._C.Generator | None = 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"},{anchor:"diffusers.AutoencoderKLMagvit.forward.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) — | |
| 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"}],source:"https://github.com/huggingface/diffusers/blob/vr_13769/src/diffusers/models/autoencoders/autoencoder_kl_magvit.py#L1046"}}),j=new ge({props:{title:"AutoencoderKLOutput",local:"diffusers.models.modeling_outputs.AutoencoderKLOutput",headingTag:"h2"}}),O=new I({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_13769/src/diffusers/models/modeling_outputs.py#L7"}}),S=new ge({props:{title:"DecoderOutput",local:"diffusers.models.autoencoders.vae.DecoderOutput",headingTag:"h2"}}),G=new I({props:{name:"class diffusers.models.autoencoders.vae.DecoderOutput",anchor:"diffusers.models.autoencoders.vae.DecoderOutput",parameters:[{name:"sample",val:": Tensor"},{name:"commit_loss",val:": torch.FloatTensor | None = 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_13769/src/diffusers/models/autoencoders/vae.py#L46"}}),V=new We({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoderkl_magvit.md"}}),{c(){_=l("meta"),Y=n(),F=l("p"),X=n(),u(L.$$.fragment),Q=n(),u(x.$$.fragment),ee=n(),y=l("p"),y.innerHTML=Ae,te=n(),A=l("p"),A.textContent=De,oe=n(),u(D.$$.fragment),ne=n(),u(T.$$.fragment),ae=n(),s=l("div"),u(k.$$.fragment),he=n(),P=l("p"),P.innerHTML=Te,_e=n(),U=l("p"),U.innerHTML=ke,ve=n(),H=l("div"),u(K.$$.fragment),$e=n(),W=l("div"),u(E.$$.fragment),be=n(),M=l("div"),u(C.$$.fragment),we=n(),Z=l("p"),Z.textContent=Ke,Me=n(),q=l("div"),u(N.$$.fragment),re=n(),u(j.$$.fragment),se=n(),v=l("div"),u(O.$$.fragment),Le=n(),R=l("p"),R.textContent=Ee,ie=n(),u(S.$$.fragment),le=n(),$=l("div"),u(G.$$.fragment),xe=n(),z=l("p"),z.textContent=Ce,de=n(),u(V.$$.fragment),me=n(),J=l("p"),this.h()},l(e){const o=Pe("svelte-u9bgzb",document.head);_=d(o,"META",{name:!0,content:!0}),o.forEach(t),Y=a(e),F=d(e,"P",{}),b(F).forEach(t),X=a(e),p(L.$$.fragment,e),Q=a(e),p(x.$$.fragment,e),ee=a(e),y=d(e,"P",{"data-svelte-h":!0}),B(y)!=="svelte-9t4ux3"&&(y.innerHTML=Ae),te=a(e),A=d(e,"P",{"data-svelte-h":!0}),B(A)!=="svelte-1vuni30"&&(A.textContent=De),oe=a(e),p(D.$$.fragment,e),ne=a(e),p(T.$$.fragment,e),ae=a(e),s=d(e,"DIV",{class:!0});var m=b(s);p(k.$$.fragment,m),he=a(m),P=d(m,"P",{"data-svelte-h":!0}),B(P)!=="svelte-17d0uff"&&(P.innerHTML=Te),_e=a(m),U=d(m,"P",{"data-svelte-h":!0}),B(U)!=="svelte-13hb1zu"&&(U.innerHTML=ke),ve=a(m),H=d(m,"DIV",{class:!0});var Ne=b(H);p(K.$$.fragment,Ne),Ne.forEach(t),$e=a(m),W=d(m,"DIV",{class:!0});var je=b(W);p(E.$$.fragment,je),je.forEach(t),be=a(m),M=d(m,"DIV",{class:!0});var pe=b(M);p(C.$$.fragment,pe),we=a(pe),Z=d(pe,"P",{"data-svelte-h":!0}),B(Z)!=="svelte-1xwrf7t"&&(Z.textContent=Ke),pe.forEach(t),Me=a(m),q=d(m,"DIV",{class:!0});var Oe=b(q);p(N.$$.fragment,Oe),Oe.forEach(t),m.forEach(t),re=a(e),p(j.$$.fragment,e),se=a(e),v=d(e,"DIV",{class:!0});var ce=b(v);p(O.$$.fragment,ce),Le=a(ce),R=d(ce,"P",{"data-svelte-h":!0}),B(R)!=="svelte-1vsc7ag"&&(R.textContent=Ee),ce.forEach(t),ie=a(e),p(S.$$.fragment,e),le=a(e),$=d(e,"DIV",{class:!0});var fe=b($);p(G.$$.fragment,fe),xe=a(fe),z=d(fe,"P",{"data-svelte-h":!0}),B(z)!=="svelte-18u8upa"&&(z.textContent=Ce),fe.forEach(t),de=a(e),p(V.$$.fragment,e),me=a(e),J=d(e,"P",{}),b(J).forEach(t),this.h()},h(){w(_,"name","hf:doc:metadata"),w(_,"content",qe),w(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(s,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w($,"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){i(document.head,_),r(e,Y,o),r(e,F,o),r(e,X,o),c(L,e,o),r(e,Q,o),c(x,e,o),r(e,ee,o),r(e,y,o),r(e,te,o),r(e,A,o),r(e,oe,o),c(D,e,o),r(e,ne,o),c(T,e,o),r(e,ae,o),r(e,s,o),c(k,s,null),i(s,he),i(s,P),i(s,_e),i(s,U),i(s,ve),i(s,H),c(K,H,null),i(s,$e),i(s,W),c(E,W,null),i(s,be),i(s,M),c(C,M,null),i(M,we),i(M,Z),i(s,Me),i(s,q),c(N,q,null),r(e,re,o),c(j,e,o),r(e,se,o),r(e,v,o),c(O,v,null),i(v,Le),i(v,R),r(e,ie,o),c(S,e,o),r(e,le,o),r(e,$,o),c(G,$,null),i($,xe),i($,z),r(e,de,o),c(V,e,o),r(e,me,o),r(e,J,o),ue=!0},p:Ge,i(e){ue||(f(L.$$.fragment,e),f(x.$$.fragment,e),f(D.$$.fragment,e),f(T.$$.fragment,e),f(k.$$.fragment,e),f(K.$$.fragment,e),f(E.$$.fragment,e),f(C.$$.fragment,e),f(N.$$.fragment,e),f(j.$$.fragment,e),f(O.$$.fragment,e),f(S.$$.fragment,e),f(G.$$.fragment,e),f(V.$$.fragment,e),ue=!0)},o(e){g(L.$$.fragment,e),g(x.$$.fragment,e),g(D.$$.fragment,e),g(T.$$.fragment,e),g(k.$$.fragment,e),g(K.$$.fragment,e),g(E.$$.fragment,e),g(C.$$.fragment,e),g(N.$$.fragment,e),g(j.$$.fragment,e),g(O.$$.fragment,e),g(S.$$.fragment,e),g(G.$$.fragment,e),g(V.$$.fragment,e),ue=!1},d(e){e&&(t(Y),t(F),t(X),t(Q),t(ee),t(y),t(te),t(A),t(oe),t(ne),t(ae),t(s),t(re),t(se),t(v),t(ie),t(le),t($),t(de),t(me),t(J)),t(_),h(L,e),h(x,e),h(D,e),h(T,e),h(k),h(K),h(E),h(C),h(N),h(j,e),h(O),h(S,e),h(G),h(V,e)}}}const qe='{"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 Re(ye){return Ve(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class et extends Be{constructor(_){super(),Ie(this,_,Re,Ze,Se,{})}}export{et as component}; | |
Xet Storage Details
- Size:
- 14.2 kB
- Xet hash:
- 5079d223d00457138b242dd3dd3ee591da4f1a5b6028fc65832e4ee1196d49d9
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.