Buckets:
| import"../chunks/DsnmJJEf.js";import{i as W,h as E,C as R,H as s,a as Z,D as o,E as I,s as S}from"../chunks/CmJXCtRL.js";import{p as C,o as q,s as e,f as j,a as V,b as B,c as t,d as A,n as r,r as n}from"../chunks/DK803DsY.js";const Q='{"title":"AutoencoderKLLTXVideo","local":"autoencoderklltxvideo","sections":[{"title":"AutoencoderKLLTXVideo","local":"diffusers.AutoencoderKLLTXVideo","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}';var Y=A('<meta name="hf:doc:metadata"/>'),H=A(`<p></p> <!> <!> <p>The 3D variational autoencoder (VAE) model with KL loss used in <a href="https://huggingface.co/Lightricks/LTX-Video" rel="nofollow">LTX</a> was introduced by Lightricks.</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 images into latents and decoding latent representations into images. Used in <a href="https://huggingface.co/Lightricks/LTX-Video" rel="nofollow">LTX</a>.</p> <p>This model inherits from <a href="/docs/diffusers/pr_14407/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).</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 images.</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 images 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"><!> <p>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.</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 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 images using a tiled decoder.</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 images using a tiled encoder.</p></div></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>Output of AutoencoderKL encoding method.</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>Output of decoding method.</p></div> <!> <p></p>`,1);function ee(X,K){C(K,!1),q(()=>{new URLSearchParams(window.location.search).get("fw")}),W();var h=H();E("1ujvgt6",y=>{var w=Y();S(w,"content",Q),V(y,w)});var f=e(j(h),2);R(f,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var _=e(f,2);s(_,{title:"AutoencoderKLLTXVideo",local:"autoencoderklltxvideo",headingTag:"h1"});var g=e(_,6);Z(g,{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0xMVFhWaWRlbyUwQSUwQXZhZSUyMCUzRCUyMEF1dG9lbmNvZGVyS0xMVFhWaWRlby5mcm9tX3ByZXRyYWluZWQoJTIyTGlnaHRyaWNrcyUyRkxUWC1WaWRlbyUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnZhZSUyMiUyQyUyMGR0eXBlJTNEdG9yY2guZmxvYXQzMikudG8oJTIyY3VkYSUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKLLTXVideo | |
| vae = AutoencoderKLLTXVideo.from_pretrained(<span class="hljs-string">"Lightricks/LTX-Video"</span>, subfolder=<span class="hljs-string">"vae"</span>, dtype=torch.float32).to(<span class="hljs-string">"cuda"</span>)`,lang:"python",wrap:!1});var v=e(g,2);s(v,{title:"AutoencoderKLLTXVideo",local:"diffusers.AutoencoderKLLTXVideo",headingTag:"h2"});var a=e(v,2),b=t(a);o(b,{name:"class diffusers.AutoencoderKLLTXVideo",anchor:"diffusers.AutoencoderKLLTXVideo",source:"https://github.com/huggingface/diffusers/blob/vr_14407/src/diffusers/models/autoencoders/autoencoder_kl_ltx.py#L1035",parameters:[{name:"in_channels",val:": int = 3"},{name:"out_channels",val:": int = 3"},{name:"latent_channels",val:": int = 128"},{name:"block_out_channels",val:": tuple = (128, 256, 512, 512)"},{name:"down_block_types",val:": tuple = ('LTXVideoDownBlock3D', 'LTXVideoDownBlock3D', 'LTXVideoDownBlock3D', 'LTXVideoDownBlock3D')"},{name:"decoder_block_out_channels",val:": tuple = (128, 256, 512, 512)"},{name:"layers_per_block",val:": tuple = (4, 3, 3, 3, 4)"},{name:"decoder_layers_per_block",val:": tuple = (4, 3, 3, 3, 4)"},{name:"spatio_temporal_scaling",val:": tuple = (True, True, True, False)"},{name:"decoder_spatio_temporal_scaling",val:": tuple = (True, True, True, False)"},{name:"decoder_inject_noise",val:": tuple = (False, False, False, False, False)"},{name:"downsample_type",val:": tuple = ('conv', 'conv', 'conv', 'conv')"},{name:"upsample_residual",val:": tuple = (False, False, False, False)"},{name:"upsample_factor",val:": tuple = (1, 1, 1, 1)"},{name:"timestep_conditioning",val:": bool = False"},{name:"patch_size",val:": int = 4"},{name:"patch_size_t",val:": int = 1"},{name:"resnet_norm_eps",val:": float = 1e-06"},{name:"scaling_factor",val:": float = 1.0"},{name:"encoder_causal",val:": bool = True"},{name:"decoder_causal",val:": bool = False"},{name:"spatial_compression_ratio",val:": int = None"},{name:"temporal_compression_ratio",val:": int = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLLTXVideo.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, defaults to <code>3</code>) — | |
| Number of input channels.`,name:"in_channels"},{anchor:"diffusers.AutoencoderKLLTXVideo.out_channels",description:`<strong>out_channels</strong> (<code>int</code>, defaults to <code>3</code>) — | |
| Number of output channels.`,name:"out_channels"},{anchor:"diffusers.AutoencoderKLLTXVideo.latent_channels",description:`<strong>latent_channels</strong> (<code>int</code>, defaults to <code>128</code>) — | |
| Number of latent channels.`,name:"latent_channels"},{anchor:"diffusers.AutoencoderKLLTXVideo.block_out_channels",description:`<strong>block_out_channels</strong> (<code>tuple[int, ...]</code>, defaults to <code>(128, 256, 512, 512)</code>) — | |
| The number of output channels for each block.`,name:"block_out_channels"},{anchor:"diffusers.AutoencoderKLLTXVideo.spatio_temporal_scaling",description:"<strong>spatio_temporal_scaling</strong> (<code>tuple[bool, ...], defaults to </code>(True, True, True, False)` —\nWhether a block should contain spatio-temporal downscaling or not.",name:"spatio_temporal_scaling"},{anchor:"diffusers.AutoencoderKLLTXVideo.layers_per_block",description:`<strong>layers_per_block</strong> (<code>tuple[int, ...]</code>, defaults to <code>(4, 3, 3, 3, 4)</code>) — | |
| The number of layers per block.`,name:"layers_per_block"},{anchor:"diffusers.AutoencoderKLLTXVideo.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, defaults to <code>4</code>) — | |
| The size of spatial patches.`,name:"patch_size"},{anchor:"diffusers.AutoencoderKLLTXVideo.patch_size_t",description:`<strong>patch_size_t</strong> (<code>int</code>, defaults to <code>1</code>) — | |
| The size of temporal patches.`,name:"patch_size_t"},{anchor:"diffusers.AutoencoderKLLTXVideo.resnet_norm_eps",description:`<strong>resnet_norm_eps</strong> (<code>float</code>, defaults to <code>1e-6</code>) — | |
| Epsilon value for ResNet normalization layers.`,name:"resnet_norm_eps"},{anchor:"diffusers.AutoencoderKLLTXVideo.scaling_factor",description:`<strong>scaling_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1.0</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"},{anchor:"diffusers.AutoencoderKLLTXVideo.encoder_causal",description:`<strong>encoder_causal</strong> (<code>bool</code>, defaults to <code>True</code>) — | |
| Whether the encoder should behave causally (future frames depend only on past frames) or not.`,name:"encoder_causal"},{anchor:"diffusers.AutoencoderKLLTXVideo.decoder_causal",description:`<strong>decoder_causal</strong> (<code>bool</code>, defaults to <code>False</code>) — | |
| Whether the decoder should behave causally (future frames depend only on past frames) or not.`,name:"decoder_causal"}]});var d=e(b,6),D=t(d);o(D,{name:"decode",anchor:"diffusers.AutoencoderKLLTXVideo.decode",source:"https://github.com/huggingface/diffusers/blob/vr_14407/src/diffusers/models/autoencoders/autoencoder_kl_ltx.py#L1281",parameters:[{name:"z",val:": Tensor"},{name:"temb",val:": typing.Optional[torch.Tensor] = None"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLLTXVideo.decode.z",description:"<strong>z</strong> (<code>torch.Tensor</code>) — Input batch of latent vectors.",name:"z"},{anchor:"diffusers.AutoencoderKLLTXVideo.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>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> | |
| `}),r(2),n(d);var i=e(d,2),k=t(i);o(k,{name:"encode",anchor:"diffusers.AutoencoderKLLTXVideo.encode",source:"https://github.com/huggingface/diffusers/blob/vr_14407/src/diffusers/models/autoencoders/autoencoder_kl_ltx.py#L1233",parameters:[{name:"x",val:": Tensor"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLLTXVideo.encode.x",description:"<strong>x</strong> (<code>torch.Tensor</code>) — Input batch of images.",name:"x"},{anchor:"diffusers.AutoencoderKLLTXVideo.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. If <code>return_dict</code> is True, a | |
| <code>~models.autoencoder_kl.AutoencoderKLOutput</code> is returned, otherwise a plain <code>tuple</code> is returned.</p> | |
| `}),r(2),n(i);var c=e(i,2),O=t(c);o(O,{name:"enable_tiling",anchor:"diffusers.AutoencoderKLLTXVideo.enable_tiling",source:"https://github.com/huggingface/diffusers/blob/vr_14407/src/diffusers/models/autoencoders/autoencoder_kl_ltx.py#L1186",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.AutoencoderKLLTXVideo.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.AutoencoderKLLTXVideo.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.AutoencoderKLLTXVideo.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.AutoencoderKLLTXVideo.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"}]}),r(2),n(c);var l=e(c,2),z=t(l);o(z,{name:"forward",anchor:"diffusers.AutoencoderKLLTXVideo.forward",source:"https://github.com/huggingface/diffusers/blob/vr_14407/src/diffusers/models/autoencoders/autoencoder_kl_ltx.py#L1517",parameters:[{name:"sample",val:": Tensor"},{name:"temb",val:": typing.Optional[torch.Tensor] = None"},{name:"sample_posterior",val:": bool = False"},{name:"return_dict",val:": bool = True"},{name:"generator",val:": typing.Optional[torch.Generator] = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLLTXVideo.forward.sample",description:"<strong>sample</strong> (<code>torch.Tensor</code>) — Input sample.",name:"sample"},{anchor:"diffusers.AutoencoderKLLTXVideo.forward.temb",description:`<strong>temb</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Optional timestep embedding tensor used to condition the decoder.`,name:"temb"},{anchor:"diffusers.AutoencoderKLLTXVideo.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.AutoencoderKLLTXVideo.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.AutoencoderKLLTXVideo.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> | |
| `}),n(l);var u=e(l,2),N=t(u);o(N,{name:"tiled_decode",anchor:"diffusers.AutoencoderKLLTXVideo.tiled_decode",source:"https://github.com/huggingface/diffusers/blob/vr_14407/src/diffusers/models/autoencoders/autoencoder_kl_ltx.py#L1389",parameters:[{name:"z",val:": Tensor"},{name:"temb",val:": typing.Optional[torch.Tensor]"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLLTXVideo.tiled_decode.z",description:"<strong>z</strong> (<code>torch.Tensor</code>) — Input batch of latent vectors.",name:"z"},{anchor:"diffusers.AutoencoderKLLTXVideo.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"}],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> | |
| `}),r(2),n(u);var T=e(u,2),F=t(T);o(F,{name:"tiled_encode",anchor:"diffusers.AutoencoderKLLTXVideo.tiled_encode",source:"https://github.com/huggingface/diffusers/blob/vr_14407/src/diffusers/models/autoencoders/autoencoder_kl_ltx.py#L1338",parameters:[{name:"x",val:": Tensor"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLLTXVideo.tiled_encode.x",description:"<strong>x</strong> (<code>torch.Tensor</code>) — Input batch of videos.",name:"x"}],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> | |
| `}),r(2),n(T),n(a);var L=e(a,2);s(L,{title:"AutoencoderKLOutput",local:"diffusers.models.modeling_outputs.AutoencoderKLOutput",headingTag:"h2"});var p=e(L,2),M=t(p);o(M,{name:"class diffusers.models.modeling_outputs.AutoencoderKLOutput",anchor:"diffusers.models.modeling_outputs.AutoencoderKLOutput",source:"https://github.com/huggingface/diffusers/blob/vr_14407/src/diffusers/models/modeling_outputs.py#L7",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"}]}),r(2),n(p);var x=e(p,2);s(x,{title:"DecoderOutput",local:"diffusers.models.autoencoders.vae.DecoderOutput",headingTag:"h2"});var m=e(x,2),G=t(m);o(G,{name:"class diffusers.models.autoencoders.vae.DecoderOutput",anchor:"diffusers.models.autoencoders.vae.DecoderOutput",source:"https://github.com/huggingface/diffusers/blob/vr_14407/src/diffusers/models/autoencoders/vae.py#L46",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"}]}),r(2),n(m);var U=e(m,2);I(U,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoderkl_ltx_video.md"}),r(2),V(X,h),B()}export{ee as component}; | |
Xet Storage Details
- Size:
- 19.6 kB
- Xet hash:
- ea446016846c8db00211a225ba25a5679f851cb021cf20864c7ec85d695955e7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.