Giter Club home page Giter Club logo

sinner's Introduction

SINner Readme

Animation.gif

This project is still work in progress. If you see something strange or something isn't working just write me! I am always eager to help, even for small things.

SINner is an application to create NPCs for Shadowrun Pen&Paper. It uses GPT for NPCs description, and midjourney to create images. The image generation is a bit of manual labor currently, since there is no actual API.

The backend is Python based (Django), while the frontend uses React and Arwes (https://arwes.dev/).

Installation

Environment Variables

Invite a midjourney bot to your server: https://docs.midjourney.com/docs/invite-the-bot I recommend setting up a private channel to not disturb anyone.

Please set those ENV variables. I recommend using a .env file.

ENV Variable Description
OPENAI_API_KEY Create and copy the api key from: https://platform.openai.com/account/api-keys
MJ_SERVER_ID Your Discord server ID (right click on server -> Copy ID)
MJ_CHANNEL_ID Your Discord channel ID (right click on channel -> Copy ID)
MJ_PRIVATE_DISCORD_TOKEN see https://linuxhint.com/get-discord-token/ how to get it
DJANGO_SECURE_KEY from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())
DJANGO_HOST localhost or your domain
DJANGO_PORT like, 8000 or 80

Frontend

Download and Install NPM: https://www.npmjs.com/

cd frontend
npm install

Then you can run it with npm start. If there is no Backend running, it will result in an error page. Look into frontend/README for further instructions.

Backend

Download and Install Python: https://www.python.org/

(if you installed the frontend previously, don't forget to go back into the project root, with cd ..)

pip install -r backend\requirements.txt
cd backend
python manage.py runserver

It will create one npc and then start the flask backend server. However, at the moment the image won't be created. This is still WIP.

Also, please take a look at the backend/README.

Costs

GPT-3.5 costs $0.002 / 1K tokens. One NPC call is around 1.3K tokens. Even with planned changes and additional features, it will be around 0.01$ per npc creation.

Midjourney costs 8$ for ca. 200 generations in the cheapest subscription plan. This means 0.04$ per NPC, but you can choose between 4 images.

In summary, it costs around 0.05$ per NPC creation.

I would like to add other AI image generators, so if you have experience with other AI image generators, please let me know. I have tried DALL-E 2, but the results are not suitable.

Docker

Creates a volume to store the current database (sqlite) and the images docker volume create sinner-data

use the dockerscript.sh to run everything.

sinner's People

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.