Buckets:
| import{s as et,n as tt,o as nt}from"../chunks/scheduler.53228c21.js";import{S as ot,i as st,e as a,s as o,c as m,h as rt,a as l,d as n,b as s,f as _,g as u,j as b,k as v,l as t,m as c,n as p,t as f,o as h,p as g}from"../chunks/index.100fac89.js";import{C as it}from"../chunks/CopyLLMTxtMenu.c36f1912.js";import{D as w}from"../chunks/Docstring.00e63d45.js";import{C as at}from"../chunks/CodeBlock.d30a6509.js";import{H as He,E as lt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c6997d0b.js";function dt(je){let $,se,ne,re,D,ie,C,ae,K,Se='The 3D variational autoencoder (VAE) model with KL loss used in <a href="https://github.com/genmoai/models" rel="nofollow">Mochi</a> was introduced in <a href="https://huggingface.co/genmo/mochi-1-preview" rel="nofollow">Mochi 1 Preview</a> by Tsinghua University & ZhipuAI.',le,E,Ue="The model can be loaded with the following code snippet.",de,I,ce,V,me,i,Z,ye,W,qe=`A VAE model with KL loss for encoding images into latents and decoding latent representations into images. Used in | |
| <a href="https://github.com/genmoai/models" rel="nofollow">Mochi 1 preview</a>.`,Te,R,Ge=`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).`,Le,F,z,Ae,M,P,ke,X,We=`Disable sliced VAE decoding. If <code>enable_slicing</code> was previously enabled, this method will go back to computing | |
| decoding in one step.`,De,y,O,Ce,B,Re=`Disable tiled VAE decoding. If <code>enable_tiling</code> was previously enabled, this method will go back to computing | |
| decoding in one step.`,Ke,T,N,Ee,J,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.`,Ie,L,H,Ve,Q,Xe=`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.`,Ze,A,j,ze,Y,Be="Decode a batch of images using a tiled decoder.",Pe,k,S,Oe,ee,Je="Encode a batch of images using a tiled encoder.",ue,U,pe,x,q,Ne,te,Qe="Output of decoding method.",fe,G,he,oe,ge;return D=new it({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),C=new He({props:{title:"AutoencoderKLMochi",local:"autoencoderklmochi",headingTag:"h1"}}),I=new at({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0xNb2NoaSUwQSUwQXZhZSUyMCUzRCUyMEF1dG9lbmNvZGVyS0xNb2NoaS5mcm9tX3ByZXRyYWluZWQoJTIyZ2VubW8lMkZtb2NoaS0xLXByZXZpZXclMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ2YWUlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MzIpLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKLMochi | |
| vae = AutoencoderKLMochi.from_pretrained(<span class="hljs-string">"genmo/mochi-1-preview"</span>, subfolder=<span class="hljs-string">"vae"</span>, torch_dtype=torch.float32).to(<span class="hljs-string">"cuda"</span>)`,wrap:!1}}),V=new He({props:{title:"AutoencoderKLMochi",local:"diffusers.AutoencoderKLMochi",headingTag:"h2"}}),Z=new w({props:{name:"class diffusers.AutoencoderKLMochi",anchor:"diffusers.AutoencoderKLMochi",parameters:[{name:"in_channels",val:": int = 15"},{name:"out_channels",val:": int = 3"},{name:"encoder_block_out_channels",val:": typing.Tuple[int] = (64, 128, 256, 384)"},{name:"decoder_block_out_channels",val:": typing.Tuple[int] = (128, 256, 512, 768)"},{name:"latent_channels",val:": int = 12"},{name:"layers_per_block",val:": typing.Tuple[int, ...] = (3, 3, 4, 6, 3)"},{name:"act_fn",val:": str = 'silu'"},{name:"temporal_expansions",val:": typing.Tuple[int, ...] = (1, 2, 3)"},{name:"spatial_expansions",val:": typing.Tuple[int, ...] = (2, 2, 2)"},{name:"add_attention_block",val:": typing.Tuple[bool, ...] = (False, True, True, True, True)"},{name:"latents_mean",val:": typing.Tuple[float, ...] = (-0.06730895953510081, -0.038011381506090416, -0.07477820912866141, -0.05565264470995561, 0.012767231469026969, -0.04703542746246419, 0.043896967884726704, -0.09346305707025976, -0.09918314763016893, -0.008729793427399178, -0.011931556316503654, -0.0321993391887285)"},{name:"latents_std",val:": typing.Tuple[float, ...] = (0.9263795028493863, 0.9248894543193766, 0.9393059390890617, 0.959253732819592, 0.8244560132752793, 0.917259975397747, 0.9294154431013696, 1.3720942357788521, 0.881393668867029, 0.9168315692124348, 0.9185249279345552, 0.9274757570805041)"},{name:"scaling_factor",val:": float = 1.0"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLMochi.in_channels",description:"<strong>in_channels</strong> (int, <em>optional</em>, defaults to 3) — Number of channels in the input image.",name:"in_channels"},{anchor:"diffusers.AutoencoderKLMochi.out_channels",description:"<strong>out_channels</strong> (int, <em>optional</em>, defaults to 3) — Number of channels in the output.",name:"out_channels"},{anchor:"diffusers.AutoencoderKLMochi.block_out_channels",description:`<strong>block_out_channels</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(64,)</code>) — | |
| Tuple of block output channels.`,name:"block_out_channels"},{anchor:"diffusers.AutoencoderKLMochi.act_fn",description:"<strong>act_fn</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"silu"</code>) — The activation function to use.",name:"act_fn"},{anchor:"diffusers.AutoencoderKLMochi.scaling_factor",description:`<strong>scaling_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1.15258426</code>) — | |
| The component-wise standard deviation of the trained latent space computed using the first batch of the | |
| training set. This is used to scale the latent space to have unit variance when training the diffusion | |
| model. The latents are scaled with the formula <code>z = z * scaling_factor</code> before being passed to the | |
| diffusion model. When decoding, the latents are scaled back to the original scale with the formula: <code>z = 1 / scaling_factor * z</code>. For more details, refer to sections 4.3.2 and D.1 of the <a href="https://huggingface.co/papers/2112.10752" rel="nofollow">High-Resolution Image | |
| Synthesis with Latent Diffusion Models</a> paper.`,name:"scaling_factor"}],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/models/autoencoders/autoencoder_kl_mochi.py#L660"}}),z=new w({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLMochi.decode",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 w({props:{name:"disable_slicing",anchor:"diffusers.AutoencoderKLMochi.disable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/models/autoencoders/autoencoder_kl_mochi.py#L835"}}),O=new w({props:{name:"disable_tiling",anchor:"diffusers.AutoencoderKLMochi.disable_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/models/autoencoders/autoencoder_kl_mochi.py#L821"}}),N=new w({props:{name:"enable_slicing",anchor:"diffusers.AutoencoderKLMochi.enable_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/models/autoencoders/autoencoder_kl_mochi.py#L828"}}),H=new w({props:{name:"enable_tiling",anchor:"diffusers.AutoencoderKLMochi.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_stride_height",val:": typing.Optional[float] = None"},{name:"tile_sample_stride_width",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLMochi.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.AutoencoderKLMochi.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.AutoencoderKLMochi.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.AutoencoderKLMochi.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_mochi.py#L791"}}),j=new w({props:{name:"tiled_decode",anchor:"diffusers.AutoencoderKLMochi.tiled_decode",parameters:[{name:"z",val:": Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLMochi.tiled_decode.z",description:"<strong>z</strong> (<code>torch.Tensor</code>) — Input batch of latent vectors.",name:"z"},{anchor:"diffusers.AutoencoderKLMochi.tiled_decode.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>~models.vae.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_mochi.py#L1037",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> | |
| `}}),S=new w({props:{name:"tiled_encode",anchor:"diffusers.AutoencoderKLMochi.tiled_encode",parameters:[{name:"x",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLMochi.tiled_encode.x",description:"<strong>x</strong> (<code>torch.Tensor</code>) — Input batch of videos.",name:"x"}],source:"https://github.com/huggingface/diffusers/blob/vr_12509/src/diffusers/models/autoencoders/autoencoder_kl_mochi.py#L980",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> | |
| `}}),U=new He({props:{title:"DecoderOutput",local:"diffusers.models.autoencoders.vae.DecoderOutput",headingTag:"h2"}}),q=new w({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"}}),G=new lt({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoderkl_mochi.md"}}),{c(){$=a("meta"),se=o(),ne=a("p"),re=o(),m(D.$$.fragment),ie=o(),m(C.$$.fragment),ae=o(),K=a("p"),K.innerHTML=Se,le=o(),E=a("p"),E.textContent=Ue,de=o(),m(I.$$.fragment),ce=o(),m(V.$$.fragment),me=o(),i=a("div"),m(Z.$$.fragment),ye=o(),W=a("p"),W.innerHTML=qe,Te=o(),R=a("p"),R.innerHTML=Ge,Le=o(),F=a("div"),m(z.$$.fragment),Ae=o(),M=a("div"),m(P.$$.fragment),ke=o(),X=a("p"),X.innerHTML=We,De=o(),y=a("div"),m(O.$$.fragment),Ce=o(),B=a("p"),B.innerHTML=Re,Ke=o(),T=a("div"),m(N.$$.fragment),Ee=o(),J=a("p"),J.textContent=Fe,Ie=o(),L=a("div"),m(H.$$.fragment),Ve=o(),Q=a("p"),Q.textContent=Xe,Ze=o(),A=a("div"),m(j.$$.fragment),ze=o(),Y=a("p"),Y.textContent=Be,Pe=o(),k=a("div"),m(S.$$.fragment),Oe=o(),ee=a("p"),ee.textContent=Je,ue=o(),m(U.$$.fragment),pe=o(),x=a("div"),m(q.$$.fragment),Ne=o(),te=a("p"),te.textContent=Qe,fe=o(),m(G.$$.fragment),he=o(),oe=a("p"),this.h()},l(e){const r=rt("svelte-u9bgzb",document.head);$=l(r,"META",{name:!0,content:!0}),r.forEach(n),se=s(e),ne=l(e,"P",{}),_(ne).forEach(n),re=s(e),u(D.$$.fragment,e),ie=s(e),u(C.$$.fragment,e),ae=s(e),K=l(e,"P",{"data-svelte-h":!0}),b(K)!=="svelte-1jrzq50"&&(K.innerHTML=Se),le=s(e),E=l(e,"P",{"data-svelte-h":!0}),b(E)!=="svelte-1vuni30"&&(E.textContent=Ue),de=s(e),u(I.$$.fragment,e),ce=s(e),u(V.$$.fragment,e),me=s(e),i=l(e,"DIV",{class:!0});var d=_(i);u(Z.$$.fragment,d),ye=s(d),W=l(d,"P",{"data-svelte-h":!0}),b(W)!=="svelte-osx1y"&&(W.innerHTML=qe),Te=s(d),R=l(d,"P",{"data-svelte-h":!0}),b(R)!=="svelte-18gkr4p"&&(R.innerHTML=Ge),Le=s(d),F=l(d,"DIV",{class:!0});var Ye=_(F);u(z.$$.fragment,Ye),Ye.forEach(n),Ae=s(d),M=l(d,"DIV",{class:!0});var _e=_(M);u(P.$$.fragment,_e),ke=s(_e),X=l(_e,"P",{"data-svelte-h":!0}),b(X)!=="svelte-189cc7b"&&(X.innerHTML=We),_e.forEach(n),De=s(d),y=l(d,"DIV",{class:!0});var be=_(y);u(O.$$.fragment,be),Ce=s(be),B=l(be,"P",{"data-svelte-h":!0}),b(B)!=="svelte-1f366pl"&&(B.innerHTML=Re),be.forEach(n),Ke=s(d),T=l(d,"DIV",{class:!0});var ve=_(T);u(N.$$.fragment,ve),Ee=s(ve),J=l(ve,"P",{"data-svelte-h":!0}),b(J)!=="svelte-14bnrb6"&&(J.textContent=Fe),ve.forEach(n),Ie=s(d),L=l(d,"DIV",{class:!0});var $e=_(L);u(H.$$.fragment,$e),Ve=s($e),Q=l($e,"P",{"data-svelte-h":!0}),b(Q)!=="svelte-1xwrf7t"&&(Q.textContent=Xe),$e.forEach(n),Ze=s(d),A=l(d,"DIV",{class:!0});var xe=_(A);u(j.$$.fragment,xe),ze=s(xe),Y=l(xe,"P",{"data-svelte-h":!0}),b(Y)!=="svelte-1vrxp2b"&&(Y.textContent=Be),xe.forEach(n),Pe=s(d),k=l(d,"DIV",{class:!0});var we=_(k);u(S.$$.fragment,we),Oe=s(we),ee=l(we,"P",{"data-svelte-h":!0}),b(ee)!=="svelte-1un5fcn"&&(ee.textContent=Je),we.forEach(n),d.forEach(n),ue=s(e),u(U.$$.fragment,e),pe=s(e),x=l(e,"DIV",{class:!0});var Me=_(x);u(q.$$.fragment,Me),Ne=s(Me),te=l(Me,"P",{"data-svelte-h":!0}),b(te)!=="svelte-18u8upa"&&(te.textContent=Qe),Me.forEach(n),fe=s(e),u(G.$$.fragment,e),he=s(e),oe=l(e,"P",{}),_(oe).forEach(n),this.h()},h(){v($,"name","hf:doc:metadata"),v($,"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(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"),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(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(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(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(i,"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")},m(e,r){t(document.head,$),c(e,se,r),c(e,ne,r),c(e,re,r),p(D,e,r),c(e,ie,r),p(C,e,r),c(e,ae,r),c(e,K,r),c(e,le,r),c(e,E,r),c(e,de,r),p(I,e,r),c(e,ce,r),p(V,e,r),c(e,me,r),c(e,i,r),p(Z,i,null),t(i,ye),t(i,W),t(i,Te),t(i,R),t(i,Le),t(i,F),p(z,F,null),t(i,Ae),t(i,M),p(P,M,null),t(M,ke),t(M,X),t(i,De),t(i,y),p(O,y,null),t(y,Ce),t(y,B),t(i,Ke),t(i,T),p(N,T,null),t(T,Ee),t(T,J),t(i,Ie),t(i,L),p(H,L,null),t(L,Ve),t(L,Q),t(i,Ze),t(i,A),p(j,A,null),t(A,ze),t(A,Y),t(i,Pe),t(i,k),p(S,k,null),t(k,Oe),t(k,ee),c(e,ue,r),p(U,e,r),c(e,pe,r),c(e,x,r),p(q,x,null),t(x,Ne),t(x,te),c(e,fe,r),p(G,e,r),c(e,he,r),c(e,oe,r),ge=!0},p:tt,i(e){ge||(f(D.$$.fragment,e),f(C.$$.fragment,e),f(I.$$.fragment,e),f(V.$$.fragment,e),f(Z.$$.fragment,e),f(z.$$.fragment,e),f(P.$$.fragment,e),f(O.$$.fragment,e),f(N.$$.fragment,e),f(H.$$.fragment,e),f(j.$$.fragment,e),f(S.$$.fragment,e),f(U.$$.fragment,e),f(q.$$.fragment,e),f(G.$$.fragment,e),ge=!0)},o(e){h(D.$$.fragment,e),h(C.$$.fragment,e),h(I.$$.fragment,e),h(V.$$.fragment,e),h(Z.$$.fragment,e),h(z.$$.fragment,e),h(P.$$.fragment,e),h(O.$$.fragment,e),h(N.$$.fragment,e),h(H.$$.fragment,e),h(j.$$.fragment,e),h(S.$$.fragment,e),h(U.$$.fragment,e),h(q.$$.fragment,e),h(G.$$.fragment,e),ge=!1},d(e){e&&(n(se),n(ne),n(re),n(ie),n(ae),n(K),n(le),n(E),n(de),n(ce),n(me),n(i),n(ue),n(pe),n(x),n(fe),n(he),n(oe)),n($),g(D,e),g(C,e),g(I,e),g(V,e),g(Z),g(z),g(P),g(O),g(N),g(H),g(j),g(S),g(U,e),g(q),g(G,e)}}}const ct='{"title":"AutoencoderKLMochi","local":"autoencoderklmochi","sections":[{"title":"AutoencoderKLMochi","local":"diffusers.AutoencoderKLMochi","sections":[],"depth":2},{"title":"DecoderOutput","local":"diffusers.models.autoencoders.vae.DecoderOutput","sections":[],"depth":2}],"depth":1}';function mt(je){return nt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class bt extends ot{constructor($){super(),st(this,$,mt,dt,et,{})}}export{bt as component}; | |
Xet Storage Details
- Size:
- 18 kB
- Xet hash:
- 10fe3ba31faeb31a34a7e26c18c55400f9c970eabe7d8ccf900db00ff13eac12
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.