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

transformer = Lumina2Transformer2DModel.from_pretrained(<span class="hljs-string">&quot;Alpha-VLLM/Lumina-Image-2.0&quot;</span>, subfolder=<span class="hljs-string">&quot;transformer&quot;</span>, torch_dtype=torch.bfloat16)`,wrap:!1}}),h=new K({props:{title:"Lumina2Transformer2DModel",local:"diffusers.Lumina2Transformer2DModel",headingTag:"h2"}}),_=new ne({props:{name:"class diffusers.Lumina2Transformer2DModel",anchor:"diffusers.Lumina2Transformer2DModel",parameters:[{name:"sample_size",val:": int = 128"},{name:"patch_size",val:": int = 2"},{name:"in_channels",val:": int = 16"},{name:"out_channels",val:": typing.Optional[int] = None"},{name:"hidden_size",val:": int = 2304"},{name:"num_layers",val:": int = 26"},{name:"num_refiner_layers",val:": int = 2"},{name:"num_attention_heads",val:": int = 24"},{name:"num_kv_heads",val:": int = 8"},{name:"multiple_of",val:": int = 256"},{name:"ffn_dim_multiplier",val:": typing.Optional[float] = None"},{name:"norm_eps",val:": float = 1e-05"},{name:"scaling_factor",val:": float = 1.0"},{name:"axes_dim_rope",val:": typing.Tuple[int, int, int] = (32, 32, 32)"},{name:"axes_lens",val:": typing.Tuple[int, int, int] = (300, 512, 512)"},{name:"cap_feat_dim",val:": int = 1024"}],parametersDescription:[{anchor:"diffusers.Lumina2Transformer2DModel.sample_size",description:`<strong>sample_size</strong> (<code>int</code>) &#x2014; The width of the latent images. This is fixed during training since
it is used to learn a number of position embeddings.`,name:"sample_size"},{anchor:"diffusers.Lumina2Transformer2DModel.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The size of each patch in the image. This parameter defines the resolution of patches fed into the model.`,name:"patch_size"},{anchor:"diffusers.Lumina2Transformer2DModel.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of input channels for the model. Typically, this matches the number of channels in the input
images.`,name:"in_channels"},{anchor:"diffusers.Lumina2Transformer2DModel.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
The dimensionality of the hidden layers in the model. This parameter determines the width of the model&#x2019;s
hidden representations.`,name:"hidden_size"},{anchor:"diffusers.Lumina2Transformer2DModel.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, default to 32) &#x2014;
The number of layers in the model. This defines the depth of the neural network.`,name:"num_layers"},{anchor:"diffusers.Lumina2Transformer2DModel.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The number of attention heads in each attention layer. This parameter specifies how many separate attention
mechanisms are used.`,name:"num_attention_heads"},{anchor:"diffusers.Lumina2Transformer2DModel.num_kv_heads",description:`<strong>num_kv_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
The number of key-value heads in the attention mechanism, if different from the number of attention heads.
If None, it defaults to num_attention_heads.`,name:"num_kv_heads"},{anchor:"diffusers.Lumina2Transformer2DModel.multiple_of",description:`<strong>multiple_of</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
A factor that the hidden size should be a multiple of. This can help optimize certain hardware
configurations.`,name:"multiple_of"},{anchor:"diffusers.Lumina2Transformer2DModel.ffn_dim_multiplier",description:`<strong>ffn_dim_multiplier</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A multiplier for the dimensionality of the feed-forward network. If None, it uses a default value based on
the model configuration.`,name:"ffn_dim_multiplier"},{anchor:"diffusers.Lumina2Transformer2DModel.norm_eps",description:`<strong>norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
A small value added to the denominator for numerical stability in normalization layers.`,name:"norm_eps"},{anchor:"diffusers.Lumina2Transformer2DModel.scaling_factor",description:`<strong>scaling_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
A scaling factor applied to certain parameters or layers in the model. This can be used for adjusting the
overall scale of the model&#x2019;s operations.`,name:"scaling_factor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/transformers/transformer_lumina2.py#L325"}}),g=new K({props:{title:"Transformer2DModelOutput",local:"diffusers.models.modeling_outputs.Transformer2DModelOutput",headingTag:"h2"}}),T=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/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"}}),$=new de({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/lumina2_transformer2d.md"}}),{c(){r=l("meta"),J=o(),z=l("p"),Z=o(),b(f.$$.fragment),C=o(),u=l("p"),u.innerHTML=Q,I=o(),c=l("p"),c.textContent=X,j=o(),b(p.$$.fragment),U=o(),b(h.$$.fragment),V=o(),i=l("div"),b(_.$$.fragment),R=o(),x=l("p"),x.textContent=ee,A=o(),b(g.$$.fragment),O=o(),m=l("div"),b(T.$$.fragment),B=o(),w=l("p"),w.innerHTML=te,P=o(),b($.$$.fragment),H=o(),k=l("p"),this.h()},l(e){const t=me("svelte-u9bgzb",document.head);r=d(t,"META",{name:!0,content:!0}),t.forEach(n),J=s(e),z=d(e,"P",{}),G(z).forEach(n),Z=s(e),M(f.$$.fragment,e),C=s(e),u=d(e,"P",{"data-svelte-h":!0}),q(u)!=="svelte-cct7b"&&(u.innerHTML=Q),I=s(e),c=d(e,"P",{"data-svelte-h":!0}),q(c)!=="svelte-1vuni30"&&(c.textContent=X),j=s(e),M(p.$$.fragment,e),U=s(e),M(h.$$.fragment,e),V=s(e),i=d(e,"DIV",{class:!0});var W=G(i);M(_.$$.fragment,W),R=s(W),x=d(W,"P",{"data-svelte-h":!0}),q(x)!=="svelte-fzcdqf"&&(x.textContent=ee),W.forEach(n),A=s(e),M(g.$$.fragment,e),O=s(e),m=d(e,"DIV",{class:!0});var F=G(m);M(T.$$.fragment,F),B=s(F),w=d(F,"P",{"data-svelte-h":!0}),q(w)!=="svelte-1x8c0js"&&(w.innerHTML=te),F.forEach(n),P=s(e),M($.$$.fragment,e),H=s(e),k=d(e,"P",{}),G(k).forEach(n),this.h()},h(){S(r,"name","hf:doc:metadata"),S(r,"content",ue),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(m,"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){E(document.head,r),a(e,J,t),a(e,z,t),a(e,Z,t),v(f,e,t),a(e,C,t),a(e,u,t),a(e,I,t),a(e,c,t),a(e,j,t),v(p,e,t),a(e,U,t),v(h,e,t),a(e,V,t),a(e,i,t),v(_,i,null),E(i,R),E(i,x),a(e,A,t),v(g,e,t),a(e,O,t),a(e,m,t),v(T,m,null),E(m,B),E(m,w),a(e,P,t),v($,e,t),a(e,H,t),a(e,k,t),N=!0},p:oe,i(e){N||(y(f.$$.fragment,e),y(p.$$.fragment,e),y(h.$$.fragment,e),y(_.$$.fragment,e),y(g.$$.fragment,e),y(T.$$.fragment,e),y($.$$.fragment,e),N=!0)},o(e){D(f.$$.fragment,e),D(p.$$.fragment,e),D(h.$$.fragment,e),D(_.$$.fragment,e),D(g.$$.fragment,e),D(T.$$.fragment,e),D($.$$.fragment,e),N=!1},d(e){e&&(n(J),n(z),n(Z),n(C),n(u),n(I),n(c),n(j),n(U),n(V),n(i),n(A),n(O),n(m),n(P),n(H),n(k)),n(r),L(f,e),L(p,e),L(h,e),L(_),L(g,e),L(T),L($,e)}}}const ue='{"title":"Lumina2Transformer2DModel","local":"lumina2transformer2dmodel","sections":[{"title":"Lumina2Transformer2DModel","local":"diffusers.Lumina2Transformer2DModel","sections":[],"depth":2},{"title":"Transformer2DModelOutput","local":"diffusers.models.modeling_outputs.Transformer2DModelOutput","sections":[],"depth":2}],"depth":1}';function ce(Y){return se(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $e extends re{constructor(r){super(),ie(this,r,ce,fe,ae,{})}}export{$e as component};
