Skip to content

Commit 4ad81b1

Browse files
committed
add bria
1 parent 08dc23e commit 4ad81b1

File tree

16 files changed

+1817
-1
lines changed

16 files changed

+1817
-1
lines changed

docs/diffusers/_toctree.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@
247247
title: AllegroTransformer3DModel
248248
- local: api/models/aura_flow_transformer2d
249249
title: AuraFlowTransformer2DModel
250+
- local: api/models/bria_transformer
251+
title: BriaTransformer2DModel
250252
- local: api/models/chroma_transformer
251253
title: ChromaTransformer2DModel
252254
- local: api/models/cogvideox_transformer3d
@@ -369,6 +371,8 @@
369371
title: AutoPipeline
370372
- local: api/pipelines/blip_diffusion
371373
title: BLIP-Diffusion
374+
- local: api/pipelines/bria_3_2
375+
title: Bria 3.2
372376
- local: api/pipelines/chroma
373377
title: Chroma
374378
- local: api/pipelines/cogvideox
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4+
the License. You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
9+
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10+
specific language governing permissions and limitations under the License.
11+
-->
12+
13+
# BriaTransformer2DModel
14+
15+
A modified flux Transformer model from [Bria](https://huggingface.co/briaai/BRIA-3.2)
16+
17+
::: BriaTransformer2DModel
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4+
the License. You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
9+
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10+
specific language governing permissions and limitations under the License.
11+
-->
12+
13+
# Bria 3.2
14+
15+
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.
16+
In addition to being built entirely on licensed data, 3.2 provides several advantages for enterprise and commercial use:
17+
18+
- Efficient Compute - the model is X3 smaller than the equivalent models in the market (4B parameters vs 12B parameters other open source models)
19+
- Architecture Consistency: Same architecture as 3.1—ideal for users looking to upgrade without disruption.
20+
- Fine-tuning Speedup: 2x faster fine-tuning on L40S and A100.
21+
22+
Original model checkpoints for Bria 3.2 can be found [here](https://huggingface.co/briaai/BRIA-3.2).
23+
Github repo for Bria 3.2 can be found [here](https://github.com/Bria-AI/BRIA-3.2).
24+
25+
If you want to learn more about the Bria platform, and get free traril access, please visit [bria.ai](https://bria.ai).
26+
27+
28+
## Usage
29+
30+
_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._
31+
32+
Use the command below to log in:
33+
34+
```bash
35+
hf auth login
36+
```
37+
38+
39+
::: BriaPipeline

mindone/diffusers/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"AutoencoderOobleck",
7171
"AutoencoderTiny",
7272
"AutoModel",
73+
"BriaTransformer2DModel",
7374
"ChromaTransformer2DModel",
7475
"CogVideoXTransformer3DModel",
7576
"CogView3PlusTransformer2DModel",
@@ -160,6 +161,7 @@
160161
"AutoPipelineForText2Image",
161162
"BlipDiffusionControlNetPipeline",
162163
"BlipDiffusionPipeline",
164+
"BriaPipeline",
163165
"ChromaImg2ImgPipeline",
164166
"ChromaPipeline",
165167
"CLIPImageProjection",
@@ -442,6 +444,7 @@
442444
AutoencoderOobleck,
443445
AutoencoderTiny,
444446
AutoModel,
447+
BriaTransformer2DModel,
445448
ChromaTransformer2DModel,
446449
CogVideoXTransformer3DModel,
447450
CogView3PlusTransformer2DModel,
@@ -544,6 +547,7 @@
544547
AutoPipelineForText2Image,
545548
BlipDiffusionControlNetPipeline,
546549
BlipDiffusionPipeline,
550+
BriaPipeline,
547551
ChromaImg2ImgPipeline,
548552
ChromaPipeline,
549553
CLIPImageProjection,

mindone/diffusers/hooks/_helpers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def _register_attention_processors_metadata():
144144
def _register_transformer_blocks_metadata():
145145
from ..models.attention import BasicTransformerBlock
146146
from ..models.transformers.cogvideox_transformer_3d import CogVideoXBlock
147+
from ..models.transformers.transformer_bria import BriaTransformerBlock
147148
from ..models.transformers.transformer_cogview4 import CogView4TransformerBlock
148149
from ..models.transformers.transformer_flux import FluxSingleTransformerBlock, FluxTransformerBlock
149150
from ..models.transformers.transformer_hunyuan_video import (
@@ -166,6 +167,13 @@ def _register_transformer_blocks_metadata():
166167
return_encoder_hidden_states_index=None,
167168
),
168169
)
170+
TransformerBlockRegistry.register(
171+
model_class=BriaTransformerBlock,
172+
metadata=TransformerBlockMetadata(
173+
return_hidden_states_index=0,
174+
return_encoder_hidden_states_index=None,
175+
),
176+
)
169177

170178
# CogVideoX
171179
TransformerBlockRegistry.register(

mindone/diffusers/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"transformers.t5_film_transformer": ["T5FilmDecoder"],
7070
"transformers.transformer_2d": ["Transformer2DModel"],
7171
"transformers.transformer_allegro": ["AllegroTransformer3DModel"],
72+
"transformers.transformer_bria": ["BriaTransformer2DModel"],
7273
"transformers.transformer_chroma": ["ChromaTransformer2DModel"],
7374
"transformers.transformer_cogview3plus": ["CogView3PlusTransformer2DModel"],
7475
"transformers.transformer_cogview4": ["CogView4Transformer2DModel"],
@@ -141,6 +142,7 @@
141142
from .transformers import (
142143
AllegroTransformer3DModel,
143144
AuraFlowTransformer2DModel,
145+
BriaTransformer2DModel,
144146
ChromaTransformer2DModel,
145147
CogVideoXTransformer3DModel,
146148
CogView3PlusTransformer2DModel,

mindone/diffusers/models/transformers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from .t5_film_transformer import T5FilmDecoder
1616
from .transformer_2d import Transformer2DModel
1717
from .transformer_allegro import AllegroTransformer3DModel
18+
from .transformer_bria import BriaTransformer2DModel
1819
from .transformer_chroma import ChromaTransformer2DModel
1920
from .transformer_cogview3plus import CogView3PlusTransformer2DModel
2021
from .transformer_cogview4 import CogView4Transformer2DModel

0 commit comments

Comments
 (0)