Skip to content

Bria 3 2 pipeline #12010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
00dfe98
Add Bria model and pipeline to diffusers
galbria Jul 28, 2025
7808ee0
with working tests
galbria Jul 29, 2025
c58267e
style and quality pass
galbria Jul 29, 2025
4208a09
Merge branch 'main' of https://github.com/huggingface/diffusers into …
galbria Jul 29, 2025
7c1cf7e
adding docs
galbria Jul 29, 2025
92671ab
add to overview
galbria Jul 29, 2025
649767f
Merge branch 'main' into bria_3_2_pipeline
galbria Jul 30, 2025
be29631
fixes from "make fix-copies"
galbria Jul 30, 2025
eb1a3f4
Merge branch 'bria_3_2_pipeline' of https://github.com/galbria/diffus…
galbria Jul 30, 2025
88c8e42
Refactor transformer_bria.py and pipeline_bria.py: Introduce new Embe…
galbria Jul 30, 2025
6cefe44
remove redundent and duplicates tests and fix bf16
galbria Jul 31, 2025
770e162
Merge branch 'main' into bria_3_2_pipeline
galbria Jul 31, 2025
f27d122
style fixes
galbria Jul 31, 2025
f48d072
Merge branch 'bria_3_2_pipeline' of https://github.com/galbria/diffus…
galbria Jul 31, 2025
e7b6db5
Merge branch 'main' into bria_3_2_pipeline
galbria Aug 1, 2025
7091624
Merge branch 'main' into bria_3_2_pipeline
galbria Aug 3, 2025
7b4b8d1
Merge branch 'main' into bria_3_2_pipeline
galbria Aug 5, 2025
a423221
small doc update
galbria Aug 5, 2025
63c9078
Merge branch 'bria_3_2_pipeline' of https://github.com/galbria/diffus…
galbria Aug 5, 2025
6f656e7
Merge branch 'main' into bria_3_2_pipeline
galbria Aug 7, 2025
1af2dc0
Merge branch 'main' into bria_3_2_pipeline
linoytsaban Aug 7, 2025
5bfd733
Enhance Bria 3.2 documentation and implementation
galbria Aug 7, 2025
081ac14
Merge branch 'bria_3_2_pipeline' of https://github.com/galbria/diffus…
galbria Aug 7, 2025
83e3f3a
Merge branch 'main' into bria_3_2_pipeline
galbria Aug 10, 2025
d2fba0a
Refactor Bria model components and update documentation
galbria Aug 10, 2025
a121f58
Merge branch 'bria_3_2_pipeline' of https://github.com/galbria/diffus…
galbria Aug 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/source/en/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@
title: AllegroTransformer3DModel
- local: api/models/aura_flow_transformer2d
title: AuraFlowTransformer2DModel
- local: api/models/bria_transformer2d
title: BriaTransformer2DModel
- local: api/models/chroma_transformer
title: ChromaTransformer2DModel
- local: api/models/cogvideox_transformer3d
Expand Down Expand Up @@ -454,6 +456,8 @@
title: AutoPipeline
- local: api/pipelines/blip_diffusion
title: BLIP-Diffusion
- local: api/pipelines/bria_3_2
title: Bria 3.2
- local: api/pipelines/chroma
title: Chroma
- local: api/pipelines/cogvideox
Expand Down
19 changes: 19 additions & 0 deletions docs/source/en/api/models/bria_transformer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--Copyright 2025 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# BriaTransformer2DModel

