Giter VIP home page Giter VIP logo

promptbattle-app's Introduction

Prompt Battle App

This is a little Sveltekit Application to support your local Prompt Battle event.

What is a Prompt Battle?

A Prompt Battle is a playful event where contestants compete against each other using text-to-image technology and predefined challenges.

The prompt Battle event format was developed in 2022 by Florian A. Schmidt & Sebastian Schmieg together with a team of students of HTW Dresden: Bernadette Geiger, Ella Zickerick, Emily Krause, Levi Stein, Lina Schwarzenberg, Robert Hellwig. Check out their website promptbattle.com!

Since then, the Prompt Battle format has been remixed and further developed in several places by other people and teams, e.g. at the AI+D Lab at Hochschule für Gestaltung Schwäbisch Gmünd!

Every Prompt Battle is different, be it the underlying technology, the game logic, or the wording of the challenges!

Features:

  • Webserver to serve different clients/screens
  • Admin interface for the "battle master"
  • Websockets for synchronised prompt submission (without the contestants having to click 'generate') and winner confetti 🎉
  • Access to text-to-image APIs such as DALL-E and Stable Diffusion

Set up

  1. Install the dependencies via npm install
  2. Configure your txt2img APIs! Create an .env File and add the necessary environment variables, e.g.
    • for DALL-E you would need to set OPENAI_API_KEY (given that you have an OpenAI Account) and possibly also your OPENAI_ORG_ID. You can generate your DALL-E API key here: https://platform.openai.com/account/api-keys
    • for Stable Diffusion you would need to set SD_API_URL (given that you host your own SD API, more info how to do that below)

(Optional) Hosting your own Stable Diffusion API with automatic111

We have included a Stable Diffusion API Client which expects as an API: automatic111's public GRADIO API. In order to run this API, install automatic111 on your favorite runtime (own server, Google Colab, etc.) and enable API access by launching it with a generous cors flag: ./webui.sh --share --cors-allow-origins=*

During the Prompt Battle event:

As a temporary workaround, we recommend running the app in (Vite's) dev mode during the event, and sharing it with the network, so different clients (contestants, battle admin, etc.) can access the app.:

npm run battle:dalle starts the prompt battle with DALL-E as the image engine

npm run battle:sd starts the prompt battle with Stable Diffusion as the image engine

Running on windows

Windows has a different ways of setting environment variables You need to modify package.json: "battle:dalle": "set VITE_IMAGE_ENGINE=dalle& vite dev --host" and: "battle:sd": "set VITE_IMAGE_ENGINE=sd& vite dev --host" Note the "set" before the environment variable name, and the "&" right after the value (without whitespace)!

Screens (aka Routes)

/admin

This is the interface for the "Prompt Master", to trigger "Generate!", launch the winner confetti 🎉 and more!

/player1

This is the interface for player 1

/player2

This is the interface for player 2

/audience1

This is the screen that mirrors what player 1 is doing

/audience2

This is the screen that mirrors what player 2 is doing

promptbattle-app's People

Contributors

alexabruck avatar

Watchers

 avatar  avatar  avatar

promptbattle-app's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.