This uses the Flask web framework.
-
If you don’t have Python installed, install it from here.
-
Clone this repository.
-
Navigate into the project directory:
$ cd generative-stalagmite
-
Create a new virtual environment:
Linux:
$ python -m venv venv
-
Activate the environment
Linux:
$ . venv/bin/activate
Windows:
> .\venv\Scripts\activate
-
Install the requirements:
$ pip install -r requirements.txt $ pip install --upgrade openai
-
Make a copy of the example environment variables file:
$ cp .env.example .env
-
Add your API key to the newly created
.env
file. -
Run the app:
$ flask run
Now go to http://localhost:5000/stalagmite ! Each load of the page will generate a new stalagmite.
In order to batch create images, go to http://localhost:5000/stalagmiteBatch?prompt=stalagmite&num=4. num
is the number of images you want to create. OpenAPI support up to 10 images per request, so if you request more than 10, it will be divided into multiple requests. All the retrieved images will be stored in a folder named with current date in PNG format.
You can modify several parameters of this app in the .env file.
RESOLUTION=1024
Sets the horizontal and vertical resolution of the output image. Allowed values are 256,512 and 1024.