import{s as he,o as ge,n as _e}from"../chunks/scheduler.8c3d61f6.js";import{S as $e,i as be,g as d,s as a,r as g,A as ve,h as m,f as r,c as i,j as N,u as $,x as L,k as Q,y as s,a as c,v as b,d as v,t as w,w as T}from"../chunks/index.da70eac4.js";import{T as ue}from"../chunks/Tip.1d9b8c37.js";import{D as Y}from"../chunks/Docstring.6b390b9a.js";import{H as pe,E as we}from"../chunks/EditOnGithub.1e64e623.js";function Te(q){let t,u="This API is 🧪 experimental.";return{c(){t=d("p"),t.textContent=u},l(o){t=m(o,"P",{"data-svelte-h":!0}),L(t)!=="svelte-89q1io"&&(t.textContent=u)},m(o,x){c(o,t,x)},p:_e,d(o){o&&r(t)}}}function xe(q){let t,u="This API is 🧪 experimental.";return{c(){t=d("p"),t.textContent=u},l(o){t=m(o,"P",{"data-svelte-h":!0}),L(t)!=="svelte-89q1io"&&(t.textContent=u)},m(o,x){c(o,t,x)},p:_e,d(o){o&&r(t)}}}function Ae(q){let t,u,o,x,y,G,F,le='A Transformer model for image-like data from <a href="https://blog.fal.ai/auraflow/" rel="nofollow">AuraFlow</a>.',O,j,R,l,C,Z,I,de='A 2D Transformer model as introduced in AuraFlow (<a href="https://blog.fal.ai/auraflow/" rel="nofollow">https://blog.fal.ai/auraflow/</a>).',ee,p,P,te,H,me=`Enables fused QKV projections. For self-attention modules, all projection matrices (i.e., query, key, value)
are fused. For cross-attention modules, key and value projection matrices are fused.`,ne,A,re,D,z,oe,V,fe="Sets the attention processor to use to compute attention.",se,_,k,ae,S,ce="Disables the fused QKV projection if enabled.",ie,M,B,E,J,U,W;return y=new pe({props:{title:"AuraFlowTransformer2DModel",local:"auraflowtransformer2dmodel",headingTag:"h1"}}),j=new pe({props:{title:"AuraFlowTransformer2DModel",local:"diffusers.AuraFlowTransformer2DModel",headingTag:"h2"}}),C=new Y({props:{name:"class diffusers.AuraFlowTransformer2DModel",anchor:"diffusers.AuraFlowTransformer2DModel",parameters:[{name:"sample_size",val:": int = 64"},{name:"patch_size",val:": int = 2"},{name:"in_channels",val:": int = 4"},{name:"num_mmdit_layers",val:": int = 4"},{name:"num_single_dit_layers",val:": int = 32"},{name:"attention_head_dim",val:": int = 256"},{name:"num_attention_heads",val:": int = 12"},{name:"joint_attention_dim",val:": int = 2048"},{name:"caption_projection_dim",val:": int = 3072"},{name:"out_channels",val:": int = 4"},{name:"pos_embed_max_size",val:": int = 1024"}],parametersDescription:[{anchor:"diffusers.AuraFlowTransformer2DModel.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.AuraFlowTransformer2DModel.patch_size",description:"<strong>patch_size</strong> (<code>int</code>) &#x2014; Patch size to turn the input data into small patches.",name:"patch_size"},{anchor:"diffusers.AuraFlowTransformer2DModel.in_channels",description:"<strong>in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014; The number of channels in the input.",name:"in_channels"},{anchor:"diffusers.AuraFlowTransformer2DModel.num_mmdit_layers",description:"<strong>num_mmdit_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014; The number of layers of MMDiT Transformer blocks to use.",name:"num_mmdit_layers"},{anchor:"diffusers.AuraFlowTransformer2DModel.num_single_dit_layers",description:`<strong>num_single_dit_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of layers of Transformer blocks to use. These blocks use concatenated image and text
representations.`,name:"num_single_dit_layers"},{anchor:"diffusers.AuraFlowTransformer2DModel.attention_head_dim",description:"<strong>attention_head_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014; The number of channels in each head.",name:"attention_head_dim"},{anchor:"diffusers.AuraFlowTransformer2DModel.num_attention_heads",description:"<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 18) &#x2014; The number of heads to use for multi-head attention.",name:"num_attention_heads"},{anchor:"diffusers.AuraFlowTransformer2DModel.joint_attention_dim",description:"<strong>joint_attention_dim</strong> (<code>int</code>, <em>optional</em>) &#x2014; The number of <code>encoder_hidden_states</code> dimensions to use.",name:"joint_attention_dim"},{anchor:"diffusers.AuraFlowTransformer2DModel.caption_projection_dim",description:"<strong>caption_projection_dim</strong> (<code>int</code>) &#x2014; Number of dimensions to use when projecting the <code>encoder_hidden_states</code>.",name:"caption_projection_dim"},{anchor:"diffusers.AuraFlowTransformer2DModel.out_channels",description:"<strong>out_channels</strong> (<code>int</code>, defaults to 16) &#x2014; Number of output channels.",name:"out_channels"},{anchor:"diffusers.AuraFlowTransformer2DModel.pos_embed_max_size",description:"<strong>pos_embed_max_size</strong> (<code>int</code>, defaults to 4096) &#x2014; Maximum positions to embed from the image latents.",name:"pos_embed_max_size"}],source:"https://github.com/huggingface/diffusers/blob/vr_7615/src/diffusers/models/transformers/auraflow_transformer_2d.py#L256"}}),P=new Y({props:{name:"fuse_qkv_projections",anchor:"diffusers.AuraFlowTransformer2DModel.fuse_qkv_projections",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_7615/src/diffusers/models/transformers/auraflow_transformer_2d.py#L406"}}),A=new ue({props:{warning:!0,$$slots:{default:[Te]},$$scope:{ctx:q}}}),z=new Y({props:{name:"set_attn_processor",anchor:"diffusers.AuraFlowTransformer2DModel.set_attn_processor",parameters:[{name:"processor",val:": Union"}],parametersDescription:[{anchor:"diffusers.AuraFlowTransformer2DModel.set_attn_processor.processor",description:`<strong>processor</strong> (<code>dict</code> of <code>AttentionProcessor</code> or only <code>AttentionProcessor</code>) &#x2014;
The instantiated processor class or a dictionary of processor classes that will be set as the processor
for <strong>all</strong> <code>Attention</code> layers.</p>
<p>If <code>processor</code> is a dict, the key needs to define the path to the corresponding cross attention
processor. This is strongly recommended when setting trainable attention processors.`,name:"processor"}],source:"https://github.com/huggingface/diffusers/blob/vr_7615/src/diffusers/models/transformers/auraflow_transformer_2d.py#L371"}}),k=new Y({props:{name:"unfuse_qkv_projections",anchor:"diffusers.AuraFlowTransformer2DModel.unfuse_qkv_projections",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_7615/src/diffusers/models/transformers/auraflow_transformer_2d.py#L432"}}),M=new ue({props:{warning:!0,$$slots:{default:[xe]},$$scope:{ctx:q}}}),E=new we({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/aura_flow_transformer2d.md"}}),{c(){t=d("meta"),u=a(),o=d("p"),x=a(),g(y.$$.fragment),G=a(),F=d("p"),F.innerHTML=le,O=a(),g(j.$$.fragment),R=a(),l=d("div"),g(C.$$.fragment),Z=a(),I=d("p"),I.innerHTML=de,ee=a(),p=d("div"),g(P.$$.fragment),te=a(),H=d("p"),H.textContent=me,ne=a(),g(A.$$.fragment),re=a(),D=d("div"),g(z.$$.fragment),oe=a(),V=d("p"),V.textContent=fe,se=a(),_=d("div"),g(k.$$.fragment),ae=a(),S=d("p"),S.textContent=ce,ie=a(),g(M.$$.fragment),B=a(),g(E.$$.fragment),J=a(),U=d("p"),this.h()},l(e){const n=ve("svelte-u9bgzb",document.head);t=m(n,"META",{name:!0,content:!0}),n.forEach(r),u=i(e),o=m(e,"P",{}),N(o).forEach(r),x=i(e),$(y.$$.fragment,e),G=i(e),F=m(e,"P",{"data-svelte-h":!0}),L(F)!=="svelte-1cl4wve"&&(F.innerHTML=le),O=i(e),$(j.$$.fragment,e),R=i(e),l=m(e,"DIV",{class:!0});var f=N(l);$(C.$$.fragment,f),Z=i(f),I=m(f,"P",{"data-svelte-h":!0}),L(I)!=="svelte-xp13t2"&&(I.innerHTML=de),ee=i(f),p=m(f,"DIV",{class:!0});var h=N(p);$(P.$$.fragment,h),te=i(h),H=m(h,"P",{"data-svelte-h":!0}),L(H)!=="svelte-1254b9i"&&(H.textContent=me),ne=i(h),$(A.$$.fragment,h),h.forEach(r),re=i(f),D=m(f,"DIV",{class:!0});var X=N(D);$(z.$$.fragment,X),oe=i(X),V=m(X,"P",{"data-svelte-h":!0}),L(V)!=="svelte-1o77hl2"&&(V.textContent=fe),X.forEach(r),se=i(f),_=m(f,"DIV",{class:!0});var K=N(_);$(k.$$.fragment,K),ae=i(K),S=m(K,"P",{"data-svelte-h":!0}),L(S)!=="svelte-1vhtc74"&&(S.textContent=ce),ie=i(K),$(M.$$.fragment,K),K.forEach(r),f.forEach(r),B=i(e),$(E.$$.fragment,e),J=i(e),U=m(e,"P",{}),N(U).forEach(r),this.h()},h(){Q(t,"name","hf:doc:metadata"),Q(t,"content",De),Q(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(_,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Q(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,n){s(document.head,t),c(e,u,n),c(e,o,n),c(e,x,n),b(y,e,n),c(e,G,n),c(e,F,n),c(e,O,n),b(j,e,n),c(e,R,n),c(e,l,n),b(C,l,null),s(l,Z),s(l,I),s(l,ee),s(l,p),b(P,p,null),s(p,te),s(p,H),s(p,ne),b(A,p,null),s(l,re),s(l,D),b(z,D,null),s(D,oe),s(D,V),s(l,se),s(l,_),b(k,_,null),s(_,ae),s(_,S),s(_,ie),b(M,_,null),c(e,B,n),b(E,e,n),c(e,J,n),c(e,U,n),W=!0},p(e,[n]){const f={};n&2&&(f.$$scope={dirty:n,ctx:e}),A.$set(f);const h={};n&2&&(h.$$scope={dirty:n,ctx:e}),M.$set(h)},i(e){W||(v(y.$$.fragment,e),v(j.$$.fragment,e),v(C.$$.fragment,e),v(P.$$.fragment,e),v(A.$$.fragment,e),v(z.$$.fragment,e),v(k.$$.fragment,e),v(M.$$.fragment,e),v(E.$$.fragment,e),W=!0)},o(e){w(y.$$.fragment,e),w(j.$$.fragment,e),w(C.$$.fragment,e),w(P.$$.fragment,e),w(A.$$.fragment,e),w(z.$$.fragment,e),w(k.$$.fragment,e),w(M.$$.fragment,e),w(E.$$.fragment,e),W=!1},d(e){e&&(r(u),r(o),r(x),r(G),r(F),r(O),r(R),r(l),r(B),r(J),r(U)),r(t),T(y,e),T(j,e),T(C),T(P),T(A),T(z),T(k),T(M),T(E,e)}}}const De='{"title":"AuraFlowTransformer2DModel","local":"auraflowtransformer2dmodel","sections":[{"title":"AuraFlowTransformer2DModel","local":"diffusers.AuraFlowTransformer2DModel","sections":[],"depth":2}],"depth":1}';function Me(q){return ge(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ze extends $e{constructor(t){super(),be(this,t,Me,Ae,he,{})}}export{ze as component};
