Running DeepSeek Janus Pro 1B on MacOS with ComfyUI

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):

  1. Launch ComfyUI β†’ Click Manager β†’ Install Custom Nodes
  2. Search: Janus-Pro β†’ Click Install

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

  1. Download Model Files from Hugging Face:
    https://huggingface.co/deepseek-ai/Janus-Pro-1B
  2. File Structure Setup:
ComfyUI/
└── models/
    └── Janus-Pro/
        └── Janus-Pro-1B/
            β”œβ”€β”€ config.json
            β”œβ”€β”€ pytorch_model.bin
            β”œβ”€β”€ tokenizer.json
            └── # Other downloaded files
  1. Verify Model Detection:
    Launch ComfyUI β†’ Check Checkpoint 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

  1. Create New Workflow β†’ Add Nodes:
    • JanusProLoader β†’ Select "Janus-Pro-1B"
    • CLIPTextEncode β†’ Enter prompt: "A cyberpunk cat wearing VR goggles"
    • JanusImageGeneration β†’ Set resolution: 768x512
    • PreviewImage β†’ Connect output
  2. Execution Tips:
    • Use Japanese prompts: "ε‡ΊεŠ›γ―ζ—₯本θͺžγ§" in text input
    • For complex prompts, enable Advanced Mode β†’ Increase guidance_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

  1. Hybrid Workflows: Combine Janus Pro with ControlNet for pose-specific generation
  2. API Integration: Use ComfyUI's REST API for batch processing
import requests
response = requests.post('http://localhost:8188/prompt', json={"prompt": workflow_json})
  1. 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.