Skip to content

Commit d7a1c31

Browse files
galbriakfirbria
andauthored
Fibo edit pipeline (#12930)
* Feature: Add BriaFiboEditPipeline to diffusers * Introduced BriaFiboEditPipeline class with necessary backend requirements. * Updated import structures in relevant modules to include BriaFiboEditPipeline. * Ensured compatibility with existing pipelines and type checking. * Feature: Introduce Bria Fibo Edit Pipeline * Added BriaFiboEditPipeline class for structured JSON-native image editing. * Created documentation for the new pipeline in bria_fibo_edit.md. * Updated import structures to include the new pipeline and its components. * Added unit tests for the BriaFiboEditPipeline to ensure functionality and correctness. * Enhancement: Update Bria Fibo Edit Pipeline and Documentation * Refined the Bria Fibo Edit model description for clarity and detail. * Added usage instructions for model authentication and login. * Implemented mask handling functions in the BriaFiboEditPipeline for improved image editing capabilities. * Updated unit tests to cover new mask functionalities and ensure input validation. * Adjusted example code in documentation to reflect changes in the pipeline's usage. * Update Bria Fibo Edit documentation with corrected Hugging Face page link * add dreambooth training script * style and quality * Delete temp.py * Enhancement: Improve JSON caption validation in DreamBoothDataset * Updated the clean_json_caption function to handle both string and dictionary inputs for captions. * Added error handling to raise a ValueError for invalid caption types, ensuring better input validation. * Add datasets dependency to requirements_fibo_edit.txt * Add bria_fibo_edit to docs table of contents * Fix dummy objects ordering * Fix BriaFiboEditPipeline to use passed generator parameter The pipeline was ignoring the generator parameter and only using the seed parameter. This caused non-deterministic outputs in tests that pass a seeded generator. * Remove fibo_edit training script and related files --------- Co-authored-by: kfirbria <[email protected]>
1 parent 29b15f4 commit d7a1c31

File tree

9 files changed

+1382
-2
lines changed

9 files changed

+1382
-2
lines changed

docs/source/en/_toctree.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,8 @@
496496
title: Bria 3.2
497497
- local: api/pipelines/bria_fibo
498498
title: Bria Fibo
499+
- local: api/pipelines/bria_fibo_edit
500+
title: Bria Fibo Edit
499501
- local: api/pipelines/chroma
500502
title: Chroma
501503
- local: api/pipelines/cogview3
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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 Fibo Edit
14+
15+
Fibo Edit is an 8B parameter image-to-image model that introduces a new paradigm of structured control, operating on JSON inputs paired with source images to enable deterministic and repeatable editing workflows.
16+
Featuring native masking for granular precision, it moves beyond simple prompt-based diffusion to offer explicit, interpretable control optimized for production environments.
17+
Its lightweight architecture is designed for deep customization, empowering researchers to build specialized "Edit" models for domain-specific tasks while delivering top-tier aesthetic quality
18+
19+
## Usage
20+
_As the model is gated, before using it with diffusers you first need to go to the [Bria Fibo Hugging Face page](https://huggingface.co/briaai/Fibo-Edit), 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._
21+
22+
Use the command below to log in:
23+
24+
```bash
25+
hf auth login
26+
```
27+
28+
29+
## BriaFiboEditPipeline
30+
31+
[[autodoc]] BriaFiboEditPipeline
32+
- all
33+
- __call__

src/diffusers/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@
457457
"AuraFlowPipeline",
458458
"BlipDiffusionControlNetPipeline",
459459
"BlipDiffusionPipeline",
460+
"BriaFiboEditPipeline",
460461
"BriaFiboPipeline",
461462
"BriaPipeline",
462463
"ChromaImg2ImgPipeline",
@@ -1185,6 +1186,7 @@
11851186
AudioLDM2UNet2DConditionModel,
11861187
AudioLDMPipeline,
11871188
AuraFlowPipeline,
1189+
BriaFiboEditPipeline,
11881190
BriaFiboPipeline,
11891191
BriaPipeline,
11901192
ChromaImg2ImgPipeline,

src/diffusers/pipelines/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
"AnimateDiffVideoToVideoControlNetPipeline",
130130
]
131131
_import_structure["bria"] = ["BriaPipeline"]
132-
_import_structure["bria_fibo"] = ["BriaFiboPipeline"]
132+
_import_structure["bria_fibo"] = ["BriaFiboPipeline", "BriaFiboEditPipeline"]
133133
_import_structure["flux2"] = ["Flux2Pipeline", "Flux2KleinPipeline"]
134134
_import_structure["flux"] = [
135135
"FluxControlPipeline",
@@ -597,7 +597,7 @@
597597
from .aura_flow import AuraFlowPipeline
598598
from .blip_diffusion import BlipDiffusionPipeline
599599
from .bria import BriaPipeline
600-
from .bria_fibo import BriaFiboPipeline
600+
from .bria_fibo import BriaFiboEditPipeline, BriaFiboPipeline
601601
from .chroma import ChromaImg2ImgPipeline, ChromaInpaintPipeline, ChromaPipeline
602602
from .chronoedit import ChronoEditPipeline
603603
from .cogvideo import (

src/diffusers/pipelines/bria_fibo/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
_dummy_objects.update(get_objects_from_module(dummy_torch_and_transformers_objects))
2424
else:
2525
_import_structure["pipeline_bria_fibo"] = ["BriaFiboPipeline"]
26+
_import_structure["pipeline_bria_fibo_edit"] = ["BriaFiboEditPipeline"]
27+
2628

2729
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
2830
try:
@@ -33,6 +35,7 @@
3335
from ...utils.dummy_torch_and_transformers_objects import *
3436
else:
3537
from .pipeline_bria_fibo import BriaFiboPipeline
38+
from .pipeline_bria_fibo_edit import BriaFiboEditPipeline
3639

3740
else:
3841
import sys

0 commit comments

Comments
 (0)