Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/longd3/mj-remit
a Discord bot that allows anyone on a server to interact with Midjourney Bot
https://github.com/longd3/mj-remit
Last synced: 3 months ago
JSON representation
a Discord bot that allows anyone on a server to interact with Midjourney Bot
- Host: GitHub
- URL: https://github.com/longd3/mj-remit
- Owner: longd3
- License: mit
- Created: 2023-03-02T06:30:34.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-11T08:02:26.000Z (almost 2 years ago)
- Last Synced: 2024-07-31T08:14:06.391Z (6 months ago)
- Language: Python
- Size: 14.6 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome - longd3/mj-remit - a Discord bot that allows anyone on a server to interact with Midjourney Bot (Python)
README
### MISSION
a Discord bot that serves as
- proxy commander: forward imagine, upscale, variate, and reroll interactions to a [paid Midjourney account](https://docs.midjourney.com/docs/plans)
- 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](https://www.writebots.com/discord-bot-token/) of choice
- Grab [the Discord user token](https://linuxhint.com/get-discord-token/) of the Discord account that is [on a paid subscription to Midjourney](https://docs.midjourney.com/docs/plans)
- Clone .env-without-consul.example into your own .env and fill in correct values
```bash
cp .env-without-consul.example .env
vi .env
```
- Install requirements (preferably within a virtualenv of python 3.11)
```bash
pip3 install -r requirements.txt
```
- Run the main program
```bash
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
```bash
docker build -t mj-remit:latest -f Dockerfile .
```
- Run within a container
```bash
docker run -d -ti --name mj-remit-prod --restart=always --env-file=.env --network="host" mj-remit:latest
```### DEVOPS NOTES
- I use [consul](https://www.consul.io/) 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