Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tirthankara

Project Overview

Tirthankara is a web application that creates retrofuturistic artwork using AI. Built with Flask and deployed on a home Kubernetes cluster, it provides a web interface for users to generate images by entering text prompts. The project demonstrates modern deployment practices using container orchestration on affordable hardware. There is also a GitHub Actions workflow for CI/CD in progress.

How It Works

Users can interact with Tirthankara in two ways:

  1. Through the web interface, where they can enter prompts and see generated images displayed with a carefully crafted gold-and-dark theme
  2. Through direct API calls, allowing programmatic access for automation or integration into other applications

The application handles all communication with Stable Diffusion using a single API key, so users don't need their own credentials.

Technical Details

The application is built using:

  • Flask for the web server
  • A custom-designed HTML/CSS interface
  • Kubernetes (K3s) for deployment
  • Two Orange Pi 3B boards for the computing cluster

File Structure

Tirthankara/
├── src/                    
│   └── webapp.py
├── kubernetes/            
│   ├── deployment.yaml
│   └── service.yaml
├── .github/workflows/deploy.yml
├── Dockerfile
├── requirements.txt
└── README.md

For Users

To use Tirthankara, simply:

  1. Visit the web interface at 'http://' (exact address will be updated after deployment -- currently the model is only deployed on a local network)
  2. Enter your prompt in the text field
  3. Click "Generate" to create your artwork

For programmatic access:

import requests

response = requests.post(
    "http://<cluster-ip>/generate",
    json={"prompt": "your artistic vision here"}
)

For Developers

If you want to run your own instance of Tirthankara:

  1. Clone the repository
  2. Set up a Kubernetes cluster (the project uses K3s on Orange Pi 3B boards)
  3. Create a secret with your Stable Diffusion API key:
kubectl create secret generic stability-api-secret \
  --from-literal=api-key='your-api-key'
  1. Deploy the application:
kubectl apply -f kubernetes/deployment.yaml
kubectl apply -f kubernetes/service.yaml

Deployment Environment

For local development:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Create a .env file with your API key and run:

STABILITY_API_KEY=your-api-key
python src/webapp.py

Project Goals

This project demonstrates:

  • Containerized application deployment
  • Kubernetes orchestration on affordable hardware
  • Secure API key management
  • Modern web interface design
  • Dual-mode access (web and API)

About

A Flask-based API gateway that interfaces with Stable Diffusion to generate retrofuturistic artwork (practice for deployment on Kubernetes home lab)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages