Repository navigation
Add Bria fibo-2 - #14991
Draft
muhammadali-afridi wants to merge 1 commit into
Draft
Add Bria fibo-2#14991muhammadali-afridi wants to merge 1 commit into
muhammadali-afridi wants to merge 1 commit into
Conversation
fibo-2 is Bria's 8.1B flow-matching DiT, built on the Z-Image block and conditioned on Qwen3-VL hidden states two ways: a Perceiver resampler turns them into gist tokens that share the stream with the image tokens, and five blocks add gated cross-attention to their own bundle of Qwen3-VL layers. It uses the Flux 2 VAE. One pipeline class covers both of the model's jobs and both checkpoints: text-to-image generation, instruction editing of up to five images with an optional mask, the turbo checkpoint (4 steps, no guidance) and the guided one. - BriaFibo2Transformer2DModel, with images to edit passed as context latents - BriaFibo2Pipeline - a conversion script from the original checkpoint layout - model and pipeline tests, and docs Verified against Bria's reference implementation on an A100 and an H100. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds fibo-2, Bria's text-to-image and image-editing model.
BriaFibo2Transformer2DModel: an 8.1B flow-matching transformer with a single token stream, in the style of Z-Image. Its text encoder is Qwen3-VL-4B.context_latents. Each is patchified by the shared embedder and gets its own RoPE plane.BriaFibo2Pipeline:Two checkpoints share the pipeline:
scripts/convert_bria_fibo2_to_diffusers.pyconverts the original checkpoints.Docs and tests.
This is a draft until the weights are public. The repo ids in the docs are placeholders until then.
Verification
I compared the pipeline against Bria's reference inference code, using the original checkpoints, the same seeds and bf16:
pipe.transformer.set_attention_backend("_flash_3_varlen_hub"):make style,make qualityandmake fix-copiespass.check_copies,check_dummies,check_support_list,check_forward_call_docstringsandcheck_return_annotationspass.Open before ready for review
mask:aesthetic_scoreandpreference_scorefrom captions.Self-review notes
I ran the
self-reviewskill on the diff.Fixed:
forwarddocstring had noReturns:section, whichcheck_forward_call_docstringsflags.flash_varlen,_flash_3_varlen_hub,sage_varlen) keep the firstmask.sum()keys, so they kept the wrong ones.test_padded_batch_matches_single_promptscovers this.__call__read the first image's size beforecheck_inputshad validated it.Not fixed, on purpose:
RopeEmbedder, copied from Z-Image, builds its frequency table under a device context on first use. Z-Image skips these tests for the same reason.torch.compile(transformer)..tolist().compile_repeated_blocks) is not affected.Before submitting
self-reviewskill on the diff?Who can review?
I'll tag reviewers once the weights are public and the open items above are settled.
馃 Generated with Claude Code