Buckets:
| import{s as Ze,n as ze,o as Ie}from"../chunks/scheduler.53228c21.js";import{S as Oe,i as Ne,e as l,s as o,c as m,h as Pe,a as d,d as t,b as s,f as w,g as u,j as M,k as y,l as i,m as a,n as p,t as f,o as h,p as g}from"../chunks/index.100fac89.js";import{C as je}from"../chunks/CopyLLMTxtMenu.733ee6d3.js";import{D as R}from"../chunks/Docstring.695f69dc.js";import{C as Se}from"../chunks/CodeBlock.d30a6509.js";import{H as we,E as Ue}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.0e2208d5.js";function Ve(Me){let _,X,W,B,T,J,L,Q,A,ye='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.',Y,k,Te="The model can be loaded with the following code snippet.",ee,D,te,K,ne,r,C,ue,j,Le=`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>.`,pe,S,Ae=`This model inherits from <a href="/docs/diffusers/pr_12849/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).`,fe,U,E,he,b,Z,ge,V,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.`,_e,$,z,ve,q,De="Decode a batch of images using a tiled decoder.",be,x,I,$e,H,Ke="Encode a batch of images using a tiled encoder.",oe,O,se,v,N,xe,G,Ce="Output of decoding method.",ie,P,re,F,ae;return T=new je({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),L=new we({props:{title:"AutoencoderKLMochi",local:"autoencoderklmochi",headingTag:"h1"}}),D=new Se({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}}),K=new we({props:{title:"AutoencoderKLMochi",local:"diffusers.AutoencoderKLMochi",headingTag:"h2"}}),C=new R({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_12849/src/diffusers/models/autoencoders/autoencoder_kl_mochi.py#L660"}}),E=new R({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLMochi.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_12849/src/diffusers/utils/accelerate_utils.py#L43"}}),Z=new R({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_12849/src/diffusers/models/autoencoders/autoencoder_kl_mochi.py#L791"}}),z=new R({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_12849/src/diffusers/models/autoencoders/autoencoder_kl_mochi.py#L1016",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> | |
| `}}),I=new R({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_12849/src/diffusers/models/autoencoders/autoencoder_kl_mochi.py#L959",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> | |
| `}}),O=new we({props:{title:"DecoderOutput",local:"diffusers.models.autoencoders.vae.DecoderOutput",headingTag:"h2"}}),N=new R({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_12849/src/diffusers/models/autoencoders/vae.py#L47"}}),P=new Ue({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoderkl_mochi.md"}}),{c(){_=l("meta"),X=o(),W=l("p"),B=o(),m(T.$$.fragment),J=o(),m(L.$$.fragment),Q=o(),A=l("p"),A.innerHTML=ye,Y=o(),k=l("p"),k.textContent=Te,ee=o(),m(D.$$.fragment),te=o(),m(K.$$.fragment),ne=o(),r=l("div"),m(C.$$.fragment),ue=o(),j=l("p"),j.innerHTML=Le,pe=o(),S=l("p"),S.innerHTML=Ae,fe=o(),U=l("div"),m(E.$$.fragment),he=o(),b=l("div"),m(Z.$$.fragment),ge=o(),V=l("p"),V.textContent=ke,_e=o(),$=l("div"),m(z.$$.fragment),ve=o(),q=l("p"),q.textContent=De,be=o(),x=l("div"),m(I.$$.fragment),$e=o(),H=l("p"),H.textContent=Ke,oe=o(),m(O.$$.fragment),se=o(),v=l("div"),m(N.$$.fragment),xe=o(),G=l("p"),G.textContent=Ce,ie=o(),m(P.$$.fragment),re=o(),F=l("p"),this.h()},l(e){const n=Pe("svelte-u9bgzb",document.head);_=d(n,"META",{name:!0,content:!0}),n.forEach(t),X=s(e),W=d(e,"P",{}),w(W).forEach(t),B=s(e),u(T.$$.fragment,e),J=s(e),u(L.$$.fragment,e),Q=s(e),A=d(e,"P",{"data-svelte-h":!0}),M(A)!=="svelte-1jrzq50"&&(A.innerHTML=ye),Y=s(e),k=d(e,"P",{"data-svelte-h":!0}),M(k)!=="svelte-1vuni30"&&(k.textContent=Te),ee=s(e),u(D.$$.fragment,e),te=s(e),u(K.$$.fragment,e),ne=s(e),r=d(e,"DIV",{class:!0});var c=w(r);u(C.$$.fragment,c),ue=s(c),j=d(c,"P",{"data-svelte-h":!0}),M(j)!=="svelte-osx1y"&&(j.innerHTML=Le),pe=s(c),S=d(c,"P",{"data-svelte-h":!0}),M(S)!=="svelte-u4ankc"&&(S.innerHTML=Ae),fe=s(c),U=d(c,"DIV",{class:!0});var Ee=w(U);u(E.$$.fragment,Ee),Ee.forEach(t),he=s(c),b=d(c,"DIV",{class:!0});var le=w(b);u(Z.$$.fragment,le),ge=s(le),V=d(le,"P",{"data-svelte-h":!0}),M(V)!=="svelte-1xwrf7t"&&(V.textContent=ke),le.forEach(t),_e=s(c),$=d(c,"DIV",{class:!0});var de=w($);u(z.$$.fragment,de),ve=s(de),q=d(de,"P",{"data-svelte-h":!0}),M(q)!=="svelte-1vrxp2b"&&(q.textContent=De),de.forEach(t),be=s(c),x=d(c,"DIV",{class:!0});var ce=w(x);u(I.$$.fragment,ce),$e=s(ce),H=d(ce,"P",{"data-svelte-h":!0}),M(H)!=="svelte-1un5fcn"&&(H.textContent=Ke),ce.forEach(t),c.forEach(t),oe=s(e),u(O.$$.fragment,e),se=s(e),v=d(e,"DIV",{class:!0});var me=w(v);u(N.$$.fragment,me),xe=s(me),G=d(me,"P",{"data-svelte-h":!0}),M(G)!=="svelte-18u8upa"&&(G.textContent=Ce),me.forEach(t),ie=s(e),u(P.$$.fragment,e),re=s(e),F=d(e,"P",{}),w(F).forEach(t),this.h()},h(){y(_,"name","hf:doc:metadata"),y(_,"content",qe),y(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(r,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(v,"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){i(document.head,_),a(e,X,n),a(e,W,n),a(e,B,n),p(T,e,n),a(e,J,n),p(L,e,n),a(e,Q,n),a(e,A,n),a(e,Y,n),a(e,k,n),a(e,ee,n),p(D,e,n),a(e,te,n),p(K,e,n),a(e,ne,n),a(e,r,n),p(C,r,null),i(r,ue),i(r,j),i(r,pe),i(r,S),i(r,fe),i(r,U),p(E,U,null),i(r,he),i(r,b),p(Z,b,null),i(b,ge),i(b,V),i(r,_e),i(r,$),p(z,$,null),i($,ve),i($,q),i(r,be),i(r,x),p(I,x,null),i(x,$e),i(x,H),a(e,oe,n),p(O,e,n),a(e,se,n),a(e,v,n),p(N,v,null),i(v,xe),i(v,G),a(e,ie,n),p(P,e,n),a(e,re,n),a(e,F,n),ae=!0},p:ze,i(e){ae||(f(T.$$.fragment,e),f(L.$$.fragment,e),f(D.$$.fragment,e),f(K.$$.fragment,e),f(C.$$.fragment,e),f(E.$$.fragment,e),f(Z.$$.fragment,e),f(z.$$.fragment,e),f(I.$$.fragment,e),f(O.$$.fragment,e),f(N.$$.fragment,e),f(P.$$.fragment,e),ae=!0)},o(e){h(T.$$.fragment,e),h(L.$$.fragment,e),h(D.$$.fragment,e),h(K.$$.fragment,e),h(C.$$.fragment,e),h(E.$$.fragment,e),h(Z.$$.fragment,e),h(z.$$.fragment,e),h(I.$$.fragment,e),h(O.$$.fragment,e),h(N.$$.fragment,e),h(P.$$.fragment,e),ae=!1},d(e){e&&(t(X),t(W),t(B),t(J),t(Q),t(A),t(Y),t(k),t(ee),t(te),t(ne),t(r),t(oe),t(se),t(v),t(ie),t(re),t(F)),t(_),g(T,e),g(L,e),g(D,e),g(K,e),g(C),g(E),g(Z),g(z),g(I),g(O,e),g(N),g(P,e)}}}const qe='{"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 He(Me){return Ie(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Je extends Oe{constructor(_){super(),Ne(this,_,He,Ve,Ze,{})}}export{Je as component}; | |
Xet Storage Details
- Size:
- 15.5 kB
- Xet hash:
- bb705fdf7f69b2f2fe5bc5f1386dc96019d8049ca8c3594629a6df28ebd05320
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.