A modified flux Transformer model from [Bria](https://huggingface.co/briaai/BRIA-3.2)

## BriaTransformer2DModel

[[autodoc]] BriaTransformer2DModel
44 changes: 44 additions & 0 deletions docs/source/en/api/pipelines/bria_3_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--Copyright 2025 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Bria 3.2

Bria 3.2 is the next-generation commercial-ready text-to-image model. With just 4 billion parameters, it provides exceptional aesthetics and text rendering, evaluated to provide on par results to leading open-source models, and outperforming other licensed models.
In addition to being built entirely on licensed data, 3.2 provides several advantages for enterprise and commercial use:

- Efficient Compute - the model is X3 smaller than the equivalent models in the market (4B parameters vs 12B parameters other open source models)
- Architecture Consistency: Same architecture as 3.1—ideal for users looking to upgrade without disruption.
- Fine-tuning Speedup: 2x faster fine-tuning on L40S and A100.

Original model checkpoints for Bria 3.2 can be found [here](https://huggingface.co/briaai/BRIA-3.2).
Github repo for Bria 3.2 can be found [here](https://github.com/Bria-AI/BRIA-3.2).

If you want to learn more about the Bria platform, and get free traril access, please visit [bria.ai](https://bria.ai).


## Usage

_As the model is gated, before using it with diffusers you first need to go to the [Bria 3.2 Hugging Face page](https://huggingface.co/briaai/BRIA-3.2), fill in the form and accept the gate. Once you are in, you need to login so that your system knows you’ve accepted the gate._

Use the command below to log in:

```bash
hf auth login
```


## BriaPipeline

[[autodoc]] BriaPipeline
- all
- __call__

1 change: 1 addition & 0 deletions docs/source/en/api/pipelines/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The table below lists all the pipelines currently available in 🤗 Diffusers an
| [AudioLDM2](audioldm2) | text2audio |
| [AuraFlow](auraflow) | text2image |
| [BLIP Diffusion](blip_diffusion) | text2image |
| [Bria 3.2](bria_3_2) | text2image |
| [CogVideoX](cogvideox) | text2video |
| [Consistency Models](consistency_models) | unconditional image generation |
| [ControlNet](controlnet) | text2image, image2image, inpainting |
Expand Down
4 changes: 4 additions & 0 deletions src/diffusers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
"AutoencoderOobleck",
"AutoencoderTiny",
"AutoModel",
"BriaTransformer2DModel",
"CacheMixin",
"ChromaTransformer2DModel",
"CogVideoXTransformer3DModel",
Expand Down Expand Up @@ -397,6 +398,7 @@
"AuraFlowPipeline",
"BlipDiffusionControlNetPipeline",
"BlipDiffusionPipeline",
"BriaPipeline",
"ChromaImg2ImgPipeline",
"ChromaPipeline",
"CLIPImageProjection",
Expand Down Expand Up @@ -843,6 +845,7 @@
AutoencoderOobleck,
AutoencoderTiny,
AutoModel,
BriaTransformer2DModel,
CacheMixin,
ChromaTransformer2DModel,
CogVideoXTransformer3DModel,
Expand Down Expand Up @@ -1034,6 +1037,7 @@
AudioLDM2UNet2DConditionModel,
AudioLDMPipeline,
AuraFlowPipeline,
BriaPipeline,
ChromaImg2ImgPipeline,
ChromaPipeline,
CLIPImageProjection,
Expand Down
8 changes: 8 additions & 0 deletions src/diffusers/hooks/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def _register_attention_processors_metadata():
def _register_transformer_blocks_metadata():
from ..models.attention import BasicTransformerBlock
from ..models.transformers.cogvideox_transformer_3d import CogVideoXBlock
from ..models.transformers.transformer_bria import BriaTransformerBlock
from ..models.transformers.transformer_cogview4 import CogView4TransformerBlock
from ..models.transformers.transformer_flux import FluxSingleTransformerBlock, FluxTransformerBlock
from ..models.transformers.transformer_hunyuan_video import (
Expand All @@ -165,6 +166,13 @@ def _register_transformer_blocks_metadata():
return_encoder_hidden_states_index=None,
),
)
TransformerBlockRegistry.register(
model_class=BriaTransformerBlock,
metadata=TransformerBlockMetadata(
return_hidden_states_index=0,
return_encoder_hidden_states_index=None,
),
)

# CogVideoX
TransformerBlockRegistry.register(
Expand Down
2 changes: 2 additions & 0 deletions src/diffusers/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
_import_structure["transformers.t5_film_transformer"] = ["T5FilmDecoder"]
_import_structure["transformers.transformer_2d"] = ["Transformer2DModel"]
_import_structure["transformers.transformer_allegro"] = ["AllegroTransformer3DModel"]
_import_structure["transformers.transformer_bria"] = ["BriaTransformer2DModel"]
_import_structure["transformers.transformer_chroma"] = ["ChromaTransformer2DModel"]
_import_structure["transformers.transformer_cogview3plus"] = ["CogView3PlusTransformer2DModel"]
_import_structure["transformers.transformer_cogview4"] = ["CogView4Transformer2DModel"]
Expand Down Expand Up @@ -158,6 +159,7 @@
from .transformers import (
AllegroTransformer3DModel,
AuraFlowTransformer2DModel,
BriaTransformer2DModel,
ChromaTransformer2DModel,
CogVideoXTransformer3DModel,
CogView3PlusTransformer2DModel,
Expand Down
1 change: 1 addition & 0 deletions src/diffusers/models/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .t5_film_transformer import T5FilmDecoder
from .transformer_2d import Transformer2DModel
from .transformer_allegro import AllegroTransformer3DModel
from .transformer_bria import BriaTransformer2DModel
from .transformer_chroma import ChromaTransformer2DModel
from .transformer_cogview3plus import CogView3PlusTransformer2DModel
from .transformer_cogview4 import CogView4Transformer2DModel
Expand Down
Loading