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 G,u as b,x as W,k as A,y as z,a as n,v,d as y,t as D,w as L}from"../chunks/index.da70eac4.js";import{D as oe}from"../chunks/Docstring.6b390b9a.js";import{C as le}from"../chunks/CodeBlock.00a903b3.js";import{H as Y,E as me}from"../chunks/EditOnGithub.1e64e623.js";function fe(Q){let a,k,X,q,f,E,c,S='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.",R,p,j,h,C,i,_,N,x,ee='A Transformer model for video-like data used in <a href="https://huggingface.co/Lightricks/LTX-Video" rel="nofollow">LTX</a>.',O,T,H,d,g,F,V,te='The output of <a href="/docs/diffusers/pr_10009/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>.',J,M,P,w,U;return f=new Y({props:{title:"LTXVideoTransformer3DModel",local:"ltxvideotransformer3dmodel",headingTag:"h1"}}),p=new le({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMExUWFZpZGVvVHJhbnNmb3JtZXIzRE1vZGVsJTBBJTBBdHJhbnNmb3JtZXIlMjAlM0QlMjBMVFhWaWRlb1RyYW5zZm9ybWVyM0RNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyVE9ETyUyRlRPRE8lMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ0cmFuc2Zvcm1lciUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYpLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LTXVideoTransformer3DModel

transformer = LTXVideoTransformer3DModel.from_pretrained(<span class="hljs-string">&quot;TODO/TODO&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 Y({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/vr_10009/src/diffusers/models/transformers/transformer_ltx.py#L269"}}),T=new Y({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/pr_10009/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/vr_10009/src/diffusers/models/modeling_outputs.py#L20"}}),M=new me({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/ltx_video_transformer3d.md"}}),{c(){a=l("meta"),k=s(),X=l("p"),q=s(),$(f.$$.fragment),E=s(),c=l("p"),c.innerHTML=S,Z=s(),u=l("p"),u.textContent=K,R=s(),$(p.$$.fragment),j=s(),$(h.$$.fragment),C=s(),i=l("div"),$(_.$$.fragment),N=s(),x=l("p"),x.innerHTML=ee,O=s(),$(T.$$.fragment),H=s(),d=l("div"),$(g.$$.fragment),F=s(),V=l("p"),V.innerHTML=te,J=s(),$(M.$$.fragment),P=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),k=r(e),X=m(e,"P",{}),G(X).forEach(o),q=r(e),b(f.$$.fragment,e),E=r(e),c=m(e,"P",{"data-svelte-h":!0}),W(c)!=="svelte-7itmwr"&&(c.innerHTML=S),Z=r(e),u=m(e,"P",{"data-svelte-h":!0}),W(u)!=="svelte-1vuni30"&&(u.textContent=K),R=r(e),b(p.$$.fragment,e),j=r(e),b(h.$$.fragment,e),C=r(e),i=m(e,"DIV",{class:!0});var B=G(i);b(_.$$.fragment,B),N=r(B),x=m(B,"P",{"data-svelte-h":!0}),W(x)!=="svelte-6rnpr5"&&(x.innerHTML=ee),B.forEach(o),O=r(e),b(T.$$.fragment,e),H=r(e),d=m(e,"DIV",{class:!0});var I=G(d);b(g.$$.fragment,I),F=r(I),V=m(I,"P",{"data-svelte-h":!0}),W(V)!=="svelte-ywgoi0"&&(V.innerHTML=te),I.forEach(o),J=r(e),b(M.$$.fragment,e),P=r(e),w=m(e,"P",{}),G(w).forEach(o),this.h()},h(){A(a,"name","hf:doc:metadata"),A(a,"content",ce),A(i,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(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){z(document.head,a),n(e,k,t),n(e,X,t),n(e,q,t),v(f,e,t),n(e,E,t),n(e,c,t),n(e,Z,t),n(e,u,t),n(e,R,t),v(p,e,t),n(e,j,t),v(h,e,t),n(e,C,t),n(e,i,t),v(_,i,null),z(i,N),z(i,x),n(e,O,t),v(T,e,t),n(e,H,t),n(e,d,t),v(g,d,null),z(d,F),z(d,V),n(e,J,t),v(M,e,t),n(e,P,t),n(e,w,t),U=!0},p:se,i(e){U||(y(f.$$.fragment,e),y(p.$$.fragment,e),y(h.$$.fragment,e),y(_.$$.fragment,e),y(T.$$.fragment,e),y(g.$$.fragment,e),y(M.$$.fragment,e),U=!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(M.$$.fragment,e),U=!1},d(e){e&&(o(k),o(X),o(q),o(E),o(c),o(Z),o(u),o(R),o(j),o(C),o(i),o(O),o(H),o(d),o(J),o(P),o(w)),o(a),L(f,e),L(p,e),L(h,e),L(_),L(T,e),L(g),L(M,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 Me extends ae{constructor(a){super(),ie(this,a,ue,fe,ne,{})}}export{Me as component};
