Buckets:
| import{s as fe,n as ue,o as pe}from"../chunks/scheduler.53228c21.js";import{S as he,i as _e,e as d,s as r,c,h as ge,a as i,d as t,b as s,f as R,g as f,j as U,k as W,l as u,m as n,n as p,t as h,o as _,p as g}from"../chunks/index.cac5d66a.js";import{C as Te}from"../chunks/CopyLLMTxtMenu.0ef49226.js";import{D as re}from"../chunks/Docstring.9de32ff4.js";import{C as be}from"../chunks/CodeBlock.606cbaf4.js";import{H as se,E as ve}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.48d5cb47.js";function $e(ae){let m,Z,C,J,b,P,v,I,$,de='A Diffusion Transformer model for 3D data from <a href="https://huggingface.co/Lightricks/LTX-Video" rel="nofollow">LTX</a> was introduced by Lightricks.',E,M,ie="The model can be loaded with the following code snippet.",G,y,j,L,O,a,x,ee,k,me='A Transformer model for video-like data used in <a href="https://huggingface.co/Lightricks/LTX-Video" rel="nofollow">LTX</a>.',oe,T,D,te,z,le='The <a href="/docs/diffusers/pr_13921/en/api/models/ltx_video_transformer3d#diffusers.LTXVideoTransformer3DModel">LTXVideoTransformer3DModel</a> forward method.',A,w,Y,l,V,ne,q,ce='The output of <a href="/docs/diffusers/pr_13921/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>.',B,X,S,H,Q;return b=new Te({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),v=new se({props:{title:"LTXVideoTransformer3DModel",local:"ltxvideotransformer3dmodel",headingTag:"h1"}}),y=new be({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">"Lightricks/LTX-Video"</span>, subfolder=<span class="hljs-string">"transformer"</span>, torch_dtype=torch.bfloat16).to(<span class="hljs-string">"cuda"</span>)`,lang:"python",wrap:!1}}),L=new se({props:{title:"LTXVideoTransformer3DModel",local:"diffusers.LTXVideoTransformer3DModel",headingTag:"h2"}}),x=new re({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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>"gelu-approximate"</code>) — | |
| 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>"rms_norm_across_heads"</code>) — | |
| The normalization layer to use.`,name:"qk_norm"}],source:"https://github.com/huggingface/diffusers/blob/vr_13921/src/diffusers/models/transformers/transformer_ltx.py#L385"}}),D=new re({props:{name:"forward",anchor:"diffusers.LTXVideoTransformer3DModel.forward",parameters:[{name:"hidden_states",val:": Tensor"},{name:"encoder_hidden_states",val:": Tensor"},{name:"timestep",val:": LongTensor"},{name:"encoder_attention_mask",val:": Tensor"},{name:"num_frames",val:": int | None = None"},{name:"height",val:": int | None = None"},{name:"width",val:": int | None = None"},{name:"rope_interpolation_scale",val:": tuple[float, float, float] | torch.Tensor | None = None"},{name:"video_coords",val:": torch.Tensor | None = None"},{name:"attention_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.LTXVideoTransformer3DModel.forward.hidden_states",description:`<strong>hidden_states</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length, in_channels)</code>) — | |
| Input <code>hidden_states</code>.`,name:"hidden_states"},{anchor:"diffusers.LTXVideoTransformer3DModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_len, embed_dims)</code>) — | |
| Conditional embeddings (embeddings computed from the input conditions such as prompts) to use.`,name:"encoder_hidden_states"},{anchor:"diffusers.LTXVideoTransformer3DModel.forward.timestep",description:`<strong>timestep</strong> (<code>torch.LongTensor</code>) — | |
| Used to indicate denoising step.`,name:"timestep"},{anchor:"diffusers.LTXVideoTransformer3DModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.Tensor</code>) — | |
| Mask applied to <code>encoder_hidden_states</code> during attention.`,name:"encoder_attention_mask"},{anchor:"diffusers.LTXVideoTransformer3DModel.forward.num_frames",description:`<strong>num_frames</strong> (<code>int</code>, <em>optional</em>) — | |
| Number of frames in the video used to compute the rotary positional embeddings.`,name:"num_frames"},{anchor:"diffusers.LTXVideoTransformer3DModel.forward.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>) — | |
| Height of the latent used to compute the rotary positional embeddings.`,name:"height"},{anchor:"diffusers.LTXVideoTransformer3DModel.forward.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>) — | |
| Width of the latent used to compute the rotary positional embeddings.`,name:"width"},{anchor:"diffusers.LTXVideoTransformer3DModel.forward.rope_interpolation_scale",description:`<strong>rope_interpolation_scale</strong> (<code>tuple</code> of <code>float</code> or <code>torch.Tensor</code>, <em>optional</em>) — | |
| Interpolation scale used by the rotary positional embeddings.`,name:"rope_interpolation_scale"},{anchor:"diffusers.LTXVideoTransformer3DModel.forward.video_coords",description:`<strong>video_coords</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Pre-computed video coordinates used by the rotary positional embeddings.`,name:"video_coords"},{anchor:"diffusers.LTXVideoTransformer3DModel.forward.attention_kwargs",description:`<strong>attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) — | |
| A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under | |
| <code>self.processor</code> in | |
| <a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"attention_kwargs"},{anchor:"diffusers.LTXVideoTransformer3DModel.forward.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.transformer_2d.Transformer2DModelOutput</code> instead of a plain | |
| tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/vr_13921/src/diffusers/models/transformers/transformer_ltx.py#L494",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The denoised output tensor of shape <code>(batch_size, sequence_length, out_channels)</code>.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>torch.Tensor</code></p> | |
| `}}),w=new se({props:{title:"Transformer2DModelOutput",local:"diffusers.models.modeling_outputs.Transformer2DModelOutput",headingTag:"h2"}}),V=new re({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_13921/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a> is discrete) — | |
| 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_13921/src/diffusers/models/modeling_outputs.py#L21"}}),X=new ve({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/ltx_video_transformer3d.md"}}),{c(){m=d("meta"),Z=r(),C=d("p"),J=r(),c(b.$$.fragment),P=r(),c(v.$$.fragment),I=r(),$=d("p"),$.innerHTML=de,E=r(),M=d("p"),M.textContent=ie,G=r(),c(y.$$.fragment),j=r(),c(L.$$.fragment),O=r(),a=d("div"),c(x.$$.fragment),ee=r(),k=d("p"),k.innerHTML=me,oe=r(),T=d("div"),c(D.$$.fragment),te=r(),z=d("p"),z.innerHTML=le,A=r(),c(w.$$.fragment),Y=r(),l=d("div"),c(V.$$.fragment),ne=r(),q=d("p"),q.innerHTML=ce,B=r(),c(X.$$.fragment),S=r(),H=d("p"),this.h()},l(e){const o=ge("svelte-u9bgzb",document.head);m=i(o,"META",{name:!0,content:!0}),o.forEach(t),Z=s(e),C=i(e,"P",{}),R(C).forEach(t),J=s(e),f(b.$$.fragment,e),P=s(e),f(v.$$.fragment,e),I=s(e),$=i(e,"P",{"data-svelte-h":!0}),U($)!=="svelte-7itmwr"&&($.innerHTML=de),E=s(e),M=i(e,"P",{"data-svelte-h":!0}),U(M)!=="svelte-1vuni30"&&(M.textContent=ie),G=s(e),f(y.$$.fragment,e),j=s(e),f(L.$$.fragment,e),O=s(e),a=i(e,"DIV",{class:!0});var N=R(a);f(x.$$.fragment,N),ee=s(N),k=i(N,"P",{"data-svelte-h":!0}),U(k)!=="svelte-6rnpr5"&&(k.innerHTML=me),oe=s(N),T=i(N,"DIV",{class:!0});var F=R(T);f(D.$$.fragment,F),te=s(F),z=i(F,"P",{"data-svelte-h":!0}),U(z)!=="svelte-eqjzz4"&&(z.innerHTML=le),F.forEach(t),N.forEach(t),A=s(e),f(w.$$.fragment,e),Y=s(e),l=i(e,"DIV",{class:!0});var K=R(l);f(V.$$.fragment,K),ne=s(K),q=i(K,"P",{"data-svelte-h":!0}),U(q)!=="svelte-2clpd6"&&(q.innerHTML=ce),K.forEach(t),B=s(e),f(X.$$.fragment,e),S=s(e),H=i(e,"P",{}),R(H).forEach(t),this.h()},h(){W(m,"name","hf:doc:metadata"),W(m,"content",Me),W(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),W(a,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),W(l,"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){u(document.head,m),n(e,Z,o),n(e,C,o),n(e,J,o),p(b,e,o),n(e,P,o),p(v,e,o),n(e,I,o),n(e,$,o),n(e,E,o),n(e,M,o),n(e,G,o),p(y,e,o),n(e,j,o),p(L,e,o),n(e,O,o),n(e,a,o),p(x,a,null),u(a,ee),u(a,k),u(a,oe),u(a,T),p(D,T,null),u(T,te),u(T,z),n(e,A,o),p(w,e,o),n(e,Y,o),n(e,l,o),p(V,l,null),u(l,ne),u(l,q),n(e,B,o),p(X,e,o),n(e,S,o),n(e,H,o),Q=!0},p:ue,i(e){Q||(h(b.$$.fragment,e),h(v.$$.fragment,e),h(y.$$.fragment,e),h(L.$$.fragment,e),h(x.$$.fragment,e),h(D.$$.fragment,e),h(w.$$.fragment,e),h(V.$$.fragment,e),h(X.$$.fragment,e),Q=!0)},o(e){_(b.$$.fragment,e),_(v.$$.fragment,e),_(y.$$.fragment,e),_(L.$$.fragment,e),_(x.$$.fragment,e),_(D.$$.fragment,e),_(w.$$.fragment,e),_(V.$$.fragment,e),_(X.$$.fragment,e),Q=!1},d(e){e&&(t(Z),t(C),t(J),t(P),t(I),t($),t(E),t(M),t(G),t(j),t(O),t(a),t(A),t(Y),t(l),t(B),t(S),t(H)),t(m),g(b,e),g(v,e),g(y,e),g(L,e),g(x),g(D),g(w,e),g(V),g(X,e)}}}const Me='{"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 ye(ae){return pe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ke extends he{constructor(m){super(),_e(this,m,ye,$e,fe,{})}}export{ke as component}; | |
Xet Storage Details
- Size:
- 14.5 kB
- Xet hash:
- 8a7c044c4f596bdfe8aed027622319b2a7a541effc0c067fcd758a47d77cb4d5
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.