Discord bot generating AI art collages
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
Simple discord bot which generates collages based on any query you give it (most of the time). This bot uses model which you can find here
- Typescript
- Discord.js
- Collage
- Canvas
- amqp-client.js
- Sentry.io
- Jest
- Codecov
- Docker
- NestJs
- Compodoc
- Mongo
- TypeORM
- GraphQl
This is an example of how to list things you need to use the software and how to install them.
- npm
npm install npm@latest -g
-
Create Discord application on a free API Key at https://discord.com/developers/
-
Click on Bot tab and save your token.
-
Clone the repo
git clone https://github.com/karafra/ai-art.git
-
Install NPM packages
npm install
-
Enter your API key and bot id into config.yml.
sentry: dsn: "{SENTRY_DSN}" # This one is optional ... only if you want to use ai-story command openAi: token: ... amqp: url: "{AMQP_URL}" discord: token: "{DISCORD_TOKEN}" deploy: port: "{PORT}"
Configuration file supports simple environment variable substitution in format "{VARIABLE_NAME}", where parentheses are required.
Recommended method of deploying this bot is deployment on Heroku. To deploy to Heroku please click on button bellow.
After successful deployment you will have to switch dyno from web
to worker
. If you do not do this, app will not bind to port and fail.
After successful deployment you can invite bot to your server by clicking on this link https://discord.com/api/oauth2/authorize?client_id={CLIENT_ID}&permissions=34816&scope=applications.commands%20bot
, where CLIENT_ID
is your bots client id. Link already contains minimal scopes (bot, application.commands) and minimal bot permissions (send messages, attach files)
Another even easier method of deployment is deployment via docker container.
-
Verify docker-compose installation
A] Type
docker-compose -v
into terminal. if output looks similar todocker-compose version 1.29.2, build 5becea4c
then you can continue to the next step.B] If this command throws an error, you have to follow docker-compose installation guide
-
Set required variables
- Only required variables is
TOKEN
, this can be set as environment variables usingexport ENV_NAME=VALUE
on linux based OS or$env:VARIABLE_NAME=VALUE
on Windows based OS
- Only required variables is
-
Building Docker containers
- Type
docker-compose -f "docker/deploy/docker-compose.yml" build
into terminal, this will automatically build all required docker images.
- Start container
-
Type
docker-compose -f "docker/deploy/docker-compose.yml" up
into terminal. This will start all services needed. RabbitMQ management console will be accessible here with login credentials being:- username:
guest
- password:
guest
- username:
-
MongoDb management console will be accessible here without any login credentials
-
This network is not external, so it will not be accessible from outside.
Commands are separated into 2 command groups
-
help
- Help command -
/ai-art
cog-view-2
- Generates collage of 9 images using CogView2 modeldalle-mini
- Generates collage of 9 images using Dall-e mini modelwombo-dream
- Generartes one image based on WomboDream model
-
/ai-story
story
- Generates story from given headline (Requires OpenAi API) token
-
React with ✉️ to any collage and bot will dm it to you.
Discord offers autocompletion so all you need is to start typing name of the command or group in which command is, discord will then guide you through all the required parameters using its autocompletion.
For more examples, please refer to the Documentation
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the Apache2.0 License. See LICENSE for more information.
Your Name - @Karafro - dariusKralovic@protonmail.com
Project Link: https://github.com/karafra/ai-art
- DALL·E Mini
- Image generation model for
/ai-art dalle-mini
- Image generation model for
- CogView2
- Image generation model for
/ai-art cog-view-2
- Image generation model for
- Open Ai
- Story generation model for
/ai-story story
- Story generation model for
- WomboDream
- Art generation model for
ai-art wombo-art
- Art generation model for