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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
---
language:
- en
base_model:
- briaai/FIBO
pipeline_tag: text-to-image
library_name: diffusers
license: other
license_name: bria-fibo
license_link: https://creativecommons.org/licenses/by-nc/4.0/deed.en
widget:
- text: A man holding a goose while screaming
  output:
    url: images/example_69da5vqgf.png
tags:
- art
- text-to-image
---
> Mirror of [briaai/FIBO](https://huggingface.co/briaai/FIBO). 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>

<p align="center">
  <!-- GitHub Repo -->
  <a href="https://github.com/Bria-AI/FIBO" target="_blank">
    <img
      alt="GitHub Repo"
      src="https://img.shields.io/badge/GitHub-Repo-181717?logo=github&logoColor=white&style=for-the-badge"
    />
  </a>
  &nbsp;

  <!-- Hugging Face Demo -->
  <a href="https://huggingface.co/spaces/briaai/FIBO" target="_blank">
    <img
      alt="Hugging Face Demo"
      src="https://img.shields.io/badge/Hugging%20Face-Demo-FFD21E?logo=huggingface&logoColor=black&style=for-the-badge"
    />
  </a>
  &nbsp;

  <!-- FIBO Demo on Bria (replace URL if you have a specific demo link) -->
  <a href="https://platform.bria.ai/image-generation/fibo-generate/sandbox" target="_blank">
    <img
      alt="FIBO Demo on Bria"
      src="https://img.shields.io/badge/FIBO%20Demo-Bria-6C47FF?style=for-the-badge"
    />
  </a>
  &nbsp;

  <!-- Bria Platform -->
  <a href="https://platform.bria.ai" target="_blank">
    <img
      alt="Bria Platform"
      src="https://img.shields.io/badge/Bria-Platform-0EA5E9?style=for-the-badge"
    />
  </a>
  &nbsp;

  <!-- Bria Discord -->
  <a href="https://discord.com/invite/Nxe9YW9zHS" target="_blank">
    <img
      alt="Bria Discord"
      src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white&style=for-the-badge"
    />
  </a>
  &nbsp;

  <!-- Tech Paper -->
  <a href="https://arxiv.org/abs/2511.06876" target="_blank">
    <img
      alt="Tech Paper (Coming Soon)"
      src="https://img.shields.io/badge/Tech%20Paper-lightgrey?logo=arxiv&logoColor=red&style=for-the-badge"
    />
  </a>
</p>
<p align="center">
  <img src="https://bria-public.s3.us-east-1.amazonaws.com/car.001.jpeg" width="1024"/>
</p>

<p align="center">
  <b>FIBO is the first open-source, JSON-native text-to-image model trained exclusively on long structred captions.</b><br>
  Fibo sets a new standard for controllability, predictability, and disentanglement by implementing the new <a href="https://docs.bria.ai/vgl">VGL - Visual GenAI Language paradigm</a>
  <b></b>
  <br><br>
</p>

<!-- ===================== MAIN CONTENT ===================== -->

<h2>🌍 What's FIBO?</h2>
<p>Most text-to-image models excel at imagination—but not control. <b>FIBO</b> is built for professional workflows, not casual use. Trained on <b>structured JSON captions up to 1,000+ words</b>, FIBO enables precise, reproducible control over lighting, composition, color, and camera settings. The structured captions foster native disentanglement, allowing targeted, iterative refinement without prompt drift. With only <b>8B parameters</b>, FIBO delivers high image quality, strong prompt adherence, and professional-grade control—<b>trained exclusively on licensed data</b>.</p>

<h2> News</h2>
<ul>
  <li>2026-3-30: Agents skill is now available <a href="https://github.com/Bria-AI/bria-skill">here</a> 📓</li>
  <li>2025-11-11: Technical report is now available <a href="https://arxiv.org/abs/2511.06876">here</a> 📓</li>
  <li>2025-11-11: Fine-tuning code is now available <a href="https://github.com/Bria-AI/FIBO/tree/main/src/fine_tuning">here</a> 🎉</li>
</ul>


<h2>🔑 Key Features</h2>
<ul>
  <li><b>VLM guided JSON-native prompting</b>: Incorporates any VLM to transform short prompts into structured schemas with 1,000+ words (lighting, camera, composition, DoF).</li>
  <li><b>Iterative controlled generation</b>: generate images from short prompts or keep refining and get inspiration from detailed JSONs and input images</li>
  <li><b>Disentangled control</b>: tweak a single attribute (e.g., camera angle) without breaking the scene.</li>
  <li><b>Enterprise-grade</b>: 100% licensed data; governance, repeatability, and legal clarity.</li>
  <li><b>Strong prompt adherence</b>: high alignment on PRISM-style evaluations.</li>
  <li><b>Built for production</b>: API endpoints (Bria Platform, Fal.ai, Replicate), ComfyUI nodes, and local inference.</li>
</ul>

<h2>🎨 Work with FIBO in Three Simple Modes</h2>

<ul>
  <li>
    <b>Generate:</b> Start with a quick idea. FIBO’s language model expands your short prompt into a rich, structured JSON prompt, then generates the image. 
    You get both the image and the expanded prompt.
  </li>
  <li>
    <b>Refine:</b> Continue from a detailed structured prompt add a short instruction - for example, “backlit,” “85 mm,” or “warmer skin tones.” 
    FIBO updates <i>only</i> the requested attributes, re-generates the image, and returns the refined prompt alongside it.
  </li>
  <li>
    <b>Inspire:</b> Provide an image instead of text. FIBO’s vision–language model extracts a detailed, structured prompt, blends it with your creative intent, and produces related images—ideal for inspiration without overreliance on the original.
  </li>
</ul>

<h2>⚡ Quick Start</h2>

</p>

<!-- change it to a nice button -->
<p align="center">
  🚀 <a href="https://huggingface.co/spaces/briaai/FIBO">Try FIBO now →</a>
</p>

<p>FIBO is available everywhere you build, either as source-code and weights, ComfyUI nodes or API endpoints.</p>

<p><b>API Endpoint:</b></p>
<ul>
  <li><a href="https://docs.bria.ai/image-generation/v2-endpoints/image-generate">Bria.ai</a></li>
  <li><a href="https://fal.ai/models/bria/fibo/generate">Fal.ai</a></li>
  <li><a href="https://replicate.com/bria/fibo">Replicate</a></li>
</ul>

<p><b>ComfyUI:</b>
<ul>
  <li><a href="https://github.com/Bria-AI/ComfyUI-BRIA-API/blob/main/nodes/generate_image_node_v2.py">Generate Node</a></li>
  <li><a href="https://github.com/Bria-AI/ComfyUI-BRIA-API/blob/main/nodes/refine_image_node_v2.py">Refine Node</a></li>
</ul>

<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>
    
<h2>Quick Start Guide</h2>
<details>
  <summary>Install Diffusers And Additional Requirements</summary>
  <p>Install Diffusers from the source code:</p>
  <pre><code class="language-bash">pip install git+https://github.com/huggingface/diffusers torch torchvision google-genai boltons ujson sentencepiece accelerate transformers
</code></pre>
</details>
<h3>Generate</h3>

<p>FIBO uses a VLM that transforms short prompts into detailed structured prompts that are used to generate images. You can use the following code to generate images using Gemini via the Google API - **requires a GOOGLE_API_KEY**, or uncomment the relevant section to run a local VLM instead (FIBO-VLM):</p>

```python
import json
import os

import torch
from diffusers import BriaFiboPipeline
from diffusers.modular_pipelines import ModularPipelineBlocks


# -------------------------------
# Load the VLM pipeline
# -------------------------------
torch.set_grad_enabled(False)
# 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 = ModularPipelineBlocks.from_pretrained("briaai/FIBO-gemini-prompt-to-JSON", trust_remote_code=True)
vlm_pipe = vlm_pipe.init_pipeline()

# Using local VLM, uncomment to run
# vlm_pipe = ModularPipelineBlocks.from_pretrained("briaai/FIBO-VLM-prompt-to-JSON", trust_remote_code=True)
# vlm_pipe = vlm_pipe.init_pipeline()

# Load the FIBO pipeline
pipe = BriaFiboPipeline.from_pretrained(
    "briaai/FIBO",
    torch_dtype=torch.bfloat16,
)
pipe.to("cuda")
# pipe.enable_model_cpu_offload() # uncomment if you're getting CUDA OOM errors

# -------------------------------
# Run Prompt to JSON
# -------------------------------

# Create a prompt to generate an initial image
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"]

def get_default_negative_prompt(existing_json: dict) -> str:
    negative_prompt = ""
    style_medium = existing_json.get("style_medium", "").lower()
    if style_medium in ["photograph", "photography", "photo"]:
        negative_prompt = """{'style_medium':'digital illustration','artistic_style':'non-realistic'}"""
    return negative_prompt


negative_prompt = get_default_negative_prompt(json.loads(json_prompt_generate))

# -------------------------------
# Run Image Generation
# -------------------------------
# Generate the image from the structured json prompt
results_generate = pipe(
    prompt=json_prompt_generate, num_inference_steps=50, guidance_scale=5, negative_prompt=negative_prompt
)
results_generate.images[0].save("image_generate.png")
with open("image_generate_json_prompt.json", "w") as f:
    f.write(json_prompt_generate)

```

<p><img src="https://bria-public.s3.us-east-1.amazonaws.com/owl.png" alt="alt text" width="300"/></p>


<h3>Refine</h3>
<p>FIBO supports iterative generation. Given a structured prompt and an instruction, FIBO refines the output.</p>

```python
output = vlm_pipe(
    json_prompt=json_prompt_generate, prompt="make the owl brown"
)
json_prompt_refine_from_image = output.values["json_prompt"]

negative_prompt = get_default_negative_prompt(json.loads(json_prompt_refine_from_image))
results_refine_from_image = pipe(
    prompt=json_prompt_refine_from_image, num_inference_steps=50, guidance_scale=5, negative_prompt=negative_prompt
)
results_refine_from_image.images[0].save("image_refine_from_image.png")
with open("image_refine_from_image_json_prompt.json", "w") as f:
    f.write(json_prompt_refine_from_image)
```
<style>
.image-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* allows wrapping on smaller screens */
}
.image-row figure {
  text-align: center;
  font-size: 0.9em;
}
.image-row img {
  width: 300px;
  border-radius: 4px;
}
</style>

<div class="image-row">
  <figure>
    <img src="https://bria-public.s3.us-east-1.amazonaws.com/make_owl_brown.png" alt="Make owl brown"/>
    <figcaption>--> Make the owl brown</figcaption>
  </figure>
  <figure>
    <img src="https://bria-public.s3.us-east-1.amazonaws.com/turn_owl_into_a_lemur_.png" alt="Turn owl into a lemur"/>
    <figcaption>--> Turn the owl into a lemur</figcaption>
  </figure>
  <figure>
    <img src="https://bria-public.s3.us-east-1.amazonaws.com/add_jungle_vegetation_to_the_dark_background.png" alt="Add jungle vegetation"/>
    <figcaption>--> Add jungle vegetation</figcaption>
  </figure>
  <figure>
    <img src="https://bria-public.s3.us-east-1.amazonaws.com/add_sunlight.png" alt="Add sunlight"/>
    <figcaption>--> Add sunlight</figcaption>
  </figure>
</div>

<h3>Inspire</h3>
<p>Start from an image as inspiration and let Fibo regenerate a variation of it or merge your creative intent into the next generation</p>

```python
from PIL import Image
original_astronaut_image = Image.open("<path to original astronaut image>") 
output = vlm_pipe(
    image=original_astronaut_image, prompt="")
json_prompt_inspire = output.values["json_prompt"]
negative_prompt = get_default_negative_prompt(json.loads(json_prompt_inspire))
results_inspire = pipe(
    prompt=json_prompt_inspire, num_inference_steps=50, guidance_scale=5, negative_prompt=negative_prompt
)
results_inspire.images[0].save("image_inspire_no_prompt.png")
with open("image_inspire_json_prompt_no_prompt.json", "w") as f:
    f.write(json_prompt_inspire)

output = vlm_pipe(
    image=original_astronaut_image, prompt="Make futuristic")
json_prompt_inspire = output.values["json_prompt"]
negative_prompt = get_default_negative_prompt(json.loads(json_prompt_inspire))

results_inspire = pipe(
    prompt=json_prompt_inspire, num_inference_steps=50, guidance_scale=5, negative_prompt=negative_prompt
)
results_inspire.images[0].save("image_inspire_with_prompt.png")
with open("image_inspire_json_prompt_with_prompt.json", "w") as f:
    f.write(json_prompt_inspire)
```

