RepositoryPythonGBUnited Kingdom
neverbiasu

neverbiasu/ComfyUI-BAGEL

A ComfyUI extention for BAGEL(Unified Model for Multimodal Understanding and Generation)

187stars
15forks
22issues
5views

ComfyUI-Bagel

A ComfyUI custom node package based on the BAGEL-7B-MoT multimodal model.

About BAGEL

BAGEL

BAGEL is an open-source multimodal foundation model with 7B active parameters (14B total) that adopts a Mixture-of-Transformer-Experts (MoT) architecture. It is designed for multimodal understanding and generation tasks, outperforming top-tier open-source VLMs like Qwen2.5-VL and InternVL-2.5 on standard multimodal understanding leaderboards, and delivering text-to-image quality competitive with specialist generators such as SD3.

Features

  • Text-to-Image Generation: Generate high-quality images using natural language prompts
  • Image Editing: Edit existing images based on textual descriptions
  • Image Understanding: Perform Q&A and analysis on images
  • Reasoning Process Display: Optionally display the model's reasoning process
  • Advanced Quantization Support: Multiple quantization modes (BF16, NF4, INT8) for the standard model
  • DFloat11 Quantized Model Support: Pre-quantized model requiring only ~22GB VRAM for single GPU setups

Installation

1. Model Selection and Download

The ComfyUI-Bagel node provides a model selection dropdown with automatic downloading capabilities:

  • Model Selection UI: Choose from available Hugging Face repository IDs or local folder names in the dropdown
  • Auto-download Feature: When allow_auto_download is enabled, models are automatically downloaded to models/bagel/ on first use
  • Local Model Detection: The node automatically scans for locally installed models in the models/bagel/ directory

Available Models:

  • ByteDance-Seed/BAGEL-7B-MoT: Standard model with multiple quantization options
    • BF16: Full precision mode (~80GB VRAM recommended for multi-GPU)
    • NF4: 4-bit quantization (~12-32GB VRAM, highly recommended for single GPU)
    • INT8: 8-bit quantization (~22-32GB VRAM, moderate compression)
  • DFloat11/BAGEL-7B-MoT-DF11: Pre-quantized model (~22GB VRAM, single 24GB GPU compatible)

[!IMPORTANT] DFloat11 version do not need quantization again!

Memory is automatically calculated based on your GPU specifications and selected quantization mode - no manual configuration needed!

For manual installation, you can download models to models/bagel/:

Standard Model

# Clone model using git lfs (recommended)
git lfs install
git clone https://huggingface.co/ByteDance-Seed/BAGEL-7B-MoT models/bagel/BAGEL-7B-MoT

# Or use huggingface_hub
pip install huggingface_hub
python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='ByteDance-Seed/BAGEL-7B-MoT', local_dir='models/bagel/BAGEL-7B-MoT')"
# Clone DFloat11 quantized model
git clone https://huggingface.co/DFloat11/BAGEL-7B-MoT-DF11 models/bagel/BAGEL-7B-MoT-DF11

# Or use huggingface_hub
python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='DFloat11/BAGEL-7B-MoT-DF11', local_dir='models/bagel/BAGEL-7B-MoT-DF11')"

2. Install Dependencies

Install the required dependencies:

pip install -r requirements.txt

For advanced quantization support (NF4/INT8 modes), also install:

pip install bitsandbytes

For DFloat11 quantized model support, also install:

pip install dfloat11

Note: bitsandbytes is required for NF4 and INT8 quantization modes on the standard ByteDance model. DFloat11 model works without additional quantization libraries.

3. Restart ComfyUI

Restart ComfyUI to load the new nodes.

Workflows

Text-to-Image Generation

text to image workflow Generate high-quality images from text descriptions. Suitable for creative design and content generation.

Image Editing Workflow

image editing workflow Edit existing images based on textual descriptions, supporting local modifications and style adjustments.

Image Understanding Workflow

image understanding workflow Analyze and answer questions about image content, suitable for content understanding and information extraction.

Performance Comparison

MetricBAGEL-7B-MoT (Standard Model)BAGEL-7B-MoT (DFloat11 Quantized Model)
Model Size29.21 GB19.89 GB
Peak GPU Memory (1024x1024 image generation)30.07 GB21.76 GB
Generation Time (on an RTX4090 GPU)482.95 seconds154.39 seconds

DFloat11 Quantized Model significantly reduces VRAM requirements and speeds up generation time, making it ideal for single GPU setups.

License

This project is licensed under the Apache 2.0 License. Please refer to the official license terms for the use of the BAGEL model.

Contribution

Contributions are welcome! Please submit issue reports and feature requests. If you wish to contribute code, please create an issue to discuss your ideas first.

FAQ

1. VRAM Requirements & Optimization

With the new automatic memory management and quantization options:

  • 24GB GPU (Single): Use NF4 quantization or DFloat11 model for optimal performance
  • 12-16GB GPU: Use NF4 quantization for best results (may require some CPU offloading)
  • 8GB GPU: Limited support with NF4 + aggressive offloading
  • Multi-GPU: BF16 mode automatically distributes load across available GPUs
  • Memory is calculated automatically based on your hardware - no manual configuration needed!

2. NameError: 'Qwen2Config' is not defined

This issue is likely related to environment or dependency problems. You can install flash-attention and triton with the following links: v2.7.4.post1_crossos00 flash-attention-windows-wheel triton-windows-builds For more information, refer to this GitHub issue.

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
Comfy-Org/ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

149.6k
Dec 2, 2026
RepositoryPython
Enemyx-net/VibeVoice-ComfyUI

A comprehensive ComfyUI integration for Microsoft's VibeVoice text-to-speech model, enabling high-quality single and multi-speaker voice synthesis directly within your ComfyUI workflows.

1.6k
Feb 18, 2026
RepositoryPython
Carasibana/ComfyUI-H3-FaceRefine

Refine and improve the quality of small faces in MiniMax H3 video. Per-frame face tracking, crop, refine with H3, stitch back.

653
Sep 13, 2026
RepositoryPython
Luisacaotica/ComfyUI-MiniMaxH3Mod

🚧 Under construction — no-training RefMod reference adapters for MiniMax H3 (compress reference images/videos into tiny latents, no training needed).

649
Nov 14, 2026
RepositoryPython
geroldmeisinger/ComfyUI-outputlists-combiner

Handle multiprompts and images within one run. Quick OutputLists from spreadsheet, JSON, multiline text, numberranges for sequential processing. Combinations of lists and prompts. Load any file with metadata and glob patterns. Native XYZ-GridPlots, with supergrids and videogrids. Inspect COMBO in LoRA loader, sampler etc. Strings with placeholders.

211
Sep 14, 2026
RepositoryPython
slahiri/ComfyUI-Workflow-Models-Downloader

ComfyUI-Workflow-Models-Downloader

162
Nov 29, 2025
RepositoryPython
donnemartin/system-design-primer

Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.

379.9k
Sep 15, 2026
RepositoryPython
practical-tutorials/project-based-learning

Curated list of project-based tutorials

290.9k
Nov 30, 2026
RepositoryPython
Significant-Gravitas/AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

188.2k
Nov 29, 2026