Buckets:
| import{s as Xe,n as Ae,o as Me}from"../chunks/scheduler.53228c21.js";import{S as Ke,i as De,e as l,s as r,c as p,h as ze,a as d,d as t,b as s,f as L,g as u,j,k as $,l as a,m as c,n as m,t as f,o as h,p as g}from"../chunks/index.100fac89.js";import{C as Ce}from"../chunks/CopyLLMTxtMenu.9bd2f8ad.js";import{D as W}from"../chunks/Docstring.9e9fdc80.js";import{C as Ee}from"../chunks/CodeBlock.d30a6509.js";import{H as ke,E as je}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.4792a202.js";function Ne(_e){let _,q,R,B,x,G,y,U,w,ve='The 3D variational autoencoder (VAE) model with KL loss used in <a href="https://huggingface.co/Lightricks/LTX-2" rel="nofollow">LTX-2</a> was introduced by Lightricks.',S,V,be="The model can be loaded with the following code snippet.",Y,k,Q,X,ee,n,A,ie,N,Te=`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-2" rel="nofollow">LTX-2</a>.`,le,I,Le=`This model inherits from <a href="/docs/diffusers/pr_12979/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).`,de,F,M,ce,H,K,pe,v,D,ue,Z,$e=`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,b,z,fe,O,xe="Decode a batch of images using a tiled decoder.",he,T,C,ge,P,ye="Encode a batch of images using a tiled encoder.",te,E,oe,J,ne;return x=new Ce({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),y=new ke({props:{title:"AutoencoderKLLTX2Video",local:"autoencoderklltx2video",headingTag:"h1"}}),k=new Ee({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9lbmNvZGVyS0xMVFgyVmlkZW8lMEElMEF2YWUlMjAlM0QlMjBBdXRvZW5jb2RlcktMTFRYMlZpZGVvLmZyb21fcHJldHJhaW5lZCglMjJMaWdodHJpY2tzJTJGTFRYLTIlMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ2YWUlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MzIpLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoencoderKLLTX2Video | |
| vae = AutoencoderKLLTX2Video.from_pretrained(<span class="hljs-string">"Lightricks/LTX-2"</span>, subfolder=<span class="hljs-string">"vae"</span>, torch_dtype=torch.float32).to(<span class="hljs-string">"cuda"</span>)`,wrap:!1}}),X=new ke({props:{title:"AutoencoderKLLTX2Video",local:"diffusers.AutoencoderKLLTX2Video",headingTag:"h2"}}),A=new W({props:{name:"class diffusers.AutoencoderKLLTX2Video",anchor:"diffusers.AutoencoderKLLTX2Video",parameters:[{name:"in_channels",val:": int = 3"},{name:"out_channels",val:": int = 3"},{name:"latent_channels",val:": int = 128"},{name:"block_out_channels",val:": typing.Tuple[int, ...] = (256, 512, 1024, 2048)"},{name:"down_block_types",val:": typing.Tuple[str, ...] = ('LTX2VideoDownBlock3D', 'LTX2VideoDownBlock3D', 'LTX2VideoDownBlock3D', 'LTX2VideoDownBlock3D')"},{name:"decoder_block_out_channels",val:": typing.Tuple[int, ...] = (256, 512, 1024)"},{name:"layers_per_block",val:": typing.Tuple[int, ...] = (4, 6, 6, 2, 2)"},{name:"decoder_layers_per_block",val:": typing.Tuple[int, ...] = (5, 5, 5, 5)"},{name:"spatio_temporal_scaling",val:": typing.Tuple[bool, ...] = (True, True, True, True)"},{name:"decoder_spatio_temporal_scaling",val:": typing.Tuple[bool, ...] = (True, True, True)"},{name:"decoder_inject_noise",val:": typing.Tuple[bool, ...] = (False, False, False, False)"},{name:"downsample_type",val:": typing.Tuple[str, ...] = ('spatial', 'temporal', 'spatiotemporal', 'spatiotemporal')"},{name:"upsample_residual",val:": typing.Tuple[bool, ...] = (True, True, True)"},{name:"upsample_factor",val:": typing.Tuple[int, ...] = (2, 2, 2)"},{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 = True"},{name:"encoder_spatial_padding_mode",val:": str = 'zeros'"},{name:"decoder_spatial_padding_mode",val:": str = 'reflect'"},{name:"spatial_compression_ratio",val:": int = None"},{name:"temporal_compression_ratio",val:": int = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLLTX2Video.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, defaults to <code>3</code>) — | |
| Number of input channels.`,name:"in_channels"},{anchor:"diffusers.AutoencoderKLLTX2Video.out_channels",description:`<strong>out_channels</strong> (<code>int</code>, defaults to <code>3</code>) — | |
| Number of output channels.`,name:"out_channels"},{anchor:"diffusers.AutoencoderKLLTX2Video.latent_channels",description:`<strong>latent_channels</strong> (<code>int</code>, defaults to <code>128</code>) — | |
| Number of latent channels.`,name:"latent_channels"},{anchor:"diffusers.AutoencoderKLLTX2Video.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.AutoencoderKLLTX2Video.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.AutoencoderKLLTX2Video.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.AutoencoderKLLTX2Video.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.AutoencoderKLLTX2Video.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.AutoencoderKLLTX2Video.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.AutoencoderKLLTX2Video.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.AutoencoderKLLTX2Video.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.AutoencoderKLLTX2Video.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"}],source:"https://github.com/huggingface/diffusers/blob/vr_12979/src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py#L1004"}}),M=new W({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLLTX2Video.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_12979/src/diffusers/utils/accelerate_utils.py#L43"}}),K=new W({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLLTX2Video.encode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_12979/src/diffusers/utils/accelerate_utils.py#L43"}}),D=new W({props:{name:"enable_tiling",anchor:"diffusers.AutoencoderKLLTX2Video.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_min_num_frames",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"},{name:"tile_sample_stride_num_frames",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLLTX2Video.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.AutoencoderKLLTX2Video.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.AutoencoderKLLTX2Video.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.AutoencoderKLLTX2Video.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_12979/src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py#L1159"}}),z=new W({props:{name:"tiled_decode",anchor:"diffusers.AutoencoderKLLTX2Video.tiled_decode",parameters:[{name:"z",val:": Tensor"},{name:"temb",val:": typing.Optional[torch.Tensor]"},{name:"causal",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLLTX2Video.tiled_decode.z",description:"<strong>z</strong> (<code>torch.Tensor</code>) — Input batch of latent vectors.",name:"z"},{anchor:"diffusers.AutoencoderKLLTX2Video.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_12979/src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py#L1372",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> | |
| `}}),C=new W({props:{name:"tiled_encode",anchor:"diffusers.AutoencoderKLLTX2Video.tiled_encode",parameters:[{name:"x",val:": Tensor"},{name:"causal",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"diffusers.AutoencoderKLLTX2Video.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_12979/src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py#L1320",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> | |
| `}}),E=new je({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoderkl_ltx_2.md"}}),{c(){_=l("meta"),q=r(),R=l("p"),B=r(),p(x.$$.fragment),G=r(),p(y.$$.fragment),U=r(),w=l("p"),w.innerHTML=ve,S=r(),V=l("p"),V.textContent=be,Y=r(),p(k.$$.fragment),Q=r(),p(X.$$.fragment),ee=r(),n=l("div"),p(A.$$.fragment),ie=r(),N=l("p"),N.innerHTML=Te,le=r(),I=l("p"),I.innerHTML=Le,de=r(),F=l("div"),p(M.$$.fragment),ce=r(),H=l("div"),p(K.$$.fragment),pe=r(),v=l("div"),p(D.$$.fragment),ue=r(),Z=l("p"),Z.textContent=$e,me=r(),b=l("div"),p(z.$$.fragment),fe=r(),O=l("p"),O.textContent=xe,he=r(),T=l("div"),p(C.$$.fragment),ge=r(),P=l("p"),P.textContent=ye,te=r(),p(E.$$.fragment),oe=r(),J=l("p"),this.h()},l(e){const o=ze("svelte-u9bgzb",document.head);_=d(o,"META",{name:!0,content:!0}),o.forEach(t),q=s(e),R=d(e,"P",{}),L(R).forEach(t),B=s(e),u(x.$$.fragment,e),G=s(e),u(y.$$.fragment,e),U=s(e),w=d(e,"P",{"data-svelte-h":!0}),j(w)!=="svelte-4x8314"&&(w.innerHTML=ve),S=s(e),V=d(e,"P",{"data-svelte-h":!0}),j(V)!=="svelte-1vuni30"&&(V.textContent=be),Y=s(e),u(k.$$.fragment,e),Q=s(e),u(X.$$.fragment,e),ee=s(e),n=d(e,"DIV",{class:!0});var i=L(n);u(A.$$.fragment,i),ie=s(i),N=d(i,"P",{"data-svelte-h":!0}),j(N)!=="svelte-15bmt7l"&&(N.innerHTML=Te),le=s(i),I=d(i,"P",{"data-svelte-h":!0}),j(I)!=="svelte-1lxhgko"&&(I.innerHTML=Le),de=s(i),F=d(i,"DIV",{class:!0});var we=L(F);u(M.$$.fragment,we),we.forEach(t),ce=s(i),H=d(i,"DIV",{class:!0});var Ve=L(H);u(K.$$.fragment,Ve),Ve.forEach(t),pe=s(i),v=d(i,"DIV",{class:!0});var ae=L(v);u(D.$$.fragment,ae),ue=s(ae),Z=d(ae,"P",{"data-svelte-h":!0}),j(Z)!=="svelte-1xwrf7t"&&(Z.textContent=$e),ae.forEach(t),me=s(i),b=d(i,"DIV",{class:!0});var re=L(b);u(z.$$.fragment,re),fe=s(re),O=d(re,"P",{"data-svelte-h":!0}),j(O)!=="svelte-1vrxp2b"&&(O.textContent=xe),re.forEach(t),he=s(i),T=d(i,"DIV",{class:!0});var se=L(T);u(C.$$.fragment,se),ge=s(se),P=d(se,"P",{"data-svelte-h":!0}),j(P)!=="svelte-1un5fcn"&&(P.textContent=ye),se.forEach(t),i.forEach(t),te=s(e),u(E.$$.fragment,e),oe=s(e),J=d(e,"P",{}),L(J).forEach(t),this.h()},h(){$(_,"name","hf:doc:metadata"),$(_,"content",Ie),$(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(n,"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){a(document.head,_),c(e,q,o),c(e,R,o),c(e,B,o),m(x,e,o),c(e,G,o),m(y,e,o),c(e,U,o),c(e,w,o),c(e,S,o),c(e,V,o),c(e,Y,o),m(k,e,o),c(e,Q,o),m(X,e,o),c(e,ee,o),c(e,n,o),m(A,n,null),a(n,ie),a(n,N),a(n,le),a(n,I),a(n,de),a(n,F),m(M,F,null),a(n,ce),a(n,H),m(K,H,null),a(n,pe),a(n,v),m(D,v,null),a(v,ue),a(v,Z),a(n,me),a(n,b),m(z,b,null),a(b,fe),a(b,O),a(n,he),a(n,T),m(C,T,null),a(T,ge),a(T,P),c(e,te,o),m(E,e,o),c(e,oe,o),c(e,J,o),ne=!0},p:Ae,i(e){ne||(f(x.$$.fragment,e),f(y.$$.fragment,e),f(k.$$.fragment,e),f(X.$$.fragment,e),f(A.$$.fragment,e),f(M.$$.fragment,e),f(K.$$.fragment,e),f(D.$$.fragment,e),f(z.$$.fragment,e),f(C.$$.fragment,e),f(E.$$.fragment,e),ne=!0)},o(e){h(x.$$.fragment,e),h(y.$$.fragment,e),h(k.$$.fragment,e),h(X.$$.fragment,e),h(A.$$.fragment,e),h(M.$$.fragment,e),h(K.$$.fragment,e),h(D.$$.fragment,e),h(z.$$.fragment,e),h(C.$$.fragment,e),h(E.$$.fragment,e),ne=!1},d(e){e&&(t(q),t(R),t(B),t(G),t(U),t(w),t(S),t(V),t(Y),t(Q),t(ee),t(n),t(te),t(oe),t(J)),t(_),g(x,e),g(y,e),g(k,e),g(X,e),g(A),g(M),g(K),g(D),g(z),g(C),g(E,e)}}}const Ie='{"title":"AutoencoderKLLTX2Video","local":"autoencoderklltx2video","sections":[{"title":"AutoencoderKLLTX2Video","local":"diffusers.AutoencoderKLLTX2Video","sections":[],"depth":2}],"depth":1}';function Fe(_e){return Me(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Je extends Ke{constructor(_){super(),De(this,_,Fe,Ne,Xe,{})}}export{Je as component}; | |
Xet Storage Details
- Size:
- 16.9 kB
- Xet hash:
- 5f76f19bc364375bd396959ccb5ea646346f939281800e83216052e68256d37b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.