import{s as Z,n as ee,o as te}from"../chunks/scheduler.8c3d61f6.js";import{S as ne,i as oe,g as d,s as r,r as x,A as re,h as l,f as n,c as s,j as I,u as w,x as O,k as q,y as m,a,v as B,d as y,t as k,w as j}from"../chunks/index.da70eac4.js";import{D as X}from"../chunks/Docstring.367be9ed.js";import{H as Y,E as se}from"../chunks/getInferenceSnippets.cb466318.js";function ae(V){let i,L,D,N,p,P,u,G='A modified flux Transformer model from <a href="https://huggingface.co/briaai/BRIA-3.2" rel="nofollow">Bria</a>',z,h,E,o,_,R,T,J="The Transformer model introduced in Flux. Based on FluxPipeline with several changes:",S,v,K=`<li>no pooled embeddings</li> <li>We use zero padding for prompts</li> <li>No guidance embedding since this is not a distilled version
Reference: <a href="https://blackforestlabs.ai/announcing-black-forest-labs/" rel="nofollow">https://blackforestlabs.ai/announcing-black-forest-labs/</a></li>`,U,c,g,W,$,Q='The <a href="/docs/diffusers/main/en/api/models/bria_transformer#diffusers.BriaTransformer2DModel">BriaTransformer2DModel</a> forward method.',A,b,C,M,H;return p=new Y({props:{title:"BriaTransformer2DModel",local:"briatransformer2dmodel",headingTag:"h1"}}),h=new Y({props:{title:"BriaTransformer2DModel",local:"diffusers.BriaTransformer2DModel",headingTag:"h2"}}),_=new X({props:{name:"class diffusers.BriaTransformer2DModel",anchor:"diffusers.BriaTransformer2DModel",parameters:[{name:"patch_size",val:": int = 1"},{name:"in_channels",val:": int = 64"},{name:"num_layers",val:": int = 19"},{name:"num_single_layers",val:": int = 38"},{name:"attention_head_dim",val:": int = 128"},{name:"num_attention_heads",val:": int = 24"},{name:"joint_attention_dim",val:": int = 4096"},{name:"pooled_projection_dim",val:": int = None"},{name:"guidance_embeds",val:": bool = False"},{name:"axes_dims_rope",val:": typing.List[int] = [16, 56, 56]"},{name:"rope_theta",val:" = 10000"},{name:"time_theta",val:" = 10000"}],parametersDescription:[{anchor:"diffusers.BriaTransformer2DModel.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.BriaTransformer2DModel.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.BriaTransformer2DModel.num_layers",description:"<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 18) &#x2014; The number of layers of MMDiT blocks to use.",name:"num_layers"},{anchor:"diffusers.BriaTransformer2DModel.num_single_layers",description:"<strong>num_single_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 18) &#x2014; The number of layers of single DiT blocks to use.",name:"num_single_layers"},{anchor:"diffusers.BriaTransformer2DModel.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.BriaTransformer2DModel.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.BriaTransformer2DModel.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.BriaTransformer2DModel.pooled_projection_dim",description:"<strong>pooled_projection_dim</strong> (<code>int</code>) &#x2014; Number of dimensions to use when projecting the <code>pooled_projections</code>.",name:"pooled_projection_dim"},{anchor:"diffusers.BriaTransformer2DModel.guidance_embeds",description:"<strong>guidance_embeds</strong> (<code>bool</code>, defaults to False) &#x2014; Whether to use guidance embeddings.",name:"guidance_embeds"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/transformers/transformer_bria.py#L506"}}),g=new X({props:{name:"forward",anchor:"diffusers.BriaTransformer2DModel.forward",parameters:[{name:"hidden_states",val:": Tensor"},{name:"encoder_hidden_states",val:": Tensor = None"},{name:"pooled_projections",val:": Tensor = None"},{name:"timestep",val:": LongTensor = None"},{name:"img_ids",val:": Tensor = None"},{name:"txt_ids",val:": Tensor = None"},{name:"guidance",val:": Tensor = None"},{name:"attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"return_dict",val:": bool = True"},{name:"controlnet_block_samples",val:" = None"},{name:"controlnet_single_block_samples",val:" = None"}],parametersDescription:[{anchor:"diffusers.BriaTransformer2DModel.forward.hidden_states",description:`<strong>hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch size, channel, height, width)</code>) &#x2014;
Input <code>hidden_states</code>.`,name:"hidden_states"},{anchor:"diffusers.BriaTransformer2DModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch size, sequence_len, embed_dims)</code>) &#x2014;
Conditional embeddings (embeddings computed from the input conditions such as prompts) to use.`,name:"encoder_hidden_states"},{anchor:"diffusers.BriaTransformer2DModel.forward.pooled_projections",description:`<strong>pooled_projections</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, projection_dim)</code>) &#x2014; Embeddings projected
from the embeddings of input conditions.`,name:"pooled_projections"},{anchor:"diffusers.BriaTransformer2DModel.forward.timestep",description:`<strong>timestep</strong> ( <code>torch.LongTensor</code>) &#x2014;
Used to indicate denoising step.`,name:"timestep"},{anchor:"diffusers.BriaTransformer2DModel.forward.block_controlnet_hidden_states",description:`<strong>block_controlnet_hidden_states</strong> &#x2014; (<code>list</code> of <code>torch.Tensor</code>):
A list of tensors that if specified are added to the residuals of transformer blocks.`,name:"block_controlnet_hidden_states"},{anchor:"diffusers.BriaTransformer2DModel.forward.attention_kwargs",description:`<strong>attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
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.BriaTransformer2DModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
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/main/src/diffusers/models/transformers/transformer_bria.py#L584",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is True, an <code>~models.transformer_2d.Transformer2DModelOutput</code> is returned, otherwise a
<code>tuple</code> where the first element is the sample tensor.</p>
`}}),b=new se({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/bria_transformer.md"}}),{c(){i=d("meta"),L=r(),D=d("p"),N=r(),x(p.$$.fragment),P=r(),u=d("p"),u.innerHTML=G,z=r(),x(h.$$.fragment),E=r(),o=d("div"),x(_.$$.fragment),R=r(),T=d("p"),T.textContent=J,S=r(),v=d("ul"),v.innerHTML=K,U=r(),c=d("div"),x(g.$$.fragment),W=r(),$=d("p"),$.innerHTML=Q,A=r(),x(b.$$.fragment),C=r(),M=d("p"),this.h()},l(e){const t=re("svelte-u9bgzb",document.head);i=l(t,"META",{name:!0,content:!0}),t.forEach(n),L=s(e),D=l(e,"P",{}),I(D).forEach(n),N=s(e),w(p.$$.fragment,e),P=s(e),u=l(e,"P",{"data-svelte-h":!0}),O(u)!=="svelte-vdk7rf"&&(u.innerHTML=G),z=s(e),w(h.$$.fragment,e),E=s(e),o=l(e,"DIV",{class:!0});var f=I(o);w(_.$$.fragment,f),R=s(f),T=l(f,"P",{"data-svelte-h":!0}),O(T)!=="svelte-j29xf4"&&(T.textContent=J),S=s(f),v=l(f,"UL",{"data-svelte-h":!0}),O(v)!=="svelte-y346xd"&&(v.innerHTML=K),U=s(f),c=l(f,"DIV",{class:!0});var F=I(c);w(g.$$.fragment,F),W=s(F),$=l(F,"P",{"data-svelte-h":!0}),O($)!=="svelte-uqv5w3"&&($.innerHTML=Q),F.forEach(n),f.forEach(n),A=s(e),w(b.$$.fragment,e),C=s(e),M=l(e,"P",{}),I(M).forEach(n),this.h()},h(){q(i,"name","hf:doc:metadata"),q(i,"content",ie),q(c,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(o,"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){m(document.head,i),a(e,L,t),a(e,D,t),a(e,N,t),B(p,e,t),a(e,P,t),a(e,u,t),a(e,z,t),B(h,e,t),a(e,E,t),a(e,o,t),B(_,o,null),m(o,R),m(o,T),m(o,S),m(o,v),m(o,U),m(o,c),B(g,c,null),m(c,W),m(c,$),a(e,A,t),B(b,e,t),a(e,C,t),a(e,M,t),H=!0},p:ee,i(e){H||(y(p.$$.fragment,e),y(h.$$.fragment,e),y(_.$$.fragment,e),y(g.$$.fragment,e),y(b.$$.fragment,e),H=!0)},o(e){k(p.$$.fragment,e),k(h.$$.fragment,e),k(_.$$.fragment,e),k(g.$$.fragment,e),k(b.$$.fragment,e),H=!1},d(e){e&&(n(L),n(D),n(N),n(P),n(u),n(z),n(E),n(o),n(A),n(C),n(M)),n(i),j(p,e),j(h,e),j(_),j(g),j(b,e)}}}const ie='{"title":"BriaTransformer2DModel","local":"briatransformer2dmodel","sections":[{"title":"BriaTransformer2DModel","local":"diffusers.BriaTransformer2DModel","sections":[],"depth":2}],"depth":1}';function de(V){return te(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pe extends ne{constructor(i){super(),oe(this,i,de,ae,Z,{})}}export{pe as component};
