Skip to content

tiffanyfay/lets-generate-art

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Gen Demo

At a very high level, this demo uses generative AI with OpenAI to take in prompts, generates images with Dall-E and places them into a database. It consists of three parts, which are explained later.

Table of Contents

Prerequisites

Have the following CLIs:

TODO: add kubens to not need -n gen

Other:

  • An OpenAI API key and API access

TODO: add docs link

Infrastructure

We will need a:

  • Kubernetes cluster
  • Container registry
  • PostgreSQL database

Set up DigitalOcean Infrastructure

If you use the Hivenetes k8s boostrapper you can have it create all of these resources for you:

  1. Clone https://github.com/hivenetes/k8s-bootstrapper
  2. Follow the Terraform instructions

Note: Enable the database in bootstrapper.tfvars before running terraform plan. You can also enable the container registry if you want to use it instead of Docker Hub.

Architecture

Applications

Launcher

This application takes in prompts for OpenAI and launches jobs for each prompt.

Image Generator and Database store

This app uses bash to talk to the OpenAI API to create a Dall-E image. It then stores these prompts and image URLs into a database.

Database

This is a Java application that uses Spring Data and Spring Web to create a database table and REST endpoint to make GET and POST requests. It's specifically for a PostgreSQL database.

Things to do

  1. Create gen namespace
    kubectl apply -f k8s/namespace.yaml
  2. Create and run database app
  3. Create and run image generator and store app
  4. Create and run launcher app
  5. Observability

TODO

Mandatory by VMware Explore/SpringOne talk

  • Display prompts and URLs as images on webpage
  • Convert all bash to Java+Spring

Ideal by Explore

  • Use secrets for OpenAI key

Future work

  • Use DigitalOcean spaces to store secrets
  • Use secrets for database application.properties
  • Create service account vs using default one
  • Have a webpage to put prompts into vs running a pod
  • Add image creation dates so the database can drop anything that has a timestamp before a current subset -- e.g. OpenAI Dall-E only stores images for an hour, so after this, the URLs don't work.
  • Add tests

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published