<div class="image-row">
  <figure>
    <img src="https://bria-public.s3.us-east-1.amazonaws.com/original.png" alt="original image"/>
    <figcaption>original image</figcaption>
  </figure>
  <figure>
    <img src="https://bria-public.s3.us-east-1.amazonaws.com/no_prompt.png" alt="No prompt"/>
    <figcaption>Inspire #1: No prompt</figcaption>
  </figure>
  <figure>
    <img src="https://bria-public.s3.us-east-1.amazonaws.com/make_futuristic.png" alt="Make futuristic"/>
    <figcaption>Inspire #2: Make futuristic</figcaption>
  </figure>
  
</div>

<h3>Advanced Usage</h3>
<details>
  <summary>Gemini Setup [optional]</summary>

  <p>FIBO supports any VLM as part of the pipeline. To use Gemini as VLM backbone for FIBO, follow these instructions:</p>

  <ol>
    <li>
      <p><b>Obtain a Gemini API Key</b><br/>
      Sign up for the <a href="https://aistudio.google.com/app/apikey">Google AI Studio (Gemini)</a> and create an API key.</p>
    </li>
    <li>
      <p><b>Set the API Key as an Environment Variable</b><br/>
      Store your Gemini API key in the <code>GEMINI_API_KEY</code> environment variable:</p>
      <pre><code class="language-bash">export GEMINI_API_KEY=your_gemini_api_key
