Giter Site home page Giter Site logo

mj-remit's Introduction

MISSION

a Discord bot that serves as

  • proxy commander: forward imagine, upscale, variate, and reroll interactions to a paid Midjourney account
  • reactive listener: collect output messages from Midjourney Bot then process accordingly (interpret/persist/broadcast)

GETTING STARTED

  • Make a Discord bot, so called mjr-bot, get its token and install it into your Discord server of choice

  • Grab the Discord user token of the Discord account that is on a paid subscription to Midjourney

  • Clone .env-without-consul.example into your own .env and fill in correct values

    cp .env-without-consul.example .env
    vi .env
  • Install requirements (preferably within a virtualenv of python 3.11)

    pip3 install -r requirements.txt 
  • Run the main program

    python3 main.py
  • In a Discord channel where the mjr-bot is invited to, invoke command

    /lucky_imagine: a hippo is skating on an ice field, ultra realistic

CONTAINERIZATION

  • Build docker image
    docker build -t mj-remit:latest -f Dockerfile .
  • Run within a container
    docker run -d -ti --name mj-remit-prod --restart=always --env-file=.env --network="host" mj-remit:latest

DEVOPS NOTES

  • I use consul as the secret keeper here (check the example) but apparently you can run with your .env so please ignore the consul-example.json and .env-with-consul.example if not applicable
  • More work needs to be done to handle the queue limits stated in Midjourney Standard/Pro plan https://docs.midjourney.com/docs/plans
  • Feel free to make your own docker-compose.yml to incorporate all dependent services like mongodb and rabbitmq to simplify the deployment to production

DEFAULT SETTINGS

  • BROADCAST_AND_PERSIST_ENABLED = False means results are not persisted to db / published to msg queue. If you change this value to True, be sure to configure your mongodb & rabbitmq correctly.
  • USE_MESSAGED_CHANNEL = True means mjr bot will post the results into which ever guild-channel it was talked to, so in case of private channels, be sure it's invited & granted permissions to

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.