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 C,A as re,h as m,f as n,c as s,j as q,u as M,x as F,k as S,y as c,a,v as y,d as w,t as k,w as P}from"../chunks/index.da70eac4.js";import{D as X}from"../chunks/Docstring.91dd4639.js";import{H as Y,E as se}from"../chunks/getInferenceSnippets.28ca3596.js";function ae(W){let i,j,$,L,h,N,u,B='A modified flux Transformer model from <a href="https://huggingface.co/lodestones/Chroma" rel="nofollow">Chroma</a>',z,_,E,o,p,R,b,J="The Transformer model introduced in Flux, modified for Chroma.",U,v,K='Reference: <a href="https://huggingface.co/lodestones/Chroma" rel="nofollow">https://huggingface.co/lodestones/Chroma</a>',V,l,g,G,x,Q='The <a href="/docs/diffusers/main/en/api/models/flux_transformer#diffusers.FluxTransformer2DModel">FluxTransformer2DModel</a> forward method.',H,T,A,D,I;return h=new Y({props:{title:"ChromaTransformer2DModel",local:"chromatransformer2dmodel",headingTag:"h1"}}),_=new Y({props:{title:"ChromaTransformer2DModel",local:"diffusers.ChromaTransformer2DModel",headingTag:"h2"}}),p=new X({props:{name:"class diffusers.ChromaTransformer2DModel",anchor:"diffusers.ChromaTransformer2DModel",parameters:[{name:"patch_size",val:": int = 1"},{name:"in_channels",val:": int = 64"},{name:"out_channels",val:": typing.Optional[int] = None"},{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:"axes_dims_rope",val:": typing.Tuple[int, ...] = (16, 56, 56)"},{name:"approximator_num_channels",val:": int = 64"},{name:"approximator_hidden_dim",val:": int = 5120"},{name:"approximator_layers",val:": int = 5"}],parametersDescription:[{anchor:"diffusers.ChromaTransformer2DModel.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, defaults to <code>1</code>) &#x2014;
Patch size to turn the input data into small patches.`,name:"patch_size"},{anchor:"diffusers.ChromaTransformer2DModel.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, defaults to <code>64</code>) &#x2014;
The number of channels in the input.`,name:"in_channels"},{anchor:"diffusers.ChromaTransformer2DModel.out_channels",description:`<strong>out_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The number of channels in the output. If not specified, it defaults to <code>in_channels</code>.`,name:"out_channels"},{anchor:"diffusers.ChromaTransformer2DModel.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, defaults to <code>19</code>) &#x2014;
The number of layers of dual stream DiT blocks to use.`,name:"num_layers"},{anchor:"diffusers.ChromaTransformer2DModel.num_single_layers",description:`<strong>num_single_layers</strong> (<code>int</code>, defaults to <code>38</code>) &#x2014;
The number of layers of single stream DiT blocks to use.`,name:"num_single_layers"},{anchor:"diffusers.ChromaTransformer2DModel.attention_head_dim",description:`<strong>attention_head_dim</strong> (<code>int</code>, defaults to <code>128</code>) &#x2014;
The number of dimensions to use for each attention head.`,name:"attention_head_dim"},{anchor:"diffusers.ChromaTransformer2DModel.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, defaults to <code>24</code>) &#x2014;
The number of attention heads to use.`,name:"num_attention_heads"},{anchor:"diffusers.ChromaTransformer2DModel.joint_attention_dim",description:`<strong>joint_attention_dim</strong> (<code>int</code>, defaults to <code>4096</code>) &#x2014;
The number of dimensions to use for the joint attention (embedding/channel dimension of
<code>encoder_hidden_states</code>).`,name:"joint_attention_dim"},{anchor:"diffusers.ChromaTransformer2DModel.axes_dims_rope",description:`<strong>axes_dims_rope</strong> (<code>Tuple[int]</code>, defaults to <code>(16, 56, 56)</code>) &#x2014;
The dimensions to use for the rotary positional embeddings.`,name:"axes_dims_rope"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/transformers/transformer_chroma.py#L370"}}),g=new X({props:{name:"forward",anchor:"diffusers.ChromaTransformer2DModel.forward",parameters:[{name:"hidden_states",val:": Tensor"},{name:"encoder_hidden_states",val:": Tensor = None"},{name:"timestep",val:": LongTensor = None"},{name:"img_ids",val:": Tensor = None"},{name:"txt_ids",val:": Tensor = None"},{name:"attention_mask",val:": Tensor = None"},{name:"joint_attention_kwargs",val:": typing.Optional[typing.Dict[str, typing.Any]] = None"},{name:"controlnet_block_samples",val:" = None"},{name:"controlnet_single_block_samples",val:" = None"},{name:"return_dict",val:": bool = True"},{name:"controlnet_blocks_repeat",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.ChromaTransformer2DModel.forward.hidden_states",description:`<strong>hidden_states</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, image_sequence_length, in_channels)</code>) &#x2014;
Input <code>hidden_states</code>.`,name:"hidden_states"},{anchor:"diffusers.ChromaTransformer2DModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, text_sequence_length, joint_attention_dim)</code>) &#x2014;
Conditional embeddings (embeddings computed from the input conditions such as prompts) to use.`,name:"encoder_hidden_states"},{anchor:"diffusers.ChromaTransformer2DModel.forward.timestep",description:`<strong>timestep</strong> ( <code>torch.LongTensor</code>) &#x2014;
Used to indicate denoising step.`,name:"timestep"},{anchor:"diffusers.ChromaTransformer2DModel.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.ChromaTransformer2DModel.forward.joint_attention_kwargs",description:`<strong>joint_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:"joint_attention_kwargs"},{anchor:"diffusers.ChromaTransformer2DModel.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_chroma.py#L476",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>
`}}),T=new se({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/chroma_transformer.md"}}),{c(){i=d("meta"),j=r(),$=d("p"),L=r(),C(h.$$.fragment),N=r(),u=d("p"),u.innerHTML=B,z=r(),C(_.$$.fragment),E=r(),o=d("div"),C(p.$$.fragment),R=r(),b=d("p"),b.textContent=J,U=r(),v=d("p"),v.innerHTML=K,V=r(),l=d("div"),C(g.$$.fragment),G=r(),x=d("p"),x.innerHTML=Q,H=r(),C(T.$$.fragment),A=r(),D=d("p"),this.h()},l(e){const t=re("svelte-u9bgzb",document.head);i=m(t,"META",{name:!0,content:!0}),t.forEach(n),j=s(e),$=m(e,"P",{}),q($).forEach(n),L=s(e),M(h.$$.fragment,e),N=s(e),u=m(e,"P",{"data-svelte-h":!0}),F(u)!=="svelte-1oll8n3"&&(u.innerHTML=B),z=s(e),M(_.$$.fragment,e),E=s(e),o=m(e,"DIV",{class:!0});var f=q(o);M(p.$$.fragment,f),R=s(f),b=m(f,"P",{"data-svelte-h":!0}),F(b)!=="svelte-x7vpty"&&(b.textContent=J),U=s(f),v=m(f,"P",{"data-svelte-h":!0}),F(v)!=="svelte-140bfqy"&&(v.innerHTML=K),V=s(f),l=m(f,"DIV",{class:!0});var O=q(l);M(g.$$.fragment,O),G=s(O),x=m(O,"P",{"data-svelte-h":!0}),F(x)!=="svelte-4l0nim"&&(x.innerHTML=Q),O.forEach(n),f.forEach(n),H=s(e),M(T.$$.fragment,e),A=s(e),D=m(e,"P",{}),q(D).forEach(n),this.h()},h(){S(i,"name","hf:doc:metadata"),S(i,"content",ie),S(l,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),S(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){c(document.head,i),a(e,j,t),a(e,$,t),a(e,L,t),y(h,e,t),a(e,N,t),a(e,u,t),a(e,z,t),y(_,e,t),a(e,E,t),a(e,o,t),y(p,o,null),c(o,R),c(o,b),c(o,U),c(o,v),c(o,V),c(o,l),y(g,l,null),c(l,G),c(l,x),a(e,H,t),y(T,e,t),a(e,A,t),a(e,D,t),I=!0},p:ee,i(e){I||(w(h.$$.fragment,e),w(_.$$.fragment,e),w(p.$$.fragment,e),w(g.$$.fragment,e),w(T.$$.fragment,e),I=!0)},o(e){k(h.$$.fragment,e),k(_.$$.fragment,e),k(p.$$.fragment,e),k(g.$$.fragment,e),k(T.$$.fragment,e),I=!1},d(e){e&&(n(j),n($),n(L),n(N),n(u),n(z),n(E),n(o),n(H),n(A),n(D)),n(i),P(h,e),P(_,e),P(p),P(g),P(T,e)}}}const ie='{"title":"ChromaTransformer2DModel","local":"chromatransformer2dmodel","sections":[{"title":"ChromaTransformer2DModel","local":"diffusers.ChromaTransformer2DModel","sections":[],"depth":2}],"depth":1}';function de(W){return te(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class he extends ne{constructor(i){super(),oe(this,i,de,ae,Z,{})}}export{he as component};
