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

transformer = LTXTransformer3DModel.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 Q({props:{title:"LTXTransformer3DModel",local:"diffusers.LTXTransformer3DModel",headingTag:"h2"}}),_=new ne({props:{name:"class diffusers.LTXTransformer3DModel",anchor:"diffusers.LTXTransformer3DModel",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.LTXTransformer3DModel.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.LTXTransformer3DModel.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.LTXTransformer3DModel.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.LTXTransformer3DModel.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.LTXTransformer3DModel.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.LTXTransformer3DModel.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.LTXTransformer3DModel.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.LTXTransformer3DModel.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.LTXTransformer3DModel.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.LTXTransformer3DModel.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_10021/src/diffusers/models/transformers/transformer_ltx.py#L273"}}),T=new Q({props:{title:"Transformer2DModelOutput",local:"diffusers.models.modeling_outputs.Transformer2DModelOutput",headingTag:"h2"}}),g=new ne({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_10021/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_10021/src/diffusers/models/modeling_outputs.py#L20"}}),$=new me({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/ltx_transformer3d.md"}}),{c(){a=l("meta"),J=r(),X=l("p"),q=r(),b(f.$$.fragment),U=r(),c=l("p"),c.innerHTML=B,C=r(),u=l("p"),u.textContent=K,R=r(),b(p.$$.fragment),E=r(),b(h.$$.fragment),H=r(),i=l("div"),b(_.$$.fragment),A=r(),x=l("p"),x.innerHTML=ee,Z=r(),b(T.$$.fragment),O=r(),d=l("div"),b(g.$$.fragment),N=r(),w=l("p"),w.innerHTML=te,V=r(),b($.$$.fragment),P=r(),z=l("p"),this.h()},l(e){const t=de("svelte-u9bgzb",document.head);a=m(t,"META",{name:!0,content:!0}),t.forEach(n),J=s(e),X=m(e,"P",{}),j(X).forEach(n),q=s(e),v(f.$$.fragment,e),U=s(e),c=m(e,"P",{"data-svelte-h":!0}),W(c)!=="svelte-7itmwr"&&(c.innerHTML=B),C=s(e),u=m(e,"P",{"data-svelte-h":!0}),W(u)!=="svelte-1vuni30"&&(u.textContent=K),R=s(e),v(p.$$.fragment,e),E=s(e),v(h.$$.fragment,e),H=s(e),i=m(e,"DIV",{class:!0});var I=j(i);v(_.$$.fragment,I),A=s(I),x=m(I,"P",{"data-svelte-h":!0}),W(x)!=="svelte-6rnpr5"&&(x.innerHTML=ee),I.forEach(n),Z=s(e),v(T.$$.fragment,e),O=s(e),d=m(e,"DIV",{class:!0});var Y=j(d);v(g.$$.fragment,Y),N=s(Y),w=m(Y,"P",{"data-svelte-h":!0}),W(w)!=="svelte-17grq7y"&&(w.innerHTML=te),Y.forEach(n),V=s(e),v($.$$.fragment,e),P=s(e),z=m(e,"P",{}),j(z).forEach(n),this.h()},h(){S(a,"name","hf:doc:metadata"),S(a,"content",ce),S(i,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),S(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),o(e,J,t),o(e,X,t),o(e,q,t),M(f,e,t),o(e,U,t),o(e,c,t),o(e,C,t),o(e,u,t),o(e,R,t),M(p,e,t),o(e,E,t),M(h,e,t),o(e,H,t),o(e,i,t),M(_,i,null),k(i,A),k(i,x),o(e,Z,t),M(T,e,t),o(e,O,t),o(e,d,t),M(g,d,null),k(d,N),k(d,w),o(e,V,t),M($,e,t),o(e,P,t),o(e,z,t),G=!0},p:re,i(e){G||(y(f.$$.fragment,e),y(p.$$.fragment,e),y(h.$$.fragment,e),y(_.$$.fragment,e),y(T.$$.fragment,e),y(g.$$.fragment,e),y($.$$.fragment,e),G=!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($.$$.fragment,e),G=!1},d(e){e&&(n(J),n(X),n(q),n(U),n(c),n(C),n(u),n(R),n(E),n(H),n(i),n(Z),n(O),n(d),n(V),n(P),n(z)),n(a),L(f,e),L(p,e),L(h,e),L(_),L(T,e),L(g),L($,e)}}}const ce='{"title":"LTXTransformer3DModel","local":"ltxtransformer3dmodel","sections":[{"title":"LTXTransformer3DModel","local":"diffusers.LTXTransformer3DModel","sections":[],"depth":2},{"title":"Transformer2DModelOutput","local":"diffusers.models.modeling_outputs.Transformer2DModelOutput","sections":[],"depth":2}],"depth":1}';function ue(F){return se(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $e extends ae{constructor(a){super(),ie(this,a,ue,fe,oe,{})}}export{$e as component};
