{"id":28607416,"url":"https://github.com/neverbiasu/ComfyUI-BAGEL","last_synced_at":"2025-06-11T21:02:55.086Z","repository":{"id":295546025,"uuid":"990102075","full_name":"neverbiasu/ComfyUI-BAGEL","owner":"neverbiasu","description":"A ComfyUI extention for BAGEL(Unified Model for Multimodal Understanding and Generation)","archived":false,"fork":false,"pushed_at":"2025-06-05T11:34:55.000Z","size":10069,"stargazers_count":153,"open_issues_count":19,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-05T12:33:05.276Z","etag":null,"topics":["comfyui","comfyui-custom-node","comfyui-nodes","custom-nodes"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neverbiasu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-25T14:05:45.000Z","updated_at":"2025-06-05T11:24:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"7531ed56-39a3-4fda-acf3-1b278b752ecd","html_url":"https://github.com/neverbiasu/ComfyUI-BAGEL","commit_stats":null,"previous_names":["neverbiasu/comfyui-bagel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/neverbiasu/ComfyUI-BAGEL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverbiasu%2FComfyUI-BAGEL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverbiasu%2FComfyUI-BAGEL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverbiasu%2FComfyUI-BAGEL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverbiasu%2FComfyUI-BAGEL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neverbiasu","download_url":"https://codeload.github.com/neverbiasu/ComfyUI-BAGEL/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverbiasu%2FComfyUI-BAGEL/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259340119,"owners_count":22842957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comfyui","comfyui-custom-node","comfyui-nodes","custom-nodes"],"created_at":"2025-06-11T21:01:20.767Z","updated_at":"2025-06-11T21:02:55.078Z","avatar_url":"https://github.com/neverbiasu.png","language":"Python","funding_links":[],"categories":["Workflows (3395) sorted by GitHub Stars","All Workflows Sorted by GitHub Stars"],"sub_categories":[],"readme":"# ComfyUI-Bagel\n\nA ComfyUI custom node package based on the BAGEL-7B-MoT multimodal model.\n\n## About BAGEL\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/nuhojubrps/banner.png\" alt=\"BAGEL\" width=\"480\"/\u003e\n\u003c/p\u003e\n\nBAGEL 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.\n\n## Features\n\n- **Text-to-Image Generation**: Generate high-quality images using natural language prompts\n- **Image Editing**: Edit existing images based on textual descriptions  \n- **Image Understanding**: Perform Q\u0026A and analysis on images\n- **Reasoning Process Display**: Optionally display the model's reasoning process\n- **Advanced Quantization Support**: Multiple quantization modes (BF16, NF4, INT8) for the standard model\n- **DFloat11 Quantized Model Support**: Pre-quantized model requiring only ~22GB VRAM for single GPU setups\n\n## Installation\n\n### 1. Model Selection and Download\nThe ComfyUI-Bagel node supports automatic model selection with intelligent quantization:\n- **ByteDance-Seed/BAGEL-7B-MoT**: Standard model with multiple quantization options\n  - **BF16**: Full precision mode (~80GB VRAM recommended for multi-GPU)\n  - **NF4**: 4-bit quantization (~12-32GB VRAM, highly recommended for single GPU)\n  - **INT8**: 8-bit quantization (~22-32GB VRAM, moderate compression)\n- **DFloat11/BAGEL-7B-MoT-DF11**: Pre-quantized model (~22GB VRAM, single 24GB GPU compatible)\n\n\u003e [!IMPORTANT]\n\u003e DFloat11 version do not need quantization again!\n\n**Memory is automatically calculated** based on your GPU specifications and selected quantization mode - no manual configuration needed!\n\nModels will be automatically downloaded to `models/bagel/` when first selected. You can also manually download them:\n\n#### Standard Model\n```bash\n# Clone model using git lfs (recommended)\ngit lfs install\ngit clone https://huggingface.co/ByteDance-Seed/BAGEL-7B-MoT models/bagel/BAGEL-7B-MoT\n\n# Or use huggingface_hub\npip install huggingface_hub\npython -c \"from huggingface_hub import snapshot_download; snapshot_download(repo_id='ByteDance-Seed/BAGEL-7B-MoT', local_dir='models/bagel/BAGEL-7B-MoT')\"\n```\n\n#### DFloat11 Quantized Model (Recommended for single GPU)\n```bash\n# Clone DFloat11 quantized model\ngit clone https://huggingface.co/DFloat11/BAGEL-7B-MoT-DF11 models/bagel/BAGEL-7B-MoT-DF11\n\n# Or use huggingface_hub\npython -c \"from huggingface_hub import snapshot_download; snapshot_download(repo_id='DFloat11/BAGEL-7B-MoT-DF11', local_dir='models/bagel/BAGEL-7B-MoT-DF11')\"\n```\n\n### 2. Install Dependencies\nInstall the required dependencies:\n```bash\npip install -r requirements.txt\n```\n\nFor advanced quantization support (NF4/INT8 modes), also install:\n```bash\npip install bitsandbytes\n```\n\nFor DFloat11 quantized model support, also install:\n```bash\npip install dfloat11\n```\n\n**Note**: `bitsandbytes` is required for NF4 and INT8 quantization modes on the standard ByteDance model. DFloat11 model works without additional quantization libraries.\n\n### 3. Restart ComfyUI\nRestart ComfyUI to load the new nodes.\n\n## Workflows\n\n### Text-to-Image Generation\n![text to image workflow](example_workflows/bagel_text_to_image.png)\nGenerate high-quality images from text descriptions. Suitable for creative design and content generation.\n\n### Image Editing Workflow\n![image editing workflow](example_workflows/bagel_image_edit.png)\nEdit existing images based on textual descriptions, supporting local modifications and style adjustments.\n\n### Image Understanding Workflow\n![image understanding workflow](example_workflows/bagel_image_understanding.png)\nAnalyze and answer questions about image content, suitable for content understanding and information extraction.\n\n## Performance Comparison\n\n| Metric | BAGEL-7B-MoT (Standard Model) | BAGEL-7B-MoT (DFloat11 Quantized Model) |\n|--------|-------------------------------|-----------------------------------------|\n| Model Size | 29.21 GB | 19.89 GB |\n| Peak GPU Memory (1024x1024 image generation) | 30.07 GB | 21.76 GB |\n| Generation Time (on an RTX4090 GPU) | 482.95 seconds | 154.39 seconds |\n\nDFloat11 Quantized Model significantly reduces VRAM requirements and speeds up generation time, making it ideal for single GPU setups.\n\n## Related Links\n\n- [BAGEL Official Paper](https://arxiv.org/abs/2505.14683)\n- [BAGEL Model Homepage](https://bagel-ai.org/)\n- [Hugging Face Model](https://huggingface.co/ByteDance-Seed/BAGEL-7B-MoT)\n- [Online Demo](https://demo.bagel-ai.org/)\n- [Discord Community](https://discord.gg/Z836xxzy)\n\n## License\n\nThis project is licensed under the Apache 2.0 License. Please refer to the official license terms for the use of the BAGEL model.\n\n## Contribution\n\nContributions are welcome! Please submit issue reports and feature requests. If you wish to contribute code, please create an issue to discuss your ideas first.\n\n## FAQ\n\n### 1. VRAM Requirements \u0026 Optimization\nWith the new automatic memory management and quantization options:\n- **24GB GPU (Single)**: Use NF4 quantization or DFloat11 model for optimal performance\n- **12-16GB GPU**: Use NF4 quantization for best results (may require some CPU offloading)\n- **8GB GPU**: Limited support with NF4 + aggressive offloading\n- **Multi-GPU**: BF16 mode automatically distributes load across available GPUs\n- **Memory is calculated automatically** based on your hardware - no manual configuration needed!\n\n### 2. NameError: 'Qwen2Config' is not defined\nThis issue is likely related to environment or dependency problems. You can install flash-attention and triton with the following links:\n[v2.7.4.post1_crossos00](https://github.com/loscrossos/lib_flashattention/releases/tag/v2.7.4.post1_crossos00) [flash-attention-windows-wheel](https://huggingface.co/lldacing/flash-attention-windows-wheel/tree/main) [triton-windows-builds](https://hf-mirror.com/madbuda/triton-windows-builds/tree/main)\nFor more information, refer to [this GitHub issue](https://github.com/neverbiasu/ComfyUI-BAGEL/issues/7).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneverbiasu%2FComfyUI-BAGEL","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneverbiasu%2FComfyUI-BAGEL","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneverbiasu%2FComfyUI-BAGEL/lists"}