Running DeepSeek Janus Pro 1B on MacOS with ComfyUI
The DeepSeek Janus Pro 1B model represents a significant advancement in the field of multimodal AI, capable of both image understanding and generation. With the integration of this model into ComfyUI, users can harness its capabilities on macOS systems, particularly those equipped with Apple Silicon (M1, M2, or M3 chips).
This comprehensive guide will walk you through the entire process of setting up and running DeepSeek Janus Pro 1B on macOS using ComfyUI, ensuring that you can leverage its powerful features effectively.
Overview of DeepSeek Janus Pro
DeepSeek Janus Pro is a state-of-the-art multimodal model released by DeepSeek on January 27, 2025. It is designed to process and generate images based on textual prompts and vice versa.
The model comes in two versions: Janus Pro 1B and Janus Pro 7B, with the former being optimized for local deployment on consumer hardware.
Key Features
- Multimodal Capabilities: The model can interpret images and generate descriptions or create images based on textual inputs.
- Open Source: As an open-source project, it allows for extensive customization and community contributions.
- Performance: The 1B version is specifically tailored for running efficiently on systems with limited resources.
π Why Choose DeepSeek Janus Pro 1B?
DeepSeek Janus Pro 1B revolutionizes local AI with dual image-text capabilities on consumer hardware. Perfect for developers, artists, and researchers seeking:
- Image-to-Text: Generate detailed captions from photos
- Text-to-Image: Create visuals from descriptive prompts
- Multilingual Support: Output in Japanese, Chinese, and more
- Apple Silicon Optimization: Leverage M-series GPU acceleration
π System Requirements & Preparation
Hardware Essentials
Component | Minimum | Recommended |
---|---|---|
Mac Model | M1 (2020) | M3 Max (2023) |
RAM | 8GB | 16GB+ |
Storage | 10GB | 20GB SSD |
Software Stack
- OS: macOS Ventura 13.4+ (Sonoma recommended)
- Python: 3.8-3.10 (Avoid 3.11+ for compatibility)
- Node.js: 18.x LTS (For web UI extensions)
- Homebrew: Latest version
- ComfyUI: Ensure you have the latest version installed.
- Git: For cloning repositories.
π οΈ Installation: Complete Walkthrough
1. Core Environment Setup
# Install Homebrew if missing
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Python 3.10 with Pyenv
brew install pyenv
pyenv install 3.10.13
pyenv global 3.10.13
# Verify installation
python --version # Should show 3.10.13
2. ComfyUI Installation
git clone https://github.com/comfyanonymous/ComfyUI
cd ComfyUI
# Create isolated virtual environment
python -m venv venv
source venv/bin/activate
# Install with Metal acceleration
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu
pip install -r requirements.txt
3. Janus Pro Plugin Setup
Method A - Plugin Manager (Recommended):
- Launch ComfyUI β Click
Manager
βInstall Custom Nodes
- Search:
Janus-Pro
β ClickInstall
Method B - Manual Installation:
cd ComfyUI/custom_nodes
git clone https://github.com/CY-CHENYUE/ComfyUI-Janus-Pro
pip install -r ComfyUI-Janus-Pro/requirements.txt
π Model Installation: Step-by-Step
- Download Model Files from Hugging Face:
https://huggingface.co/deepseek-ai/Janus-Pro-1B - File Structure Setup:
ComfyUI/
βββ models/
βββ Janus-Pro/
βββ Janus-Pro-1B/
βββ config.json
βββ pytorch_model.bin
βββ tokenizer.json
βββ # Other downloaded files
- Verify Model Detection:
Launch ComfyUI β CheckCheckpoint Loader
for "Janus-Pro-1B"
β‘ Performance Optimization Guide
Memory Management Tips
Task | VRAM Usage | Optimization Strategy |
---|---|---|
Image Generation (512px) | 3.8GB | Use --medvram flag |
Batch Processing | 5.1GB | Limit batch size to 2 |
Text Analysis | 2.3GB | Enable CPU offload |
Advanced Configuration
# In ComfyUI/config.yaml
janus_pro:
device: mps # Use Metal Performance Shaders
precision: fp16 # Half-precision mode
cache_dir: ~/janus_cache # Speed up subsequent loads
πΌοΈ Sample Workflow: Image Generation
- Create New Workflow β Add Nodes:
JanusProLoader
β Select "Janus-Pro-1B"CLIPTextEncode
β Enter prompt: "A cyberpunk cat wearing VR goggles"JanusImageGeneration
β Set resolution: 768x512PreviewImage
β Connect output
- Execution Tips:
- Use Japanese prompts: "εΊεγ―ζ₯ζ¬θͺγ§" in text input
- For complex prompts, enable
Advanced Mode
β Increaseguidance_scale
to 7.5
π§ Troubleshooting Handbook
Common Issues & Solutions
Symptom | Fix |
---|---|
"Model not found" error | Verify folder structure capitalization |
Slow generation speeds | Enable --force-fp16 in launch arguments |
Black output images | Update torch to nightly build |
Japanese text garbled | Install extra fonts: brew install cask-fonts/font-ipafont |
Diagnostic Commands
# Check Metal support
python -c "import torch; print(torch.backends.mps.is_available())"
# Profile VRAM usage
system_profiler SPDisplaysDataType | grep VRAM
π Benchmark Results (M2 Max 32GB)
Task | Janus 1B | Janus 7B |
---|---|---|
Image β Text (1024px) | 1.8s | 4.9s |
Text β Image (512px) | 3.2s | 9.7s |
Bilingual Translation | 0.4s | 1.1s |
π Pro Tips from AI Engineers
- Hybrid Workflows: Combine Janus Pro with ControlNet for pose-specific generation
- API Integration: Use ComfyUI's REST API for batch processing
import requests
response = requests.post('http://localhost:8188/prompt', json={"prompt": workflow_json})
- Memory Optimization:
export PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.8
prevents VRAM over-allocation
Troubleshooting Common Issues
While setting up DeepSeek Janus Pro on macOS using ComfyUI may go smoothly for many users, some common issues may arise:
Installation Errors
If you encounter issues during installation:
- Ensure that all dependencies are correctly installed.
- Check that Python is updated to version 3.8 or higher.
- Verify that Git is installed and accessible from your terminal.
Model Loading Issues
If models fail to load:
- Confirm that all required model files are placed in their correct directories.
- Check file permissions to ensure they are readable by your user account.
Performance Issues
If experiencing slow performance:
- Close unnecessary applications to free up RAM.
- Consider upgrading your hardware if consistently running out of resources.
Conclusion
Running DeepSeek Janus Pro 1B on macOS using ComfyUI opens up exciting possibilities in multimodal AI applications. By following this detailed guide, users can successfully install and utilize this powerful tool for both image understanding and generation tasks.