A system to run prompt battles on stage.
Prompt Battle is a game show invented by Florian A. Schmidt and Sebastian Schmieg at HTW Dresden. It involves (at least) two players, who are presented with a challenge and then write a prompt to be fed to a text-to-image system such as OpenAI's DALL-E.
This system allows running prompt battles on stage. To do this, it contains
All information is updated live between the components, which means that the audience can see the prompts as the players type them.
npm install
— Installs the required packagesnpm run dev-backend
— To develop the backend — uses port 3000
npm run dev-frontend
— To develop the frontend (you might also want to run the backend at the same time) — uses port 5173
npm run lint
— Runs the linternpm run build
— Produces a production buildnpm run start
— Runs the system (requires a previous build)The system can be built and run using the provided Dockerfile.
docker build -t "prompt-battle-live" .
docker run --rm -ti -e OPENAI_API_KEY=[YOUR_OPENAI_KEY] -p 3000:3000 prompt-battle-live
The following settings can be adjusted using environment variables:
OPENAI_API_KEY
: the OpenAI access keyMODEL_NAME
: the OpenAI image generation model used, e.g. dall-e-2
(default) or dall-e-3
. To use dall-e-3
, your OpenAI account needs to be in at least Tier 1, i.e. $5 paid, due to rate limits.IMAGE_COUNT
: The number of images per user. Defaults to 2 for dall-e-2, not supported by dall-e-3 (always set to 1). Keep in mind the rate limits of OpenAI.These can either be set in your environment manually, in the docker run
command (see above), or in a .env
file — copy the .env.example
to .env
and fill out the information for this.
This project is not 100% stable but usable. Pull requests are welcome!