Buckets:
| import{s as Z,n as ee,o as te}from"../chunks/scheduler.8c3d61f6.js";import{S as ne,i as oe,g as i,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.634d8861.js";import{H as Y,E as se}from"../chunks/getInferenceSnippets.ea1775db.js";function ae(W){let d,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/pr_12403/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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| 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>) — | |
| The dimensions to use for the rotary positional embeddings.`,name:"axes_dims_rope"}],source:"https://github.com/huggingface/diffusers/blob/vr_12403/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>) — | |
| 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>) — | |
| 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>) — | |
| Used to indicate denoising step.`,name:"timestep"},{anchor:"diffusers.ChromaTransformer2DModel.forward.block_controlnet_hidden_states",description:`<strong>block_controlnet_hidden_states</strong> — (<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>) — | |
| 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>) — | |
| 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/vr_12403/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(){d=i("meta"),j=r(),$=i("p"),L=r(),C(h.$$.fragment),N=r(),u=i("p"),u.innerHTML=B,z=r(),C(_.$$.fragment),E=r(),o=i("div"),C(p.$$.fragment),R=r(),b=i("p"),b.textContent=J,U=r(),v=i("p"),v.innerHTML=K,V=r(),l=i("div"),C(g.$$.fragment),G=r(),x=i("p"),x.innerHTML=Q,H=r(),C(T.$$.fragment),A=r(),D=i("p"),this.h()},l(e){const t=re("svelte-u9bgzb",document.head);d=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-41znya"&&(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(d,"name","hf:doc:metadata"),S(d,"content",de),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,d),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(d),P(h,e),P(_,e),P(p),P(g),P(T,e)}}}const de='{"title":"ChromaTransformer2DModel","local":"chromatransformer2dmodel","sections":[{"title":"ChromaTransformer2DModel","local":"diffusers.ChromaTransformer2DModel","sections":[],"depth":2}],"depth":1}';function ie(W){return te(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class he extends ne{constructor(d){super(),oe(this,d,ie,ae,Z,{})}}export{he as component}; | |
Xet Storage Details
- Size:
- 9.73 kB
- Xet hash:
- 66836aceeb0bda7d224c7690ddf641380913ac6886e1e73279787835aecbdf73
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.