Skip to content

Commit 64d018c

Browse files
authored
Merge branch 'main' into add-trtquant-backend
2 parents 3f672d3 + 7993be9 commit 64d018c

File tree

18 files changed

+2131
-0
lines changed

18 files changed

+2131
-0
lines changed

docs/source/en/_toctree.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@
340340
title: AllegroTransformer3DModel
341341
- local: api/models/aura_flow_transformer2d
342342
title: AuraFlowTransformer2DModel
343+
- local: api/models/bria_transformer
344+
title: BriaTransformer2DModel
343345
- local: api/models/chroma_transformer
344346
title: ChromaTransformer2DModel
345347
- local: api/models/cogvideox_transformer3d
@@ -468,6 +470,8 @@
468470
title: AutoPipeline
469471
- local: api/pipelines/blip_diffusion
470472
title: BLIP-Diffusion
473+
- local: api/pipelines/bria_3_2
474+
title: Bria 3.2
471475
- local: api/pipelines/chroma
472476
title: Chroma
473477
- local: api/pipelines/cogvideox
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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
18+
19+
[[autodoc]] BriaTransformer2DModel
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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
40+
41+
[[autodoc]] BriaPipeline
42+
- all
43+
- __call__
44+

docs/source/en/api/pipelines/overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ The table below lists all the pipelines currently available in 🤗 Diffusers an
3737
| [AudioLDM2](audioldm2) | text2audio |
3838
| [AuraFlow](auraflow) | text2image |
3939
| [BLIP Diffusion](blip_diffusion) | text2image |
40+
| [Bria 3.2](bria_3_2) | text2image |
4041
| [CogVideoX](cogvideox) | text2video |
4142
| [Consistency Models](consistency_models) | unconditional image generation |
4243
| [ControlNet](controlnet) | text2image, image2image, inpainting |

src/diffusers/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@
194194
"AutoencoderOobleck",
195195
"AutoencoderTiny",
196196
"AutoModel",
197+
"BriaTransformer2DModel",
197198
"CacheMixin",
198199
"ChromaTransformer2DModel",
199200
"CogVideoXTransformer3DModel",
@@ -410,6 +411,7 @@
410411
"AuraFlowPipeline",
411412
"BlipDiffusionControlNetPipeline",
412413
"BlipDiffusionPipeline",
414+
"BriaPipeline",
413415
"ChromaImg2ImgPipeline",
414416
"ChromaPipeline",
415417
"CLIPImageProjection",
@@ -867,6 +869,7 @@
867869
AutoencoderOobleck,
868870
AutoencoderTiny,
869871
AutoModel,
872+
BriaTransformer2DModel,
870873
CacheMixin,
871874
ChromaTransformer2DModel,
872875
CogVideoXTransformer3DModel,
@@ -1053,6 +1056,7 @@
10531056
AudioLDM2UNet2DConditionModel,
10541057
AudioLDMPipeline,
10551058
AuraFlowPipeline,
1059+
BriaPipeline,
10561060
ChromaImg2ImgPipeline,
10571061
ChromaPipeline,
10581062
CLIPImageProjection,

src/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 (
@@ -165,6 +166,13 @@ def _register_transformer_blocks_metadata():
165166
return_encoder_hidden_states_index=None,
166167
),
167168
)
169+
TransformerBlockRegistry.register(
170+
model_class=BriaTransformerBlock,
171+
metadata=TransformerBlockMetadata(
172+
return_hidden_states_index=0,
173+
return_encoder_hidden_states_index=None,
174+
),
175+
)
168176

169177
# CogVideoX
170178
TransformerBlockRegistry.register(

src/diffusers/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
_import_structure["transformers.t5_film_transformer"] = ["T5FilmDecoder"]
7777
_import_structure["transformers.transformer_2d"] = ["Transformer2DModel"]
7878
_import_structure["transformers.transformer_allegro"] = ["AllegroTransformer3DModel"]
79+
_import_structure["transformers.transformer_bria"] = ["BriaTransformer2DModel"]
7980
_import_structure["transformers.transformer_chroma"] = ["ChromaTransformer2DModel"]
8081
_import_structure["transformers.transformer_cogview3plus"] = ["CogView3PlusTransformer2DModel"]
8182
_import_structure["transformers.transformer_cogview4"] = ["CogView4Transformer2DModel"]
@@ -158,6 +159,7 @@
158159
from .transformers import (
159160
AllegroTransformer3DModel,
160161
AuraFlowTransformer2DModel,
162+
BriaTransformer2DModel,
161163
ChromaTransformer2DModel,
162164
CogVideoXTransformer3DModel,
163165
CogView3PlusTransformer2DModel,

src/diffusers/models/transformers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from .t5_film_transformer import T5FilmDecoder
1818
from .transformer_2d import Transformer2DModel
1919
from .transformer_allegro import AllegroTransformer3DModel
20+
from .transformer_bria import BriaTransformer2DModel
2021
from .transformer_chroma import ChromaTransformer2DModel
2122
from .transformer_cogview3plus import CogView3PlusTransformer2DModel
2223
from .transformer_cogview4 import CogView4Transformer2DModel

0 commit comments

Comments
 (0)