Text-to-Image
Diffusers
Safetensors
English
BriaFiboPipeline
lora
guidance-distillation
scfm
shortcutting-flow-matching
fast-inference
few-step
bria
fibo
Instructions to use ml-resources/Fibo-lite with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ml-resources/Fibo-lite with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("briaai/FIBO", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("ml-resources/Fibo-lite") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
|
Download README.md from ml-resources/Fibo-lite: direct link, hf CLI and curl.
- Browser
- Download file 9.28 kB
-
https://huggingface.co/ml-resources/Fibo-lite/resolve/main/README.md
- Command line
-
hf download hf://ml-resources/Fibo-lite/README.md
-
curl -L -o README.md https://huggingface.co/ml-resources/Fibo-lite/resolve/main/README.md
9.28 kB
| language: | |
| - en | |
| base_model: briaai/FIBO | |
| pipeline_tag: text-to-image | |
| library_name: diffusers | |
| license: cc-by-nc-4.0 | |
| license_name: bria-fibo | |
| license_link: https://creativecommons.org/licenses/by-nc/4.0/deed.en | |
| tags: | |
| - lora | |
| - guidance-distillation | |
| - scfm | |
| - shortcutting-flow-matching | |
| - text-to-image | |
| - fast-inference | |
| - few-step | |
| - bria | |
| - fibo | |
| > Mirror of [briaai/Fibo-lite](https://huggingface.co/briaai/Fibo-lite). All credit to Bria AI. Not an official release from them. License unchanged: [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/deed.en), non-commercial use only. Commercial use requires a separate agreement with Bria AI. | |
| <!-- ===================== HEADER ===================== --> | |
| <p align="center"> | |
| <img src="https://bria-public.s3.us-east-1.amazonaws.com/Bria-logo.svg" width="200"/> | |
| </p> | |
| <div align="center"> | |
| <!-- # Distilled Fibo ⚡ | |
| --> | |
| [](https://huggingface.co/briaai/FIBO) | |
| [](https://github.com/Bria-AI/FIBO) | |
| [](https://creativecommons.org/licenses/by-nc/4.0/deed.en) | |
| </div> | |
| <p align="center"> | |
| <img src="assets/shuttle.png" alt="FIBO Lite Hero" width="100%"/> | |
| </p> | |
| <p align="center"> | |
| <b>Accelerate FIBO inference with a two-stage distillation approach.</b> | |
| <br> | |
| <i>This model combines CFG distillation with Shortcutting Flow Matching (SCFM) for ultra-efficient few-step generation. </i> | |
| </p> | |
| --- | |
| ## 🚀 Overview | |
| This is a **two-stage distilled model** for the [**FIBO**](https://huggingface.co/briaai/FIBO) text-to-image model, combining: | |
| 1. **CFG Distillation**: First, we distill classifier-free guidance into the model, enabling inference with **Guidance Scale = 1.0** (skipping the negative prompt pass). | |
| 2. **SCFM (Shortcutting Flow Matching)**: On top of the CFG-distilled merged model, we apply velocity field self-distillation to enable efficient few-step sampling. | |
| This two-stage approach allows FIBO Lite to generate high-quality images in significantly fewer inference steps while maintaining the benefits of CFG distillation. | |
| ### 🔑 Key Benefits | |
| * **Two-Stage Distillation**: Combines CFG distillation with SCFM for maximum efficiency—the SCFM was trained on top of the already CFG-distilled merged model. | |
| * **Few-Step Generation**: SCFM enables efficient sampling in significantly fewer inference steps. | |
| * **No CFG Overhead**: Running at `guidance_scale=1` means calculating the noise prediction only once per step instead of twice. | |
| * **Quality Tradeoff**: As a distillation approach, there is a slight quality degradation compared to the full model at CFG=5, but the speed gains make it ideal for rapid iteration and production workflows. | |
| * **Drop-in Replacement**: Works seamlessly with existing FIBO workflows—just set `guidance_scale=1.0`. | |
| * **Memory Efficient**: Minimal additional GPU memory overhead. | |
| --- | |
| ## 📊 Comparison & Examples | |
| <p align="center"> | |
| <em>Left: Regular FIBO (Base Model, CFG=5) | Right: FIBO Lite (Distilled LoRA, CFG=1)</em><br> | |
| <img src="assets/astro-pair.png" alt="Comparison" width="100%"/> | |
| </p> | |
| <p align="center"> | |
| <em>🖼️ More Example Outputs from FIBO Distilled LoRA:</em> | |
| </p> | |
| <table> | |
| <tr> | |
| <td align="center"><img src="assets/86.png" width="100% "/></td> | |
| <td align="center"><img src="assets/sheeps.png" width="100%"/></td> | |
| </tr> | |
| <tr> | |
| <td align="center"><img src="assets/1.png" width="100%"/></td> | |
| <td align="center"><img src="assets/2.png" width="100%"/></td> | |
| </tr> | |
| <tr> | |
| <td align="center"><img src="assets/flowers.png" width="100%"/></td> | |
| <td align="center"><img src="assets/4.png" width="100%"/></td> | |
| </tr> | |
| </table> | |
| | Feature | Base FIBO | FIBO Lite | | |
| | :--- | :---: | :---: | | |
| | **Guidance Scale** | 5.0 (Typical) | **1.0** (Distilled) | | |
| | **Compute per Step** | 2x (Cond + Uncond) | **1x (Cond Only)** | | |
| | **Speed** | Baseline | **~10x Faster** | | |
| | **Quality** | Full Quality | Slight Degradation | | |
| --- | |
| ## 🛠️ Usage | |
| ### Requirements | |
| ```bash | |
| pip install git+https://github.com/huggingface/diffusers torch torchvision boltons ujson sentencepiece accelerate transformers | |
| ``` | |
| for using gemini api, you need to install `google-genai` as well | |
| ### Quick Start | |
| ```python | |
| import os | |
| import json | |
| import torch | |
| from diffusers import BriaFiboPipeline | |
| from diffusers.modular_pipelines import ModularPipeline | |
| # ------------------------------- | |
| # Load the VLM pipeline | |
| # ------------------------------- | |
| torch.set_grad_enabled(False) | |
| # Using local VLM | |
| vlm_pipe = ModularPipeline.from_pretrained("briaai/FIBO-VLM-prompt-to-JSON", trust_remote_code=True) | |
| # Using Gemini API, requires GOOGLE_API_KEY environment variable | |
| # assert os.getenv("GOOGLE_API_KEY") is not None, "GOOGLE_API_KEY environment variable is not set" | |
| # vlm_pipe = ModularPipeline.from_pretrained("briaai/FIBO-gemini-prompt-to-JSON", trust_remote_code=True) | |
| # Load the FIBO pipeline | |
| pipe = BriaFiboPipeline.from_pretrained( | |
| "briaai/Fibo-lite", | |
| torch_dtype=torch.bfloat16, | |
| ) | |
| pipe.to("cuda") | |
| # Generate with guidance_scale=1.0 (2x faster!) | |
| output = vlm_pipe( | |
| prompt="A hyper-detailed, ultra-fluffy owl sitting in the trees at night, looking directly at the camera with wide, adorable, expressive eyes. Its feathers are soft and voluminous, catching the cool moonlight with subtle silver highlights. The owl's gaze is curious and full of charm, giving it a whimsical, storybook-like personality." | |
| ) | |
| json_prompt_generate = output.values["json_prompt"] | |
| results_generate = pipe( | |
| prompt=json_prompt_generate, num_inference_steps=8, guidance_scale=1 | |
| ) | |
| results_generate.images[0].save("image_generate.png") | |
| with open("image_generate_json_prompt.json", "w") as f: | |
| f.write(json_prompt_generate) | |
| ``` | |
| ### Key Parameters | |
| - **`guidance_scale=1.0`**: This is the magic setting! With the LoRA loaded, you get the quality of CFG=5 at the speed of CFG=1. | |
| - **`num_inference_steps=8`**: Standard for FIBO Lite. Adjust based on your quality/speed tradeoff. | |
| - **No negative prompt needed**: The distillation handles this internally. | |
| --- | |
| ## 🧠 Training Details | |
| This model was created using a **two-stage distillation process**: | |
| ### Stage 1: CFG Distillation | |
| * **Method**: Guidance Distillation (Distilling the CFG effect into the model weights via LoRA) | |
| * **Base Model**: [briaai/FIBO](https://huggingface.co/briaai/FIBO) | |
| * **Trainable Parameters**: 471,472,128 | |
| * **Precision**: bfloat16 | |
| * **Teacher Configuration**: CFG=5.0 (standard FIBO setting) | |
| * **Student Configuration**: CFG=1.0 (target deployment) | |
| * **Training Objective**: Minimize KL divergence between teacher and student outputs | |
| The CFG distillation LoRA was then **merged into the base model** to create a CFG-free foundation. | |
| ### Stage 2: SCFM (Shortcutting Flow Matching) | |
| Building on the merged CFG-distilled model, we applied **Shortcutting Flow Matching** (SCFM): | |
| * **Method**: Velocity Field Self-Distillation | |
| * **Base Model**: CFG-distilled merged FIBO (from Stage 1) | |
| * **Key Innovation**: SCFM imparts a shortcut mechanism to standard flow matching models, enabling flexible trajectory-skipping without requiring step-size embedding | |
| * **Training Approach**: Works on the velocity field rather than sample space, learning rapidly from self-guided distillation in an online manner | |
| * **Result**: Efficient few-step flows without compromising quality | |
| ### Why Two Stages? | |
| 1. **Stage 1 (CFG Distillation)** eliminates the need for dual forward passes (conditional + unconditional), halving compute per step. | |
| 2. **Stage 2 (SCFM)** enables the model to take larger steps through the diffusion trajectory, dramatically reducing the number of required inference steps. | |
| Together, these stages compound to deliver ultra-efficient generation: fewer steps × less compute per step = significantly faster inference. | |
| --- | |
| ## 🤝 Community & Support | |
| - **GitHub**: [FIBO Repository](https://github.com/Bria-AI/FIBO) | |
| - **Hugging Face**: [FIBO Model Card](https://huggingface.co/briaai/FIBO) | |
| - **Commercial Licensing**: [Contact Bria AI](https://bria.ai/contact-us) | |
| --- | |
| ## 📚 Citation | |
| If you use this model in your research or project, please cite: | |
| ```bibtex | |
| @misc{gutflaish2025generating, | |
| title = {Generating an Image From 1,000 Words: Enhancing Text-to-Image With Structured Captions}, | |
| author = {Gutflaish, Eyal and Kachlon, Eliran and Zisman, Hezi and Hacham, Tal and Sarid, Nimrod and Visheratin, Alexander and Huberman, Saar and Davidi, Gal and Bukchin, Guy and Goldberg, Kfir and Mokady, Ron}, | |
| year = {2025}, | |
| eprint = {2511.06876}, | |
| archivePrefix = {arXiv}, | |
| primaryClass = {cs.CV}, | |
| doi = {10.48550/arXiv.2511.06876}, | |
| url = {https://arxiv.org/abs/2511.06876} | |
| } | |
| ``` | |
| --- | |
| ## 📄 License | |
| <p><b>Source-Code & Weights</b></p> | |
| <ul> | |
| <li>The model is open source for non-commercial use with <a href="https://creativecommons.org/licenses/by-nc/4.0/deed.en">this license</a> </li> | |
| <li>For commercial use <a href="https://bria.ai/contact-us?hsCtaAttrib=114250296256">Click here</a>.</li> | |
| </ul> | |