import{s as ne,n as se,o as re}from"../chunks/scheduler.8c3d61f6.js";import{S as ae,i as ie,g as l,s,r as $,A as de,h as m,f as o,c as r,j as O,u as v,x as Y,k as B,y as k,a as n,v as M,d as y,t as D,w as L}from"../chunks/index.da70eac4.js";import{D as oe}from"../chunks/Docstring.932cdff3.js";import{C as le}from"../chunks/CodeBlock.a9c4becf.js";import{H as S,E as me}from"../chunks/index.ef90fe87.js";function fe(Q){let a,z,X,R,f,q,c,F='A Diffusion Transformer model for 3D data from <a href="https://huggingface.co/Lightricks/LTX-Video" rel="nofollow">LTX</a> was introduced by Lightricks.',Z,u,K="The model can be loaded with the following code snippet.",C,p,J,h,U,i,_,A,x,ee='A Transformer model for video-like data used in <a href="https://huggingface.co/Lightricks/LTX-Video" rel="nofollow">LTX</a>.',H,T,W,d,g,N,V,te='The output of <a href="/docs/diffusers/main/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>.',G,b,j,w,E;return f=new S({props:{title:"LTXVideoTransformer3DModel",local:"ltxvideotransformer3dmodel",headingTag:"h1"}}),p=new le({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMExUWFZpZGVvVHJhbnNmb3JtZXIzRE1vZGVsJTBBJTBBdHJhbnNmb3JtZXIlMjAlM0QlMjBMVFhWaWRlb1RyYW5zZm9ybWVyM0RNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyTGlnaHRyaWNrcyUyRkxUWC1WaWRlbyUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnRyYW5zZm9ybWVyJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNikudG8oJTIyY3VkYSUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LTXVideoTransformer3DModel

transformer = LTXVideoTransformer3DModel.from_pretrained(<span class="hljs-string">&quot;Lightricks/LTX-Video&quot;</span>, subfolder=<span class="hljs-string">&quot;transformer&quot;</span>, torch_dtype=torch.bfloat16).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),h=new S({props:{title:"LTXVideoTransformer3DModel",local:"diffusers.LTXVideoTransformer3DModel",headingTag:"h2"}}),_=new oe({props:{name:"class diffusers.LTXVideoTransformer3DModel",anchor:"diffusers.LTXVideoTransformer3DModel",parameters:[{name:"in_channels",val:": int = 128"},{name:"out_channels",val:": int = 128"},{name:"patch_size",val:": int = 1"},{name:"patch_size_t",val:": int = 1"},{name:"num_attention_heads",val:": int = 32"},{name:"attention_head_dim",val:": int = 64"},{name:"cross_attention_dim",val:": int = 2048"},{name:"num_layers",val:": int = 28"},{name:"activation_fn",val:": str = 'gelu-approximate'"},{name:"qk_norm",val:": str = 'rms_norm_across_heads'"},{name:"norm_elementwise_affine",val:": bool = False"},{name:"norm_eps",val:": float = 1e-06"},{name:"caption_channels",val:": int = 4096"},{name:"attention_bias",val:": bool = True"},{name:"attention_out_bias",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.LTXVideoTransformer3DModel.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, defaults to <code>128</code>) &#x2014;
The number of channels in the input.`,name:"in_channels"},{anchor:"diffusers.LTXVideoTransformer3DModel.out_channels",description:`<strong>out_channels</strong> (<code>int</code>, defaults to <code>128</code>) &#x2014;
The number of channels in the output.`,name:"out_channels"},{anchor:"diffusers.LTXVideoTransformer3DModel.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, defaults to <code>1</code>) &#x2014;
The size of the spatial patches to use in the patch embedding layer.`,name:"patch_size"},{anchor:"diffusers.LTXVideoTransformer3DModel.patch_size_t",description:`<strong>patch_size_t</strong> (<code>int</code>, defaults to <code>1</code>) &#x2014;
The size of the tmeporal patches to use in the patch embedding layer.`,name:"patch_size_t"},{anchor:"diffusers.LTXVideoTransformer3DModel.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, defaults to <code>32</code>) &#x2014;
The number of heads to use for multi-head attention.`,name:"num_attention_heads"},{anchor:"diffusers.LTXVideoTransformer3DModel.attention_head_dim",description:`<strong>attention_head_dim</strong> (<code>int</code>, defaults to <code>64</code>) &#x2014;
The number of channels in each head.`,name:"attention_head_dim"},{anchor:"diffusers.LTXVideoTransformer3DModel.cross_attention_dim",description:`<strong>cross_attention_dim</strong> (<code>int</code>, defaults to <code>2048 </code>) &#x2014;
The number of channels for cross attention heads.`,name:"cross_attention_dim"},{anchor:"diffusers.LTXVideoTransformer3DModel.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, defaults to <code>28</code>) &#x2014;
The number of layers of Transformer blocks to use.`,name:"num_layers"},{anchor:"diffusers.LTXVideoTransformer3DModel.activation_fn",description:`<strong>activation_fn</strong> (<code>str</code>, defaults to <code>&quot;gelu-approximate&quot;</code>) &#x2014;
Activation function to use in feed-forward.`,name:"activation_fn"},{anchor:"diffusers.LTXVideoTransformer3DModel.qk_norm",description:`<strong>qk_norm</strong> (<code>str</code>, defaults to <code>&quot;rms_norm_across_heads&quot;</code>) &#x2014;
The normalization layer to use.`,name:"qk_norm"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/transformers/transformer_ltx.py#L301"}}),T=new S({props:{title:"Transformer2DModelOutput",local:"diffusers.models.modeling_outputs.Transformer2DModelOutput",headingTag:"h2"}}),g=new oe({props:{name:"class diffusers.models.modeling_outputs.Transformer2DModelOutput",anchor:"diffusers.models.modeling_outputs.Transformer2DModelOutput",parameters:[{name:"sample",val:": torch.Tensor"}],parametersDescription:[{anchor:"diffusers.models.modeling_outputs.Transformer2DModelOutput.sample",description:`<strong>sample</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code> or <code>(batch size, num_vector_embeds - 1, num_latent_pixels)</code> if <a href="/docs/diffusers/main/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a> is discrete) &#x2014;
The hidden states output conditioned on the <code>encoder_hidden_states</code> input. If discrete, returns probability
distributions for the unnoised latent pixels.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/modeling_outputs.py#L20"}}),b=new me({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/ltx_video_transformer3d.md"}}),{c(){a=l("meta"),z=s(),X=l("p"),R=s(),$(f.$$.fragment),q=s(),c=l("p"),c.innerHTML=F,Z=s(),u=l("p"),u.textContent=K,C=s(),$(p.$$.fragment),J=s(),$(h.$$.fragment),U=s(),i=l("div"),$(_.$$.fragment),A=s(),x=l("p"),x.innerHTML=ee,H=s(),$(T.$$.fragment),W=s(),d=l("div"),$(g.$$.fragment),N=s(),V=l("p"),V.innerHTML=te,G=s(),$(b.$$.fragment),j=s(),w=l("p"),this.h()},l(e){const t=de("svelte-u9bgzb",document.head);a=m(t,"META",{name:!0,content:!0}),t.forEach(o),z=r(e),X=m(e,"P",{}),O(X).forEach(o),R=r(e),v(f.$$.fragment,e),q=r(e),c=m(e,"P",{"data-svelte-h":!0}),Y(c)!=="svelte-7itmwr"&&(c.innerHTML=F),Z=r(e),u=m(e,"P",{"data-svelte-h":!0}),Y(u)!=="svelte-1vuni30"&&(u.textContent=K),C=r(e),v(p.$$.fragment,e),J=r(e),v(h.$$.fragment,e),U=r(e),i=m(e,"DIV",{class:!0});var P=O(i);v(_.$$.fragment,P),A=r(P),x=m(P,"P",{"data-svelte-h":!0}),Y(x)!=="svelte-6rnpr5"&&(x.innerHTML=ee),P.forEach(o),H=r(e),v(T.$$.fragment,e),W=r(e),d=m(e,"DIV",{class:!0});var I=O(d);v(g.$$.fragment,I),N=r(I),V=m(I,"P",{"data-svelte-h":!0}),Y(V)!=="svelte-1x8c0js"&&(V.innerHTML=te),I.forEach(o),G=r(e),v(b.$$.fragment,e),j=r(e),w=m(e,"P",{}),O(w).forEach(o),this.h()},h(){B(a,"name","hf:doc:metadata"),B(a,"content",ce),B(i,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(d,"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,t){k(document.head,a),n(e,z,t),n(e,X,t),n(e,R,t),M(f,e,t),n(e,q,t),n(e,c,t),n(e,Z,t),n(e,u,t),n(e,C,t),M(p,e,t),n(e,J,t),M(h,e,t),n(e,U,t),n(e,i,t),M(_,i,null),k(i,A),k(i,x),n(e,H,t),M(T,e,t),n(e,W,t),n(e,d,t),M(g,d,null),k(d,N),k(d,V),n(e,G,t),M(b,e,t),n(e,j,t),n(e,w,t),E=!0},p:se,i(e){E||(y(f.$$.fragment,e),y(p.$$.fragment,e),y(h.$$.fragment,e),y(_.$$.fragment,e),y(T.$$.fragment,e),y(g.$$.fragment,e),y(b.$$.fragment,e),E=!0)},o(e){D(f.$$.fragment,e),D(p.$$.fragment,e),D(h.$$.fragment,e),D(_.$$.fragment,e),D(T.$$.fragment,e),D(g.$$.fragment,e),D(b.$$.fragment,e),E=!1},d(e){e&&(o(z),o(X),o(R),o(q),o(c),o(Z),o(u),o(C),o(J),o(U),o(i),o(H),o(W),o(d),o(G),o(j),o(w)),o(a),L(f,e),L(p,e),L(h,e),L(_),L(T,e),L(g),L(b,e)}}}const ce='{"title":"LTXVideoTransformer3DModel","local":"ltxvideotransformer3dmodel","sections":[{"title":"LTXVideoTransformer3DModel","local":"diffusers.LTXVideoTransformer3DModel","sections":[],"depth":2},{"title":"Transformer2DModelOutput","local":"diffusers.models.modeling_outputs.Transformer2DModelOutput","sections":[],"depth":2}],"depth":1}';function ue(Q){return re(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class be extends ae{constructor(a){super(),ie(this,a,ue,fe,ne,{})}}export{be as component};
