BAGEL
BAGEL is an open-source multimodal foundation model with 7B active parameters (14B total) that unifies visual understanding, text-to-image generation, and image editing in a single model. It solves the problem of needing separate models for different multimodal tasks and is designed for developers and researchers building applications that require both understanding and generation of images.
✨ Key features
- Unified model for multimodal understanding and generation
- Outperforms top open-source VLMs on understanding benchmarks
- Text-to-image quality competitive with SD3
- Superior image editing and free-form visual manipulation
- Supports multiview synthesis and world navigation
- Open-source with Apache 2.0 license
🎯 Use cases
- Build chatbots that can both understand and generate images
- Perform text-to-image generation with high quality
- Edit images based on natural language instructions
- Create applications for visual reasoning and world modeling
- Generate multiview images or navigate virtual worlds
📦 Installation
🧰 Requirements: Python 3.10, PyTorch, flash_attn, and a GPU with sufficient VRAM (12GB+ for quantized inference, 32GB+ for full inference).
git clone https://github.com/bytedance-seed/BAGEL.git
cd BAGEL
conda create -n bagel python=3.10 -y
conda activate bagel
pip install -r requirements.txt
pip install flash_attn==2.5.8 --no-build-isolation
🚀 Usage
from huggingface_hub import snapshot_download
save_dir = "models/BAGEL-7B-MoT"
repo_id = "ByteDance-Seed/BAGEL-7B-MoT"
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,
allow_patterns=["*.json", "*.safetensors", "*.bin", "*.py", "*.md", "*.txt"],
)
Then run the Gradio app:
python app.py
⚠️ Good to know
The model may have poor performance in some cases; users are encouraged to report bad cases. Inference hyperparameters need tuning for optimal results.
❓ FAQ
What is the model size?
BAGEL has 7B active parameters out of 14B total.
What hardware is needed for inference?
For 32GB+ VRAM GPU or multi GPUs, use python app.py. For 12-32GB VRAM, use NF4 quantization with --mode 2. For 22-32GB, INT8 quantization with --mode 3 is possible but not recommended.
How do I control text and image guidance?
Use cfg_text_scale (typical 4.0-8.0) for text adherence, cfg_image_scale (typical 1.0-2.0) for image preservation, and cfg_interval (typical [0.4, 1.0]) for CFG application steps.
Can I train or fine-tune the model?
Yes, training guidelines are provided in TRAIN.md, and you can run bash scripts/train.sh after adjusting variables.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.