Buckets:
| import{s as ke,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 m,h as ze,a as d,d as t,b as s,f as T,g as u,j as E,k as $,l as a,m as c,n as p,t as f,o as h,p as _}from"../chunks/index.100fac89.js";import{C as Ne}from"../chunks/CopyLLMTxtMenu.67e413d2.js";import{D as R}from"../chunks/Docstring.60584164.js";import{C as Ce}from"../chunks/CodeBlock.d30a6509.js";import{H as Xe,E as Ee}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.debde53c.js";function je(ge){let g,B,J,G,x,U,w,S,V,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.',Y,y,be="The model can be loaded with the following code snippet.",O,X,Q,k,ee,n,A,ie,j,Le=`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,Te=`This model inherits from <a href="/docs/diffusers/pr_13331/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,me,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.`,pe,b,z,fe,P,xe="Decode a batch of images using a tiled decoder.",he,L,N,_e,W,we="Encode a batch of images using a tiled encoder.",te,C,oe,q,ne;return x=new Ne({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),w=new Xe({props:{title:"AutoencoderKLLTX2Video",local:"autoencoderklltx2video",headingTag:"h1"}}),X=new Ce({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}}),k=new Xe({props:{title:"AutoencoderKLLTX2Video",local:"diffusers.AutoencoderKLLTX2Video",headingTag:"h2"}}),A=new R({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:": tuple = (256, 512, 1024, 2048)"},{name:"down_block_types",val:": tuple = ('LTX2VideoDownBlock3D', 'LTX2VideoDownBlock3D', 'LTX2VideoDownBlock3D', 'LTX2VideoDownBlock3D')"},{name:"decoder_block_out_channels",val:": tuple = (256, 512, 1024)"},{name:"layers_per_block",val:": tuple = (4, 6, 6, 2, 2)"},{name:"decoder_layers_per_block",val:": tuple = (5, 5, 5, 5)"},{name:"spatio_temporal_scaling",val:": bool | tuple[bool, ...] = (True, True, True, True)"},{name:"decoder_spatio_temporal_scaling",val:": bool | tuple[bool, ...] = (True, True, True)"},{name:"decoder_inject_noise",val:": bool | tuple[bool, ...] = (False, False, False, False)"},{name:"downsample_type",val:": tuple = ('spatial', 'temporal', 'spatiotemporal', 'spatiotemporal')"},{name:"upsample_type",val:": tuple = ('spatiotemporal', 'spatiotemporal', 'spatiotemporal')"},{name:"upsample_residual",val:": bool | tuple[bool, ...] = (True, True, True)"},{name:"upsample_factor",val:": tuple = (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_13331/src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py#L1025"}}),M=new R({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLLTX2Video.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/utils/accelerate_utils.py#L43"}}),K=new R({props:{name:"wrapper",anchor:"diffusers.AutoencoderKLLTX2Video.encode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/diffusers/blob/vr_13331/src/diffusers/utils/accelerate_utils.py#L43"}}),D=new R({props:{name:"enable_tiling",anchor:"diffusers.AutoencoderKLLTX2Video.enable_tiling",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.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_13331/src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py#L1192"}}),z=new R({props:{name:"tiled_decode",anchor:"diffusers.AutoencoderKLLTX2Video.tiled_decode",parameters:[{name:"z",val:": Tensor"},{name:"temb",val:": torch.Tensor | None"},{name:"causal",val:": bool | None = 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_13331/src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py#L1405",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> | |
| `}}),N=new R({props:{name:"tiled_encode",anchor:"diffusers.AutoencoderKLLTX2Video.tiled_encode",parameters:[{name:"x",val:": Tensor"},{name:"causal",val:": bool | None = 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_13331/src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py#L1353",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> | |
| `}}),C=new Ee({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/autoencoderkl_ltx_2.md"}}),{c(){g=l("meta"),B=r(),J=l("p"),G=r(),m(x.$$.fragment),U=r(),m(w.$$.fragment),S=r(),V=l("p"),V.innerHTML=ve,Y=r(),y=l("p"),y.textContent=be,O=r(),m(X.$$.fragment),Q=r(),m(k.$$.fragment),ee=r(),n=l("div"),m(A.$$.fragment),ie=r(),j=l("p"),j.innerHTML=Le,le=r(),I=l("p"),I.innerHTML=Te,de=r(),F=l("div"),m(M.$$.fragment),ce=r(),H=l("div"),m(K.$$.fragment),me=r(),v=l("div"),m(D.$$.fragment),ue=r(),Z=l("p"),Z.textContent=$e,pe=r(),b=l("div"),m(z.$$.fragment),fe=r(),P=l("p"),P.textContent=xe,he=r(),L=l("div"),m(N.$$.fragment),_e=r(),W=l("p"),W.textContent=we,te=r(),m(C.$$.fragment),oe=r(),q=l("p"),this.h()},l(e){const o=ze("svelte-u9bgzb",document.head);g=d(o,"META",{name:!0,content:!0}),o.forEach(t),B=s(e),J=d(e,"P",{}),T(J).forEach(t),G=s(e),u(x.$$.fragment,e),U=s(e),u(w.$$.fragment,e),S=s(e),V=d(e,"P",{"data-svelte-h":!0}),E(V)!=="svelte-4x8314"&&(V.innerHTML=ve),Y=s(e),y=d(e,"P",{"data-svelte-h":!0}),E(y)!=="svelte-1vuni30"&&(y.textContent=be),O=s(e),u(X.$$.fragment,e),Q=s(e),u(k.$$.fragment,e),ee=s(e),n=d(e,"DIV",{class:!0});var i=T(n);u(A.$$.fragment,i),ie=s(i),j=d(i,"P",{"data-svelte-h":!0}),E(j)!=="svelte-15bmt7l"&&(j.innerHTML=Le),le=s(i),I=d(i,"P",{"data-svelte-h":!0}),E(I)!=="svelte-szgy71"&&(I.innerHTML=Te),de=s(i),F=d(i,"DIV",{class:!0});var Ve=T(F);u(M.$$.fragment,Ve),Ve.forEach(t),ce=s(i),H=d(i,"DIV",{class:!0});var ye=T(H);u(K.$$.fragment,ye),ye.forEach(t),me=s(i),v=d(i,"DIV",{class:!0});var ae=T(v);u(D.$$.fragment,ae),ue=s(ae),Z=d(ae,"P",{"data-svelte-h":!0}),E(Z)!=="svelte-1xwrf7t"&&(Z.textContent=$e),ae.forEach(t),pe=s(i),b=d(i,"DIV",{class:!0});var re=T(b);u(z.$$.fragment,re),fe=s(re),P=d(re,"P",{"data-svelte-h":!0}),E(P)!=="svelte-1vrxp2b"&&(P.textContent=xe),re.forEach(t),he=s(i),L=d(i,"DIV",{class:!0});var se=T(L);u(N.$$.fragment,se),_e=s(se),W=d(se,"P",{"data-svelte-h":!0}),E(W)!=="svelte-1un5fcn"&&(W.textContent=we),se.forEach(t),i.forEach(t),te=s(e),u(C.$$.fragment,e),oe=s(e),q=d(e,"P",{}),T(q).forEach(t),this.h()},h(){$(g,"name","hf:doc:metadata"),$(g,"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"),$(L,"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,g),c(e,B,o),c(e,J,o),c(e,G,o),p(x,e,o),c(e,U,o),p(w,e,o),c(e,S,o),c(e,V,o),c(e,Y,o),c(e,y,o),c(e,O,o),p(X,e,o),c(e,Q,o),p(k,e,o),c(e,ee,o),c(e,n,o),p(A,n,null),a(n,ie),a(n,j),a(n,le),a(n,I),a(n,de),a(n,F),p(M,F,null),a(n,ce),a(n,H),p(K,H,null),a(n,me),a(n,v),p(D,v,null),a(v,ue),a(v,Z),a(n,pe),a(n,b),p(z,b,null),a(b,fe),a(b,P),a(n,he),a(n,L),p(N,L,null),a(L,_e),a(L,W),c(e,te,o),p(C,e,o),c(e,oe,o),c(e,q,o),ne=!0},p:Ae,i(e){ne||(f(x.$$.fragment,e),f(w.$$.fragment,e),f(X.$$.fragment,e),f(k.$$.fragment,e),f(A.$$.fragment,e),f(M.$$.fragment,e),f(K.$$.fragment,e),f(D.$$.fragment,e),f(z.$$.fragment,e),f(N.$$.fragment,e),f(C.$$.fragment,e),ne=!0)},o(e){h(x.$$.fragment,e),h(w.$$.fragment,e),h(X.$$.fragment,e),h(k.$$.fragment,e),h(A.$$.fragment,e),h(M.$$.fragment,e),h(K.$$.fragment,e),h(D.$$.fragment,e),h(z.$$.fragment,e),h(N.$$.fragment,e),h(C.$$.fragment,e),ne=!1},d(e){e&&(t(B),t(J),t(G),t(U),t(S),t(V),t(Y),t(y),t(O),t(Q),t(ee),t(n),t(te),t(oe),t(q)),t(g),_(x,e),_(w,e),_(X,e),_(k,e),_(A),_(M),_(K),_(D),_(z),_(N),_(C,e)}}}const Ie='{"title":"AutoencoderKLLTX2Video","local":"autoencoderklltx2video","sections":[{"title":"AutoencoderKLLTX2Video","local":"diffusers.AutoencoderKLLTX2Video","sections":[],"depth":2}],"depth":1}';function Fe(ge){return Me(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qe extends Ke{constructor(g){super(),De(this,g,Fe,je,ke,{})}}export{qe as component}; | |
Xet Storage Details
- Size:
- 16.8 kB
- Xet hash:
- bcff5428dabed4fb8f28aed4136fb152fea35e13f39fd9b235e07562c1a91b65
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.