Run DeepSeek Janus-Pro 7B on Linux/Ubuntu Using ComfyUI

Run DeepSeek Janus-Pro 7B on Linux/Ubuntu Using ComfyUI

This guide provides detailed instructions for installing and running the DeepSeek Janus-Pro 7B model on a Linux/Ubuntu system using ComfyUI. Follow these steps to ensure a successful setup.

1. Prerequisites

Before starting the installation, ensure your system meets the following requirements:

  • Operating System: Ubuntu (or other Linux distributions).
  • NVIDIA GPU: Ensure you have a compatible GPU with CUDA support for optimal performance.
  • Python: Version 3.8 or higher.
  • Pip: Python package manager installed.
  • Git: Version control system installed.

Install Required Packages

Open your terminal and run the following commands to install Git, Python, and pip:

sudo apt update
sudo apt install git python3 python3-pip

If you need a specific version of Python (e.g., Python 3.10), you can install it with:

sudo apt install python3.10 python3.10-distutils

Install PyTorch with CUDA Support

To utilize your NVIDIA GPU, install PyTorch with CUDA support. Run the following command:

pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu118

2. Clone the ComfyUI Repository

Next, clone the ComfyUI repository from GitHub:

git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI

3. Install ComfyUI Dependencies

Inside the ComfyUI directory, install all required dependencies by running:

pip install -r requirements.txt

4. Install the ComfyUI-Janus-Pro Plugin

Download and Install the Plugin

Using ComfyUI Manager:

  1. Open ComfyUI by running python3 app.py in the terminal.
  2. Navigate to the “Plugins” section in the interface.
  3. Search for “Janus-Pro” and click on “Install.”

Manual Installation:

If you prefer manual installation, download the Janus-Pro plugin from its GitHub repository. Extract it into the ComfyUI/plugins directory.

5. Download DeepSeek Janus-Pro Model

Create a Hugging Face Account

To access certain models, you may need to create an account on Hugging Face.

Download Model Files

Search for "Janus-Pro-7B" on Hugging Face. Click on the model repository link and download all necessary files (typically .bin, .json, and configuration files).

Organize Model Files

Create a folder structure in your ComfyUI directory as follows:

📁 ComfyUI
├── 📁 models
│   ├── 📁 Janus-Pro
│   └── 📁 Janus-Pro-7B
│       ├── config.json
│       ├── preprocessor_config.json
│       ├── processor_config.json
│       ├── pytorch_model-00001-of-00002.bin
│       ├── pytorch_model-00002-of-00002.bin
│       ├── pytorch_model.bin.index.json
│       ├── special_tokens_map.json
│       ├── tokenizer.json
│       └── tokenizer_config.json

Ensure that all downloaded files are placed in their respective directories.

6. Launch ComfyUI

After setting up everything, you can launch ComfyUI:

  1. From the terminal, navigate to your ComfyUI directory if not already there.
  2. Run the following command to start ComfyUI:
python3 app.py

This will start a local server, typically accessible at http://localhost:8188.

7. Using DeepSeek Janus-Pro Model

  1. Open a web browser and go to http://localhost:8188.
  2. In the interface, select "Janus-Pro 7B" from the list of available models.
  3. Upload any required images or set prompts for generation.

Example Command to Generate Images

You can use a command in the prompt area like this:

generate_image(prompt="a futuristic cityscape", num_images=4)

This command will generate four images based on your prompt.

Troubleshooting Tips

  • Insufficient VRAM: If you encounter memory errors, consider using a smaller model or reducing image resolution.
  • Missing Dependencies: If you get errors about missing packages, ensure all required libraries are installed via pip.
  • Model Not Loading: Verify that all model files are correctly placed in their respective directories.

Additional Resources

For further assistance or updates:

  • Check out ComfyUI Documentation for detailed usage instructions.
  • Join community forums or Discord channels related to AI art generation for tips and troubleshooting help.

By following these detailed steps, you should be able to successfully install and run DeepSeek Janus-Pro 7B on your Linux/Ubuntu machine using ComfyUI!