import{s as Z,n as ee,o as te}from"../chunks/scheduler.8c3d61f6.js";import{S as ne,i as ae,g as d,s as i,r as L,A as ie,h as m,f as n,c as o,j as S,u as N,x as V,k as j,y as l,a as s,v as M,d as w,t as y,w as k}from"../chunks/index.da70eac4.js";import{D as Q}from"../chunks/Docstring.6b390b9a.js";import{H as Y,E as oe}from"../chunks/EditOnGithub.1e64e623.js";function se(R){let r,z,b,O,c,C,h,U='A Next Version of Diffusion Transformer model for 2D data from <a href="https://github.com/Alpha-VLLM/Lumina-T2X" rel="nofollow">Lumina-T2X</a>.',P,p,A,a,_,W,T,B="LuminaNextDiT: Diffusion model with a Transformer backbone.",X,D,J="Inherit ModelMixin and ConfigMixin to be compatible with the sampler StableDiffusionPipeline of diffusers.",F,f,g,G,v,K="Forward pass of LuminaNextDiT.",E,x,q,$,I;return c=new Y({props:{title:"LuminaNextDiT2DModel",local:"luminanextdit2dmodel",headingTag:"h1"}}),p=new Y({props:{title:"LuminaNextDiT2DModel",local:"diffusers.LuminaNextDiT2DModel",headingTag:"h2"}}),_=new Q({props:{name:"class diffusers.LuminaNextDiT2DModel",anchor:"diffusers.LuminaNextDiT2DModel",parameters:[{name:"sample_size",val:": int = 128"},{name:"patch_size",val:": Optional = 2"},{name:"in_channels",val:": Optional = 4"},{name:"hidden_size",val:": Optional = 2304"},{name:"num_layers",val:": Optional = 32"},{name:"num_attention_heads",val:": Optional = 32"},{name:"num_kv_heads",val:": Optional = None"},{name:"multiple_of",val:": Optional = 256"},{name:"ffn_dim_multiplier",val:": Optional = None"},{name:"norm_eps",val:": Optional = 1e-05"},{name:"learn_sigma",val:": Optional = True"},{name:"qk_norm",val:": Optional = True"},{name:"cross_attention_dim",val:": Optional = 2048"},{name:"scaling_factor",val:": Optional = 1.0"}],parametersDescription:[{anchor:"diffusers.LuminaNextDiT2DModel.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.LuminaNextDiT2DModel.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.LuminaNextDiT2DModel.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.LuminaNextDiT2DModel.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.LuminaNextDiT2DModel.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.LuminaNextDiT2DModel.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.LuminaNextDiT2DModel.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.LuminaNextDiT2DModel.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.LuminaNextDiT2DModel.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.LuminaNextDiT2DModel.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.LuminaNextDiT2DModel.learn_sigma",description:`<strong>learn_sigma</strong> (<code>bool</code>, <em>optional</em>, defaults to True) &#x2014;
Whether the model should learn the sigma parameter, which might be related to uncertainty or variance in
predictions.`,name:"learn_sigma"},{anchor:"diffusers.LuminaNextDiT2DModel.qk_norm",description:`<strong>qk_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to True) &#x2014;
Indicates if the queries and keys in the attention mechanism should be normalized.`,name:"qk_norm"},{anchor:"diffusers.LuminaNextDiT2DModel.cross_attention_dim",description:`<strong>cross_attention_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
The dimensionality of the text embeddings. This parameter defines the size of the text representations used
in the model.`,name:"cross_attention_dim"},{anchor:"diffusers.LuminaNextDiT2DModel.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/lumina_nextdit2d.py#L178"}}),g=new Q({props:{name:"forward",anchor:"diffusers.LuminaNextDiT2DModel.forward",parameters:[{name:"hidden_states",val:": Tensor"},{name:"timestep",val:": Tensor"},{name:"encoder_hidden_states",val:": Tensor"},{name:"encoder_mask",val:": Tensor"},{name:"image_rotary_emb",val:": Tensor"},{name:"cross_attention_kwargs",val:": Dict = None"},{name:"return_dict",val:" = True"}],parametersDescription:[{anchor:"diffusers.LuminaNextDiT2DModel.forward.hidden_states",description:"<strong>hidden_states</strong> (torch.Tensor) &#x2014; Input tensor of shape (N, C, H, W).",name:"hidden_states"},{anchor:"diffusers.LuminaNextDiT2DModel.forward.timestep",description:"<strong>timestep</strong> (torch.Tensor) &#x2014; Tensor of diffusion timesteps of shape (N,).",name:"timestep"},{anchor:"diffusers.LuminaNextDiT2DModel.forward.encoder_hidden_states",description:"<strong>encoder_hidden_states</strong> (torch.Tensor) &#x2014; Tensor of caption features of shape (N, D).",name:"encoder_hidden_states"},{anchor:"diffusers.LuminaNextDiT2DModel.forward.encoder_mask",description:"<strong>encoder_mask</strong> (torch.Tensor) &#x2014; Tensor of caption masks of shape (N, L).",name:"encoder_mask"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/transformers/lumina_nextdit2d.py#L289"}}),x=new oe({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/lumina_nextdit2d.md"}}),{c(){r=d("meta"),z=i(),b=d("p"),O=i(),L(c.$$.fragment),C=i(),h=d("p"),h.innerHTML=U,P=i(),L(p.$$.fragment),A=i(),a=d("div"),L(_.$$.fragment),W=i(),T=d("p"),T.textContent=B,X=i(),D=d("p"),D.textContent=J,F=i(),f=d("div"),L(g.$$.fragment),G=i(),v=d("p"),v.textContent=K,E=i(),L(x.$$.fragment),q=i(),$=d("p"),this.h()},l(e){const t=ie("svelte-u9bgzb",document.head);r=m(t,"META",{name:!0,content:!0}),t.forEach(n),z=o(e),b=m(e,"P",{}),S(b).forEach(n),O=o(e),N(c.$$.fragment,e),C=o(e),h=m(e,"P",{"data-svelte-h":!0}),V(h)!=="svelte-13vz9fn"&&(h.innerHTML=U),P=o(e),N(p.$$.fragment,e),A=o(e),a=m(e,"DIV",{class:!0});var u=S(a);N(_.$$.fragment,u),W=o(u),T=m(u,"P",{"data-svelte-h":!0}),V(T)!=="svelte-8adszf"&&(T.textContent=B),X=o(u),D=m(u,"P",{"data-svelte-h":!0}),V(D)!=="svelte-wuyqug"&&(D.textContent=J),F=o(u),f=m(u,"DIV",{class:!0});var H=S(f);N(g.$$.fragment,H),G=o(H),v=m(H,"P",{"data-svelte-h":!0}),V(v)!=="svelte-vv6okb"&&(v.textContent=K),H.forEach(n),u.forEach(n),E=o(e),N(x.$$.fragment,e),q=o(e),$=m(e,"P",{}),S($).forEach(n),this.h()},h(){j(r,"name","hf:doc:metadata"),j(r,"content",re),j(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(a,"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){l(document.head,r),s(e,z,t),s(e,b,t),s(e,O,t),M(c,e,t),s(e,C,t),s(e,h,t),s(e,P,t),M(p,e,t),s(e,A,t),s(e,a,t),M(_,a,null),l(a,W),l(a,T),l(a,X),l(a,D),l(a,F),l(a,f),M(g,f,null),l(f,G),l(f,v),s(e,E,t),M(x,e,t),s(e,q,t),s(e,$,t),I=!0},p:ee,i(e){I||(w(c.$$.fragment,e),w(p.$$.fragment,e),w(_.$$.fragment,e),w(g.$$.fragment,e),w(x.$$.fragment,e),I=!0)},o(e){y(c.$$.fragment,e),y(p.$$.fragment,e),y(_.$$.fragment,e),y(g.$$.fragment,e),y(x.$$.fragment,e),I=!1},d(e){e&&(n(z),n(b),n(O),n(C),n(h),n(P),n(A),n(a),n(E),n(q),n($)),n(r),k(c,e),k(p,e),k(_),k(g),k(x,e)}}}const re='{"title":"LuminaNextDiT2DModel","local":"luminanextdit2dmodel","sections":[{"title":"LuminaNextDiT2DModel","local":"diffusers.LuminaNextDiT2DModel","sections":[],"depth":2}],"depth":1}';function de(R){return te(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ce extends ne{constructor(r){super(),ae(this,r,de,se,Z,{})}}export{ce as component};