</code></pre>
      <p>You can add the above line to your <code>.bashrc</code>, <code>.zshrc</code>, or similar shell profile for persistence.</p>
    </li>
  </ol>

</details>

<p>see the examples in the <a href="examples">examples</a> directory for more details.</p>

<h2>🧠 Training and Architecture</h2>

<p><strong>FIBO</strong> is an 8B-parameter DiT-based, flow-matching text-to-image model trained <strong>exclusively on licensed data</strong> and on <strong>&gt; long, structured JSON captions</strong> (~1,000 words each), enabling strong prompt adherence and professional-grade control. It uses <strong>SmolLM3-3B</strong> as the text encoder with a novel <strong>DimFusion</strong> conditioning architecture for efficient long-caption training, and <strong>Wan 2.2</strong> as the VAE. The structured supervision promotes native disentanglement for targeted, iterative refinement without prompt drift, while VLM-assisted prompting expands short user intents, fills in missing details, and extracts/edits structured prompts from images using our fine-tuned <strong>Qwen-2.5</strong>-based VLM or <strong>Gemini 2.5 Flash</strong>. For reproducibility, we provide the assistant system prompt and the structured-prompt JSON schema across the “Generate,” “Refine,” and “Inspire” modes.</p>

<h2 id="data-distribution">Data Distribution</h2>

<p>FIBO was trained on curated set of image–caption pairs selected from ~1B image dataset as shown in the dataset distribution. All assets are vetted for commercial use, attribution traceability, and regional compliance under GDPR and the <strong>EU AI Act</strong>. This broad and balanced dataset ensures FIBO’s ability to generalize across a wide range of visual domains, from realistic human imagery to graphic design and product visualization, while maintaining full licensing compliance.</p>

<p><img src="https://bria-public.s3.us-east-1.amazonaws.com/DataAttr.png" alt="alt text" width="800"/></p>

<h2 id="Evaluation">Evaluation</h2>

<!-- ===================== BENCHMARK TABLE FIGURE ===================== -->
<h3 id="PRISM Benchmark model-comparison">PRISM Benchmark Model Comparison</h3>

<p>Using a licensed-data subset of PRISM-Bench, we evaluate image–text alignment and aesthetics. <strong>FIBO</strong> outperforms comparable open-source baselines, suggesting strong prompt adherence, controllability and aesthetics from structured-caption training.</p>

<img src="https://bria-public.s3.us-east-1.amazonaws.com/Benchmark.png" alt="Benchmark Chart" width="800"/>

<h2 id="More Samples">More Samples</h2>

<p>Generate</p>
<img src="https://bria-public.s3.us-east-1.amazonaws.com/Generate.png" alt="Benchmark Chart" width="800"/>

<p>Inspire & Refine</p>
<img src="https://bria-public.s3.us-east-1.amazonaws.com/Refine.ong.png" alt="Benchmark Chart" width="800"/>


<p>FIBO is inspired by the Fibonacci sequence, where math meets beauty through the golden ratio—nature’s and design’s timeless key to harmony.<p>
  
<p>If you have questions about this repository, feedback to share, or want to contribute directly, we welcome your issues and pull requests on GitHub. Your contributions help make FIBO better for everyone.</p>

<p>If you're passionate about fundamental research, we're hiring full-time employees (FTEs) and research interns. Don't wait - reach out to us at hr@bria.ai</p>

## Citation

We kindly encourage citation of our work if you find it useful.

```bibtex
@article{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 others},
  journal={arXiv preprint arXiv:2511.06876},
  year={2025}
}
```

<p align="center"><b>❤️ FIBO model card and ⭐ Star FIBO on GitHub to join the movement for responsible generative AI!</b></p>