Python AI Prompt-to-Image Generaton

Python AI Prompt-to-Image Generaton

Demo

Demo Video: youtu.be/iz-YDlU6j4Y

Stack

Python: 3.12.3

Flask: 3.0.3

How to Run?

git clone git@github.com:sannjayy/ai-prompt-to-image-generator.git

  • Create a virtual environment
python -m venv zenv
source zenv/Scripts/activate # Windows
source zenv/bin/activate # Mac
  • Install basic requirements
pip install -r requirements.txt

# OR INITIAL INSTALLATION

pip install --upgrade pip
pip install --upgrade setuptools

pip install transformers diffusers flask pillow
  • Install PyTorch (CUDA)
# CUDA 12.1 (Windows)
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

# CUDA 11.1 (Windows)
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

# MAC
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu

# OR (Others)
pip install torch torchvision

To Run

python app.py

Open http://127.0.0.1:5000 in your browser!