MBEL ("Mabel") is a picture book generator app based on the OpenAI API quickstart tutorial. It uses the Flask web framework. Follow the instructions below to setup the app.
-
If you don’t have Python installed, install it from here.
-
Clone this repository.
git clone https://github.com/mbloom23/mbel-gpt-flask.git
-
Navigate into the project directory:
cd mbel-gpt-flask
-
Create and activate a new virtual environment:
python -m venv venv . venv/bin/activate # Mac # for Windows venv\Scripts\activate
-
Install the requirements:
pip install -r requirements.txt
-
Make a copy of the example environment variables file:
cp .env.example .env # for Windows copy .env.example .env
-
Add your API key to the newly created
.env
file.export OPENAI_API_KEY='YOUR_API_KEY_HERE'
Note: you may need to deactivate and reactivate your virtual environment here before running the app.
-
Run the app:
flask run
You should now be able to access the app at the URL displayed in your terminal! Enter a topic or premise for your story in the box, press enter, and wait for the generation to load. Try describing different plot points, characters, or morals for your story.