/art-generated

Flask app to use DALL·E Images API

Primary LanguagePython

Create AI Art 🤖🎨

Flask app to generate images with the OpenAI DALL·E Images API.

Built with

Get Started

Prerequisites

Setup

  1. Fork art-generated
  2. Create a local clone of the forked repository
  3. Using the terminal, move into your local copy
cd art-generated

🚨 Flask installed globally can cause 'Module not found' errors inside the venv. Consider pip3 uninstall flask

  1. Create a virtual environment

MacOS/Linux

python3 -m venv venv
. venv/bin/activate

Windows

py -3 -m venv venv
venv\Scripts\activate
  1. Install dependencies
pip3 install -r requirements.txt
  1. Rename .env-copy to .env
mv .env-copy .env
  1. Create an OpenAI account and fill in .env
OPENAI_API_KEY='<your api key>'
OPENAI_ORG_ID='<your organization>'
  1. Create initial database migration
flask db init
flask db migrate -m "Initial migration."

When changes are made to the database model, run flask db upgrade1

  1. Run the app
flask --debug run
  1. Generate images on the browser! 🎉

Screenshots

Homepage homepage
Generated Image image
Image History history