This is a Node.js application for automatically generating images using Midjourney. This repository is for educational purposes only.
Disclaimer: This project is the result of a short tinkering. The code is not really well structured, but worked for my use case. When I find the time, I will do a refactoring. In the meantime, maybe the code will help you as a starting point for other projects.
Follow the steps below to set up the application.
- Node.js
- npm
- Invite the Midjourney bot to your own Discord server.
- Create a new text channel on your server.
- Copy the text channel ID for later use in the
.env
file. - Set Midjourney generation to public using the
/public
command. - Adjust your desired Midjourney version and quality settings using the
/settings
command.
- Clone the repository:
git clone https://github.com/johanneslo1/midjourney-automatic-image-generation.git
- Navigate to the project directory:
cd midjourney-automatic-image-generation
- Install the dependencies:
npm install
- Copy the
.env.example
file and rename it to.env
:
cp .env.example .env
- Open the
.env
file and set the required environment variables:
CHANNEL_ID
: The Discord channel ID where the images will be posted (from step 3 of "Before Installation").GUILD_ID
: The Discord server ID.OPENAI_API_KEY
: Your OpenAI API key.OPENAI_ORGANIZATION
: Your OpenAI organization ID.DISCORD_AUTHORIZATION_TOKEN
: Your Discord authorization token. Here is a guide on how to get yours.
Run the application:
npm run start
The application will generate images using Midjourney and post them to the specified Discord channel.
Using this application with your personal Discord account to automate tasks is against Discord's Terms of Service. This repository is for educational purposes only, and you should not use it in a way that violates Discord's policies.