Buckets:
| import"../chunks/DsnmJJEf.js";import{i as T,h as x,C as w,H as c,D as m,E as D,s as M}from"../chunks/BLbO27j4.js";import{p as y,o as B,s as e,f as F,a as f,b as k,c as h,d as _,r as p,n as z}from"../chunks/jDjavuwI.js";const L='{"title":"BriaFibo2Transformer2DModel","local":"briafibo2transformer2dmodel","sections":[{"title":"BriaFibo2Transformer2DModel","local":"diffusers.BriaFibo2Transformer2DModel","sections":[],"depth":2}],"depth":1}';var N=_('<meta name="hf:doc:metadata"/>'),E=_('<p></p> <!> <!> <p>The single-stream transformer of <a href="https://huggingface.co/briaai" rel="nofollow">Bria</a>’s Fibo 2.0, built on the Z-Image block. Its text conditioning comes from Qwen3-VL in two ways: a Perceiver resampler turns the text encoder’s hidden states into gist tokens that share the stream with the image tokens, and five blocks add a gated cross-attention to their own bundle of Qwen3-VL layers. To edit, the latents of the images to edit join the stream as clean tokens, each image on its own RoPE plane.</p> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!></div></div> <!> <p></p>',1);function V(u,g){y(g,!1),B(()=>{new URLSearchParams(window.location.search).get("fw")}),T();var o=E();x("r5yiwm",d=>{var l=N();M(l,"content",L),f(d,l)});var r=e(F(o),2);w(r,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var a=e(r,2);c(a,{title:"BriaFibo2Transformer2DModel",local:"briafibo2transformer2dmodel",headingTag:"h1"});var n=e(a,4);c(n,{title:"BriaFibo2Transformer2DModel",local:"diffusers.BriaFibo2Transformer2DModel",headingTag:"h2"});var t=e(n,2),s=h(t);m(s,{name:"class diffusers.BriaFibo2Transformer2DModel",anchor:"diffusers.BriaFibo2Transformer2DModel",source:"https://github.com/huggingface/diffusers/blob/vr_15089/src/diffusers/models/transformers/transformer_bria_fibo2.py#L430",parameters:[{name:"in_channels",val:": int = 32"},{name:"patch_size",val:": int = 2"},{name:"dim",val:": int = 3584"},{name:"n_layers",val:": int = 44"},{name:"n_refiner_layers",val:": int = 2"},{name:"n_heads",val:": int = 28"},{name:"norm_eps",val:": float = 1e-05"},{name:"cap_feat_dim",val:": int = 7680"},{name:"injection_layer_ids",val:": tuple = (6, 14, 22, 30, 38)"},{name:"perceiver_num_layers",val:": int = 2"},{name:"min_num_gist_tokens",val:": int = 256"},{name:"max_num_gist_tokens",val:": int = 512"},{name:"gist_step",val:": int = 64"},{name:"gist_min_text_len",val:": int = 256"},{name:"gist_max_text_len",val:": int = 2048"},{name:"rope_theta",val:": float = 256.0"},{name:"t_scale",val:": float = 1000.0"},{name:"axes_dims",val:": tuple = (32, 48, 48)"},{name:"axes_lens",val:": tuple = (2048, 512, 512)"}]});var i=e(s,2),b=h(i);m(b,{name:"forward",anchor:"diffusers.BriaFibo2Transformer2DModel.forward",source:"https://github.com/huggingface/diffusers/blob/vr_15089/src/diffusers/models/transformers/transformer_bria_fibo2.py#L500",parameters:[{name:"hidden_states",val:": Tensor"},{name:"timestep",val:": Tensor"},{name:"encoder_hidden_states",val:": Tensor"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"context_latents",val:": list[torch.Tensor] | None = None"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.BriaFibo2Transformer2DModel.forward.hidden_states",description:`<strong>hidden_states</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, in_channels, height, width)</code>) — | |
| Normalized VAE latents of the image being generated.`,name:"hidden_states"},{anchor:"diffusers.BriaFibo2Transformer2DModel.forward.timestep",description:`<strong>timestep</strong> (<code>torch.Tensor</code> of shape <code>(batch_size,)</code>) — | |
| Noise level in <code>[0, 1]</code>: 1 is pure noise, 0 is a clean image.`,name:"timestep"},{anchor:"diffusers.BriaFibo2Transformer2DModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, 1 + len(injection_layer_ids), text_len, cap_feat_dim)</code>) — | |
| Text encoder features: the Perceiver’s bundle first, then one bundle per injection block.`,name:"encoder_hidden_states"},{anchor:"diffusers.BriaFibo2Transformer2DModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, text_len)</code>, <em>optional</em>) — | |
| Bool mask of the real text tokens, for a batch of prompts padded to the same length. Leave it as <code>None</code> | |
| when nothing is padded.`,name:"encoder_attention_mask"},{anchor:"diffusers.BriaFibo2Transformer2DModel.forward.context_latents",description:`<strong>context_latents</strong> (<code>list[torch.Tensor]</code>, <em>optional</em>) — | |
| Normalized VAE latents of the images to edit, one tensor of shape <code>(batch_size, in_channels, height, width)</code> per image, in order. Each image can have its own size. Their tokens condition the generation as | |
| clean tokens and are not predicted.`,name:"context_latents"},{anchor:"diffusers.BriaFibo2Transformer2DModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, defaults to <code>True</code>) — | |
| Whether to return a <a href="/docs/diffusers/pr_15089/en/api/models/sana_transformer2d#diffusers.models.modeling_outputs.Transformer2DModelOutput">Transformer2DModelOutput</a> instead of a tuple.`,name:"return_dict"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>The predicted velocity, with the shape of | |
| <code>hidden_states</code>. If <code>return_dict</code> is <code>False</code>, a tuple whose first element is that tensor.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/diffusers/pr_15089/en/api/models/sana_transformer2d#diffusers.models.modeling_outputs.Transformer2DModelOutput" | |
| >Transformer2DModelOutput</a> or <code>tuple</code></p> | |
| `}),p(i),p(t);var v=e(t,2);D(v,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/transformer_bria_fibo2.md"}),z(2),f(u,o),k()}export{V as component}; | |
Xet Storage Details
- Size:
- 6.32 kB
- Xet hash:
- ab68ac2fbc65808410a62bc874d34d15f7819c440ca304897a325ea98163ee33
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.