Buckets:
| import"../chunks/DsnmJJEf.js";import{i as D,h as J,C as Z,H as b,a as z,D as o,E as G,s as M}from"../chunks/BtE7mKSK.js";import{p as W,o as I,s as e,f as U,a as V,b as C,c as r,d as A,n,r as t}from"../chunks/jDjavuwI.js";const N='{"title":"AutoencoderKLKVAEVideo","local":"autoencoderklkvaevideo","sections":[{"title":"AutoencoderKLKVAEVideo","local":"diffusers.AutoencoderKLKVAEVideo","sections":[],"depth":2}],"depth":1}';var O=A('<meta name="hf:doc:metadata"/>'),F=A(`<p></p> <!> <!> <p>The 3D variational autoencoder (VAE) model with KL loss.</p> <p>The model can be loaded with the following code snippet.</p> <!> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>A VAE model with KL loss for encoding videos into latents and decoding latent representations into videos. Used in <a href="https://github.com/kandinskylab/kvae-1" rel="nofollow">KVAE</a>.</p> <p>This model inherits from <a href="/docs/diffusers/pr_14192/en/api/models/overview#diffusers.ModelMixin">ModelMixin</a>. Check the superclass documentation for its generic methods implemented for | |
| all models (such as downloading or saving).</p> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Decode a batch of videos.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Disable sliced VAE decoding.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Enable sliced VAE decoding.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Encode a batch of videos into latents.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!></div></div> <!> <p></p>`,1);function S(K,x){W(x,!1),I(()=>{new URLSearchParams(window.location.search).get("fw")}),D();var l=F();J("g1xsu6",_=>{var v=O();M(v,"content",N),V(_,v)});var u=e(U(l),2);Z(u,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var p=e(u,2);b(p,{title:"AutoencoderKLKVAEVideo",local:"autoencoderklkvaevideo",headingTag:"h1"});var m=e(p,6);z(m,{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQXV0b2VuY29kZXJLTEtWQUVWaWRlbyUwQSUwQXZhZSUyMCUzRCUyMEF1dG9lbmNvZGVyS0xLVkFFVmlkZW8uZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreWxhYiUyRktWQUUtM0QtMS4wJTIyJTJDJTIwc3ViZm9sZGVyJTNEJTIyZGlmZnVzZXJzJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KQ==",highlighted:`<span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKLKVAEVideo | |
| vae = AutoencoderKLKVAEVideo.from_pretrained(<span class="hljs-string">"kandinskylab/KVAE-3D-1.0"</span>, subfolder=<span class="hljs-string">"diffusers"</span>, torch_dtype=torch.float16)`,lang:"python",wrap:!1});var f=e(m,2);b(f,{title:"AutoencoderKLKVAEVideo",local:"diffusers.AutoencoderKLKVAEVideo",headingTag:"h2"});var d=e(f,2),h=r(d);o(h,{name:"class diffusers.AutoencoderKLKVAEVideo",anchor:"diffusers.AutoencoderKLKVAEVideo",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/models/autoencoders/autoencoder_kl_kvae_video.py#L707",parameters:[{name:"ch",val:": int = 128"},{name:"ch_mult",val:": typing.Tuple[int, ...] = (1, 2, 4, 8)"},{name:"num_res_blocks",val:": int = 2"},{name:"in_channels",val:": int = 3"},{name:"out_ch",val:": int = 3"},{name:"z_channels",val:": int = 16"},{name:"temporal_compress_times",val:": int = 4"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLKVAEVideo.ch",description:"<strong>ch</strong> (<code>int</code>, <em>optional</em>, defaults to 128) — Base channel count.",name:"ch"},{anchor:"diffusers.AutoencoderKLKVAEVideo.ch_mult",description:"<strong>ch_mult</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(1, 2, 4, 8)</code>) — Channel multipliers per level.",name:"ch_mult"},{anchor:"diffusers.AutoencoderKLKVAEVideo.num_res_blocks",description:"<strong>num_res_blocks</strong> (<code>int</code>, <em>optional</em>, defaults to 2) — Number of residual blocks per level.",name:"num_res_blocks"},{anchor:"diffusers.AutoencoderKLKVAEVideo.in_channels",description:"<strong>in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) — Number of input channels.",name:"in_channels"},{anchor:"diffusers.AutoencoderKLKVAEVideo.out_ch",description:"<strong>out_ch</strong> (<code>int</code>, <em>optional</em>, defaults to 3) — Number of output channels.",name:"out_ch"},{anchor:"diffusers.AutoencoderKLKVAEVideo.z_channels",description:"<strong>z_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 16) — Number of latent channels.",name:"z_channels"},{anchor:"diffusers.AutoencoderKLKVAEVideo.temporal_compress_times",description:"<strong>temporal_compress_times</strong> (<code>int</code>, <em>optional</em>, defaults to 4) — Temporal compression factor.",name:"temporal_compress_times"}]});var s=e(h,6),E=r(s);o(E,{name:"decode",anchor:"diffusers.AutoencoderKLKVAEVideo.decode",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/models/autoencoders/autoencoder_kl_kvae_video.py#L915",parameters:[{name:"z",val:": Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLKVAEVideo.decode.z",description:"<strong>z</strong> (<code>torch.Tensor</code>) — Input batch of latent vectors with shape (B, C, T, H, W).",name:"z"},{anchor:"diffusers.AutoencoderKLKVAEVideo.decode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to return a <code>~models.vae.DecoderOutput</code> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>Decoded video.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>~models.vae.DecoderOutput</code> or <code>tuple</code></p> | |
| `}),n(2),t(s);var a=e(s,2),L=r(a);o(L,{name:"disable_slicing",anchor:"diffusers.AutoencoderKLKVAEVideo.disable_slicing",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/models/autoencoders/autoencoder_kl_kvae_video.py#L844",parameters:[]}),n(2),t(a);var i=e(a,2),k=r(i);o(k,{name:"enable_slicing",anchor:"diffusers.AutoencoderKLKVAEVideo.enable_slicing",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/models/autoencoders/autoencoder_kl_kvae_video.py#L840",parameters:[]}),n(2),t(i);var c=e(i,2),T=r(c);o(T,{name:"encode",anchor:"diffusers.AutoencoderKLKVAEVideo.encode",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/models/autoencoders/autoencoder_kl_kvae_video.py#L867",parameters:[{name:"x",val:": Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLKVAEVideo.encode.x",description:"<strong>x</strong> (<code>torch.Tensor</code>) — Input batch of videos with shape (B, C, T, H, W).",name:"x"},{anchor:"diffusers.AutoencoderKLKVAEVideo.encode.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to return a <code>~models.autoencoder_kl.AutoencoderKLOutput</code> instead of a plain tuple.`,name:"return_dict"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The latent representations of the encoded videos.</p> | |
| `}),n(2),t(c);var g=e(c,2),y=r(g);o(y,{name:"forward",anchor:"diffusers.AutoencoderKLKVAEVideo.forward",source:"https://github.com/huggingface/diffusers/blob/vr_14192/src/diffusers/models/autoencoders/autoencoder_kl_kvae_video.py#L938",parameters:[{name:"sample",val:": Tensor"},{name:"sample_posterior",val:": bool = False"},{name:"return_dict",val:": bool = True"},{name:"generator",val:": typing.Optional[torch.Generator] = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLKVAEVideo.forward.sample",description:"<strong>sample</strong> (<code>torch.Tensor</code>) — Input sample.",name:"sample"},{anchor:"diffusers.AutoencoderKLKVAEVideo.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.AutoencoderKLKVAEVideo.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.AutoencoderKLKVAEVideo.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"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>If <code>return_dict</code> 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> | |
| `}),t(g),t(d);var w=e(d,2);G(w,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoder_kl_kvae_video.md"}),n(2),V(K,l),C()}export{S as component}; | |
Xet Storage Details
- Size:
- 9.81 kB
- Xet hash:
- 7781d58097c9fcde751026bede7cbc6117a15e71b40cba84a7dff48c19736474
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.