Buckets:
| 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 F,u as v,x as G,k as S,y as E,a,v as M,d as y,t as D,w as L}from"../chunks/index.da70eac4.js";import{D as ne}from"../chunks/Docstring.567bc132.js";import{C as le}from"../chunks/CodeBlock.a9c4becf.js";import{H as K,E as de}from"../chunks/index.5d4ab994.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.",U,p,V,h,j,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/pr_11234/en/api/models/transformer2d#diffusers.Transformer2DModel">Transformer2DModel</a>.',P,$,H,k,q;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">"Alpha-VLLM/Lumina-Image-2.0"</span>, subfolder=<span class="hljs-string">"transformer"</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>) — 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) — | |
| 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) — | |
| 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) — | |
| The dimensionality of the hidden layers in the model. This parameter determines the width of the model’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) — | |
| 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) — | |
| 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) — | |
| 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) — | |
| 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>) — | |
| 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) — | |
| 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) — | |
| A scaling factor applied to certain parameters or layers in the model. This can be used for adjusting the | |
| overall scale of the model’s operations.`,name:"scaling_factor"}],source:"https://github.com/huggingface/diffusers/blob/vr_11234/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/pr_11234/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_11234/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,U=o(),b(p.$$.fragment),V=o(),b(h.$$.fragment),j=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",{}),F(z).forEach(n),Z=s(e),v(f.$$.fragment,e),C=s(e),u=d(e,"P",{"data-svelte-h":!0}),G(u)!=="svelte-cct7b"&&(u.innerHTML=Q),I=s(e),c=d(e,"P",{"data-svelte-h":!0}),G(c)!=="svelte-1vuni30"&&(c.textContent=X),U=s(e),v(p.$$.fragment,e),V=s(e),v(h.$$.fragment,e),j=s(e),i=d(e,"DIV",{class:!0});var N=F(i);v(_.$$.fragment,N),R=s(N),x=d(N,"P",{"data-svelte-h":!0}),G(x)!=="svelte-fzcdqf"&&(x.textContent=ee),N.forEach(n),A=s(e),v(g.$$.fragment,e),O=s(e),m=d(e,"DIV",{class:!0});var W=F(m);v(T.$$.fragment,W),B=s(W),w=d(W,"P",{"data-svelte-h":!0}),G(w)!=="svelte-19q1qvf"&&(w.innerHTML=te),W.forEach(n),P=s(e),v($.$$.fragment,e),H=s(e),k=d(e,"P",{}),F(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),M(f,e,t),a(e,C,t),a(e,u,t),a(e,I,t),a(e,c,t),a(e,U,t),M(p,e,t),a(e,V,t),M(h,e,t),a(e,j,t),a(e,i,t),M(_,i,null),E(i,R),E(i,x),a(e,A,t),M(g,e,t),a(e,O,t),a(e,m,t),M(T,m,null),E(m,B),E(m,w),a(e,P,t),M($,e,t),a(e,H,t),a(e,k,t),q=!0},p:oe,i(e){q||(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),q=!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),q=!1},d(e){e&&(n(J),n(z),n(Z),n(C),n(u),n(I),n(c),n(U),n(V),n(j),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}; | |
Xet Storage Details
- Size:
- 10.1 kB
- Xet hash:
- e428df754c61d9759e4d3add5ef9d158569f8293d6e50c5e75c19f7b788ab21c
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.