This repository provides inference code for the DFloat11-compressed BAGEL-7B-MoT model.
With 32% smaller size than the original BFloat16 model, it delivers bit-identical outputs while maintaining efficient GPU inference. Thanks to DFloat11 compression, BAGEL can now run smoothly on a single 24GB GPU without any quality loss.
Metric | BAGEL-7B-MoT (BFloat16) | BAGEL-7B-MoT (DFloat11) |
---|---|---|
Model Size | 29.21 GB | 19.89 GB |
Peak GPU Memory (1024x1024 image generation) |
30.07 GB | 21.76 GB |
Generation Time (on an A100 GPU) |
54 seconds | 58 seconds |
BAGEL is an open‑source multimodal foundation model with 7B active parameters (14B total) trained on large‑scale interleaved multimodal data. BAGEL outperforms the current top‑tier open‑source VLMs like Qwen2.5-VL and InternVL-2.5 on standard multimodal understanding leaderboards, and delivers text‑to‑image quality that is competitive with strong specialist generators such as SD3. Moreover, BAGEL demonstrates superior qualitative results in classical image‑editing scenarios than the leading open-source models. More importantly, it extends to free-form visual manipulation, multiview synthesis, and world navigation, capabilities that constitute "world-modeling" tasks beyond the scope of previous image-editing models. The figure below showcases BAGEL's qualitative performance.
For more information, please refer to the original BAGEL repository.
1️⃣ Set up environment
git clone https://github.com/LeanModels/Bagel-DFloat11.git
cd Bagel-DFloat11
conda create -n bagel python=3.10 -y
conda activate bagel
pip install torch==2.6 torchvision
pip install flash-attn --no-build-isolation
pip install -r requirements.txt
2️⃣ Download pretrained checkpoint
from huggingface_hub import snapshot_download
save_dir = "./BAGEL-7B-MoT-DF11"
repo_id = "DFloat11/BAGEL-7B-MoT-DF11"
cache_dir = save_dir + "/cache"
snapshot_download(cache_dir=cache_dir,
local_dir=save_dir,
repo_id=repo_id,
local_dir_use_symlinks=False,
resume_download=True,
)
3️⃣ Go to inference.ipynb
to start playing with BAGEL!
4️⃣ Use Gradio WebUI to start playing with BAGEL!
pip install gradio
python app.py