Create Your Imagination
AI-Powered Image Editing
No restrictions, just pure creativity. Browser-based and free!
3 min to read
JanusFlow 1.3B is a text-to-image generator developed by DeepSeek, designed to provide versatile image creation capabilities from textual prompts. It is a part of DeepSeek's Janus family of models, known for multimodal understanding and generation.
This article provides a comprehensive guide on how to install and set up JanusFlow 1.3B on a Linux system, ensuring you can leverage its potential for various applications.
Before starting the installation, ensure your Linux system meets the following requirements:
First, open your terminal and update the package list:
sudo apt update
Next, install Python 3.10 (if not already installed) and pip:
sudo apt install python3.10 python3-pip
Verify the installation:
python3.10 --version
pip3 --version
Clone the Janus project repository from GitHub:
git clone https://github.com/deepseek-ai/Janus.git
Navigate to the cloned directory:
cd Janus
Create a virtual environment to manage dependencies:
python3.10 -m venv venv
source venv/bin/activate
Upgrade pip and install required packages:
python3.10 -m pip install --upgrade pip
pip install -e .
pip install diffusers[torch]
Download the JanusFlow 1.3B model from Hugging Face:
wget https://huggingface.co/deepseek-ai/JanusFlow-1.3B/resolve/main/diffusion_pytorch_model.bin
Create a directory and move the model file:
mkdir -p ./model/JanusFlow-1.3B
mv diffusion_pytorch_model.bin ./model/JanusFlow-1.3B/
Create and edit a .env
file:
touch .env
Add the following line:
export IMAGE_MODEL_PATH="./model/JanusFlow-1.3B"
Load the environment variables:
source .env
Create a Python script named test_generate.py
:
import torch
from diffusers import StableDiffusionPipeline
model_id = "your_model_path/JanusFlow-1.3B"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")
prompt = "A futuristic cityscape, ultra detailed, photorealistic"
image = pipe(prompt).images[0]
image.save("futuristic_cityscape.png")
Replace "your_model_path/JanusFlow-1.3B"
with the actual model path and run the script:
python test_generate.py
JanusModelLoader
Error:sudo apt install git
.nvcc --version
.nvidia-smi
to track GPU performance.JanusFlow 1.3B is a powerful tool for text-to-image generation, offering endless possibilities for creativity and innovation. Whether you're generating art, designing prototypes, or exploring AI capabilities, JanusFlow 1.3B is a valuable addition to your toolkit.
Need expert guidance? Connect with a top Codersera professional today!