Deploying Deepseek Janus Pro locally



Image by Author

 

Deepseek Janus-Pro has been released, an advanced version of Janus that significantly improves multimodal understanding and visual generation. This means you can use this model to comprehend every detail in an image and prompts to generate highly realistic images—offering a two-in-one solution. Additionally, it is based on a language model, allowing you to use it for language and image understanding and image generation capabilities.

In this tutorial, we will install Desktop, build a custom Docker image, use the image to run the Docker container, and test various capabilities of the Janus-Pro model.

 

1. Installing Docker

 
Go to the https://www.docker.com/ website and download and install Docker Desktop with the default settings. If you are on Windows, Docker Desktop will prompt you to install WSL (Windows Subsystem for Linux) so you can run most container images on Linux.

 

2. Building Docker Image

 
I have already created the Dockerfile and forked the original repository, so you don’t have to. All you need to do is clone my repository, change into the directory, and build the image using the Dockerfile.

# Clone the Janus repository
git clone https://github.com/kingabzpro/Janus.git
# Navigate into the Janus directory
cd Janus
# Build the Docker image with the tag 'janus'
docker build -t janus .

 

It will take a few minutes to build everything.

 

Deploying Deepseek Janus Pro locally

 

Once the image is built, you can go to the Docker Desktop application and click on the “Images” tab to see your image.

 

Deploying Deepseek Janus Pro locally

 

3.  Running Docker Container 

 
Now, we will run the Docker container using our image. We will specify the port number, set up persistent storage, and allow access to all GPUs using CUDA.

# Run the Docker container with persistent storage
docker run -it --rm -p 7860:7860 \
--gpus all \
--name janus_pro \
-e TRANSFORMERS_CACHE=/root/.cache/huggingface \
-v huggingface:/root/.cache/huggingface \
janus:latest

 

It will take a few seconds, and your app will be running in the Docker container. 

 

Deploying Deepseek Janus Pro locally

 

You will need to wait a few minutes for your Docker container to download the model and then run the Gradio application.

 

Deploying Deepseek Janus Pro locally

 

4. Testing Janus Pro for Image Understanding 

 
Once everything is done, you will see that your app is running at the URL: http://localhost:7860/. The Janus Pro application has two sections: one for image understanding and one for image generation. 

We can upload an image and ask it to write a poem based on the image. 

 

Deploying Deepseek Janus Pro locally

 

The results are impressive—it’s small but powerful.

 

Deploying Deepseek Janus Pro locally

 

5. Testing Janus Pro for Image Generation

 
Scroll down in the application, and you will see the image generation section. Type your prompt and press the “Generate Image” button to generate four images based on the sample prompt.

 

Deploying Deepseek Janus Pro locally

 

The results are outstanding—highly detailed! With this multimodal model, you get tremendous value for your model parameters. 

 

Deploying Deepseek Janus Pro locally

 

Here is the full image that you can download and use as an iPhone wallpaper.

 

Deploying Deepseek Janus Pro locally

 

 

Conclusion

 
Janus Pro is a one-of-a-kind model, and DeepSeek is doing an amazing job producing state-of-the-art models that are changing the face of the AI world. In this guide, we learned about Janus Pro, set up the environment to build the Docker image, ran the application in the Docker container, and tested both the image understanding and generation features.
 
 

Abid Ali Awan (@1abidaliawan) is a certified data scientist professional who loves building machine learning models. Currently, he is focusing on content creation and writing technical blogs on machine learning and data science technologies. Abid holds a Master’s degree in technology management and a bachelor’s degree in telecommunication engineering. His vision is to build an AI product using a graph neural network for students struggling with mental illness.

Recent Articles

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here