Buckets:
| import{s as oe,n as ne,o as te}from"../chunks/scheduler.53228c21.js";import{S as re,i as se,e as i,s as r,c as M,h as ae,a as l,d as n,b as s,f as O,g as D,j as W,k as G,l as c,m as a,n as F,t as w,o as k,p as y}from"../chunks/index.cac5d66a.js";import{C as de}from"../chunks/CopyLLMTxtMenu.5ac9ab94.js";import{D as Z}from"../chunks/Docstring.8a316450.js";import{H as ee,E as ie}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.92b2cd9d.js";function le(J){let d,N,j,P,u,z,p,C,_,K='A Transformer model for image-like data from <a href="https://blackforestlabs.ai/announcing-black-forest-labs/" rel="nofollow">Flux</a>.',E,h,H,t,g,R,T,Q="The Transformer model introduced in Flux.",U,$,X='Reference: <a href="https://blackforestlabs.ai/announcing-black-forest-labs/" rel="nofollow">https://blackforestlabs.ai/announcing-black-forest-labs/</a>',V,m,x,B,v,Y='The <a href="/docs/diffusers/pr_13813/en/api/models/flux_transformer#diffusers.FluxTransformer2DModel">FluxTransformer2DModel</a> forward method.',A,b,I,L,S;return u=new de({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),p=new ee({props:{title:"FluxTransformer2DModel",local:"fluxtransformer2dmodel",headingTag:"h1"}}),h=new ee({props:{title:"FluxTransformer2DModel",local:"diffusers.FluxTransformer2DModel",headingTag:"h2"}}),g=new Z({props:{name:"class diffusers.FluxTransformer2DModel",anchor:"diffusers.FluxTransformer2DModel",parameters:[{name:"patch_size",val:": int = 1"},{name:"in_channels",val:": int = 64"},{name:"out_channels",val:": int | None = 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:"pooled_projection_dim",val:": int = 768"},{name:"guidance_embeds",val:": bool = False"},{name:"axes_dims_rope",val:": tuple = (16, 56, 56)"}],parametersDescription:[{anchor:"diffusers.FluxTransformer2DModel.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.FluxTransformer2DModel.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.FluxTransformer2DModel.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.FluxTransformer2DModel.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.FluxTransformer2DModel.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.FluxTransformer2DModel.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.FluxTransformer2DModel.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.FluxTransformer2DModel.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.FluxTransformer2DModel.pooled_projection_dim",description:`<strong>pooled_projection_dim</strong> (<code>int</code>, defaults to <code>768</code>) — | |
| The number of dimensions to use for the pooled projection.`,name:"pooled_projection_dim"},{anchor:"diffusers.FluxTransformer2DModel.guidance_embeds",description:`<strong>guidance_embeds</strong> (<code>bool</code>, defaults to <code>False</code>) — | |
| Whether to use guidance embeddings for guidance-distilled variant of the model.`,name:"guidance_embeds"},{anchor:"diffusers.FluxTransformer2DModel.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_13813/src/diffusers/models/transformers/transformer_flux.py#L525"}}),x=new Z({props:{name:"forward",anchor:"diffusers.FluxTransformer2DModel.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:"joint_attention_kwargs",val:": dict[str, typing.Any] | None = 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.FluxTransformer2DModel.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.FluxTransformer2DModel.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.FluxTransformer2DModel.forward.pooled_projections",description:`<strong>pooled_projections</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, projection_dim)</code>) — Embeddings projected | |
| from the embeddings of input conditions.`,name:"pooled_projections"},{anchor:"diffusers.FluxTransformer2DModel.forward.timestep",description:`<strong>timestep</strong> ( <code>torch.LongTensor</code>) — | |
| Used to indicate denoising step.`,name:"timestep"},{anchor:"diffusers.FluxTransformer2DModel.forward.img_ids",description:`<strong>img_ids</strong> (<code>torch.Tensor</code>) — | |
| Image position ids used to compute the rotary positional embeddings.`,name:"img_ids"},{anchor:"diffusers.FluxTransformer2DModel.forward.txt_ids",description:`<strong>txt_ids</strong> (<code>torch.Tensor</code>) — | |
| Text position ids used to compute the rotary positional embeddings.`,name:"txt_ids"},{anchor:"diffusers.FluxTransformer2DModel.forward.guidance",description:`<strong>guidance</strong> (<code>torch.Tensor</code>, <em>optional</em>) — | |
| Guidance scale embedding used for guidance-distilled variants of the model.`,name:"guidance"},{anchor:"diffusers.FluxTransformer2DModel.forward.controlnet_block_samples",description:`<strong>controlnet_block_samples</strong> (<code>list</code> of <code>torch.Tensor</code>, <em>optional</em>) — | |
| A list of tensors that if specified are added to the residuals of transformer blocks.`,name:"controlnet_block_samples"},{anchor:"diffusers.FluxTransformer2DModel.forward.controlnet_single_block_samples",description:`<strong>controlnet_single_block_samples</strong> (<code>list</code> of <code>torch.Tensor</code>, <em>optional</em>) — | |
| A list of tensors that if specified are added to the residuals of single transformer blocks.`,name:"controlnet_single_block_samples"},{anchor:"diffusers.FluxTransformer2DModel.forward.controlnet_blocks_repeat",description:`<strong>controlnet_blocks_repeat</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) — | |
| Whether to repeat the controlnet block samples across all transformer blocks.`,name:"controlnet_blocks_repeat"},{anchor:"diffusers.FluxTransformer2DModel.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.FluxTransformer2DModel.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_13813/src/diffusers/models/transformers/transformer_flux.py#L637",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 ie({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/flux_transformer.md"}}),{c(){d=i("meta"),N=r(),j=i("p"),P=r(),M(u.$$.fragment),z=r(),M(p.$$.fragment),C=r(),_=i("p"),_.innerHTML=K,E=r(),M(h.$$.fragment),H=r(),t=i("div"),M(g.$$.fragment),R=r(),T=i("p"),T.textContent=Q,U=r(),$=i("p"),$.innerHTML=X,V=r(),m=i("div"),M(x.$$.fragment),B=r(),v=i("p"),v.innerHTML=Y,A=r(),M(b.$$.fragment),I=r(),L=i("p"),this.h()},l(e){const o=ae("svelte-u9bgzb",document.head);d=l(o,"META",{name:!0,content:!0}),o.forEach(n),N=s(e),j=l(e,"P",{}),O(j).forEach(n),P=s(e),D(u.$$.fragment,e),z=s(e),D(p.$$.fragment,e),C=s(e),_=l(e,"P",{"data-svelte-h":!0}),W(_)!=="svelte-e6h9db"&&(_.innerHTML=K),E=s(e),D(h.$$.fragment,e),H=s(e),t=l(e,"DIV",{class:!0});var f=O(t);D(g.$$.fragment,f),R=s(f),T=l(f,"P",{"data-svelte-h":!0}),W(T)!=="svelte-19p4ty0"&&(T.textContent=Q),U=s(f),$=l(f,"P",{"data-svelte-h":!0}),W($)!=="svelte-mxgguy"&&($.innerHTML=X),V=s(f),m=l(f,"DIV",{class:!0});var q=O(m);D(x.$$.fragment,q),B=s(q),v=l(q,"P",{"data-svelte-h":!0}),W(v)!=="svelte-1csfb2"&&(v.innerHTML=Y),q.forEach(n),f.forEach(n),A=s(e),D(b.$$.fragment,e),I=s(e),L=l(e,"P",{}),O(L).forEach(n),this.h()},h(){G(d,"name","hf:doc:metadata"),G(d,"content",ce),G(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),G(t,"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,o){c(document.head,d),a(e,N,o),a(e,j,o),a(e,P,o),F(u,e,o),a(e,z,o),F(p,e,o),a(e,C,o),a(e,_,o),a(e,E,o),F(h,e,o),a(e,H,o),a(e,t,o),F(g,t,null),c(t,R),c(t,T),c(t,U),c(t,$),c(t,V),c(t,m),F(x,m,null),c(m,B),c(m,v),a(e,A,o),F(b,e,o),a(e,I,o),a(e,L,o),S=!0},p:ne,i(e){S||(w(u.$$.fragment,e),w(p.$$.fragment,e),w(h.$$.fragment,e),w(g.$$.fragment,e),w(x.$$.fragment,e),w(b.$$.fragment,e),S=!0)},o(e){k(u.$$.fragment,e),k(p.$$.fragment,e),k(h.$$.fragment,e),k(g.$$.fragment,e),k(x.$$.fragment,e),k(b.$$.fragment,e),S=!1},d(e){e&&(n(N),n(j),n(P),n(z),n(C),n(_),n(E),n(H),n(t),n(A),n(I),n(L)),n(d),y(u,e),y(p,e),y(h,e),y(g),y(x),y(b,e)}}}const ce='{"title":"FluxTransformer2DModel","local":"fluxtransformer2dmodel","sections":[{"title":"FluxTransformer2DModel","local":"diffusers.FluxTransformer2DModel","sections":[],"depth":2}],"depth":1}';function me(J){return te(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ge extends re{constructor(d){super(),se(this,d,me,le,oe,{})}}export{ge as component}; | |
Xet Storage Details
- Size:
- 12.2 kB
- Xet hash:
- de8e4e877037a733635fc99999ae6133532080dc8a3b50fafbca1edb66ee2010
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.