Instructions to use akhaliq/Fibo-2.0-edit-IDM-1step with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use akhaliq/Fibo-2.0-edit-IDM-1step with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("briaai/Fibo-2.0-edit-turbo", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("akhaliq/Fibo-2.0-edit-IDM-1step") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
import torch
from diffusers import DiffusionPipeline
from diffusers.utils import load_image
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("briaai/Fibo-2.0-edit-turbo", dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("akhaliq/Fibo-2.0-edit-IDM-1step")
prompt = "Turn this cat into a dog"
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
image = pipe(image=input_image, prompt=prompt).images[0]Fibo 2.0 Edit β IDM 1-Step
Bria Fibo 2.0 Edit Turbo image editing in a single network evaluation, no CFG β one LoRA adapter. Community implementation of Intrinsic Distribution Matching (IDM) (Liu et al., arXiv:2610.39633), compressing the 4-step distilled editing model to 1 step.
| DiT forwards / edit | |
|---|---|
| Fibo 2.0 Edit Turbo (4 steps, no CFG) | 4 |
| This adapter (1 step, no CFG) | 1 |
Method
- Internal distribution matching β real score from the frozen 4-step teacher (adapters disabled), fake score from a LoRA branch trained with flow matching on detached generator outputs; DMD direction
sg[clamp(v_real - v_fake, Β±1)]as in APEX. - Feature moment loss (L_pop, Ξ» = 0.5) β mean and per-coordinate std matching in the generator-EMA feature space (mean-pooled last-block hidden states at high noise), two FIFO queues K = 16384. Reference: ground-truth edited images.
- Generator: strict 1-NFE map
x = z β v_gen(z, t=1)throughout training.
Recipe: LoRA r=64 Ξ±=64 all-linear Γ3 branches (gen/fake/ema) on one frozen base, AdamW lr 1e-4, bf16, grad checkpointing, 1024Γ1024, batch 8, 550 steps on 1ΓH200. EMA decay 0.99. Zero-LoRA init on briaai/Fibo-2.0-edit-turbo. Moment-loss features are extracted at 512px (consistent on generator and reference sides) to fit single-GPU memory.
Data: 9,000 editing triplets from UltraEdit_500k (FreeForm, clip_sim_dir β₯ 0.1). Eval: MagicBrush test split, first-turn rows (never trained on). The naive_1step/ folder keeps the pre-training naive 1-step probe of the teacher for comparison.
Usage
import torch
from diffusers import BriaFibo2Pipeline
from diffusers.utils import load_image
pipe = BriaFibo2Pipeline.from_pretrained("briaai/Fibo-2.0-edit-turbo", torch_dtype=torch.bfloat16).to("cuda")
pipe.load_lora_weights("akhaliq/Fibo-2.0-edit-IDM-1step", weight_name="pytorch_lora_weights.safetensors")
image = load_image("photo.jpg")
edited = pipe("make the jacket red leather", image=image,
num_inference_steps=1, guidance_scale=1.0).images[0]
edited.save("edited.png")
Eval results
MagicBrush test, 128 first-turn rows at 1 NFE, unshifted t=1β0 Euler for both rows (L1 β, CLIP-I β, CLIP-T β vs ground-truth target; CLIP-T = output vs instruction, ViT-B/32):
| Model | Steps | L1 β | CLIP-I β | CLIP-T β |
|---|---|---|---|---|
| Fibo 2.0 Edit Turbo, naive | 1 | 0.2198 | 0.5430 | 0.2080 |
| IDM 1-step (this adapter) | 1 | 0.2624 | 0.5312 | 0.2002 |
Reference from the sibling 2-step repo (different protocol, 2 NFE): teacher 4-step L1 0.0479 / CLIP-I 0.9180 / CLIP-T 0.2066.
Limitations
- 1-step editing favors attribute-level edits (color, expression, object swap, style); structural edits and in-image text remain hardest at 1 NFE.
- Trained on square 1024px crops of UltraEdit free-form edits; masked and multi-reference editing are inherited from the base model but were not distilled explicitly.
- License follows the base model: CC BY-NC 4.0 (non-commercial), per Bria's terms.
Citation
@misc{liu2026intrinsicdistributionmatching,
title={Intrinsic Distribution Matching},
author={Deyuan Liu and Yansen Han and Kaiwen Zheng and Jun Xie and Jiacheng Liu and Zhenglin Cheng and Peng Sun and Jintao Zhang and Jianguo Li and Tao Lin},
year={2026}, eprint={2610.39633}, archivePrefix={arXiv}, primaryClass={cs.CV},
url={https://arxiv.org/abs/2610.39633},
}
Base model: Fibo 2.0 (Bria AI). Method grounding: DMD2, APEX/TwinFlow internal-score construction.
- Downloads last month
- 81