Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
42 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
3890979
Merge branch 'main' into bria_3_2_pipeline
galbria Aug 14, 2025
d7dd8b3
Update Bria model reference in documentation to reflect new file nami…
galbria Aug 15, 2025
4dd04ba
Merge branch 'bria_3_2_pipeline' of https://github.com/galbria/diffus…
galbria Aug 15, 2025
36b0133
Update docs/source/en/_toctree.yml
a-r-r-o-w Aug 17, 2025
51a3bdc
Merge branch 'main' into bria_3_2_pipeline
galbria Aug 17, 2025
9c6d9dd
Refactor BriaPipeline to inherit from DiffusionPipeline instead of Fl…
galbria Aug 18, 2025
dd9dfd8
Merge branch 'bria_3_2_pipeline' of https://github.com/galbria/diffus…
galbria Aug 18, 2025
3dab480
Merge branch 'main' into bria_3_2_pipeline
galbria Aug 18, 2025
f702292
move the __call__ func to the end of file
galbria Aug 19, 2025
4331603
Merge branch 'bria_3_2_pipeline' of https://github.com/galbria/diffus…
galbria Aug 19, 2025
1456f5d
Merge branch 'main' into bria_3_2_pipeline
galbria Aug 19, 2025
4430fe9
Update BriaPipeline example to use bfloat16 for precision sensitivity…
galbria Aug 20, 2025
d20b9d8
Merge branch 'bria_3_2_pipeline' of https://github.com/galbria/diffus…
galbria Aug 20, 2025
f9d5e46
Merge branch 'main' into bria_3_2_pipeline
galbria Aug 20, 2025
3b847ab
make style && make quality && make fix-copiessource
galbria Aug 20, 2025
135a3aa
Merge branch 'bria_3_2_pipeline' of https://github.com/galbria/diffus…
galbria Aug 20, 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 @@ -450,6 +452,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
48 changes: 48 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,48 @@
<!--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).


## Inference
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think we can remove this subsection entirely. The inference example will directly be rendered from the pipeline when autodoc creates the diffusers docs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I don't think this is a good idea for gated repos, first time users or people not familiar with them will get an error while expecting to work which is not a good user experience.

Not strongly opinioned about this so if you think is not necessary I'm fine with it.


The Diffusers version of Chroma is based on the [`unlocked-v37`](https://huggingface.co/lodestones/Chroma/blob/main/chroma-unlocked-v37.safetensors) version of the original model, which is available in the [Chroma repository](https://huggingface.co/lodestones/Chroma).

```python
import torch
from diffusers import BriaPipeline

pipe = BriaPipeline.from_pretrained("briaai/BRIA-3.2",revision="bria_3_2_diffusers", torch_dtype=torch.bfloat16)
pipe.enable_model_cpu_offload()

prompt = "A high-fashion close-up portrait of a blonde woman in clear sunglasses. The image uses a bold teal and red color split for dramatic lighting. The background is a simple teal-green. The photo is sharp and well-composed, and is designed for viewing with anaglyph 3D glasses for optimal effect. It looks professionally done."

image = pipe(prompt).images[0]
image.save("bria.png")
```


## 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 @@ -179,6 +179,7 @@
"AutoencoderOobleck",
"AutoencoderTiny",
"AutoModel",
"BriaTransformer2DModel",
"CacheMixin",
"ChromaTransformer2DModel",
"CogVideoXTransformer3DModel",
Expand Down Expand Up @@ -392,6 +393,7 @@
"AuraFlowPipeline",
"BlipDiffusionControlNetPipeline",
"BlipDiffusionPipeline",
"BriaPipeline",
"ChromaImg2ImgPipeline",
"ChromaPipeline",
"CLIPImageProjection",
Expand Down Expand Up @@ -835,6 +837,7 @@
AutoencoderOobleck,
AutoencoderTiny,
AutoModel,
BriaTransformer2DModel,
CacheMixin,
ChromaTransformer2DModel,
CogVideoXTransformer3DModel,
Expand Down Expand Up @@ -1023,6 +1026,7 @@
AudioLDM2UNet2DConditionModel,
AudioLDMPipeline,
AuraFlowPipeline,
BriaPipeline,
ChromaImg2ImgPipeline,
ChromaPipeline,
CLIPImageProjection,
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 @@ -75,6 +75,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 @@ -155,6 +156,7 @@
from .transformers import (
AllegroTransformer3DModel,
AuraFlowTransformer2DModel,
BriaTransformer2DModel,
ChromaTransformer2DModel,
CogVideoXTransformer3DModel,
CogView3PlusTransformer2DModel,
Expand Down
1 change: 0 additions & 1 deletion src/diffusers/models/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,6 @@ def apply_rotary_emb(
x_rotated = torch.cat([-x_imag, x_real], dim=-1)
else:
raise ValueError(f"`use_real_unbind_dim={use_real_unbind_dim}` but should be -1 or -2.")

out = (x.float() * cos + x_rotated.float() * sin).to(x.dtype)

return out
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