Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imigueldiaz/midjourney-prompt-generator
This is a Discord bot that utilizes OpenAI's GPT-3 API to generate creative prompts for MidJourney's AI image generation. It allows users to easily get prompt ideas in Discord by providing a natural language description. The bot is built with Discord.js and formats the AI-generated prompts to work seamlessly with MidJourney.
https://github.com/imigueldiaz/midjourney-prompt-generator
ai automation creativity discord discord-bot discord-js gpt-3 image-generation javascript midjourney nodejs prompt-engineering prompts
Last synced: 2 months ago
JSON representation
This is a Discord bot that utilizes OpenAI's GPT-3 API to generate creative prompts for MidJourney's AI image generation. It allows users to easily get prompt ideas in Discord by providing a natural language description. The bot is built with Discord.js and formats the AI-generated prompts to work seamlessly with MidJourney.
- Host: GitHub
- URL: https://github.com/imigueldiaz/midjourney-prompt-generator
- Owner: imigueldiaz
- License: gpl-3.0
- Created: 2023-07-10T10:37:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-27T15:50:48.000Z (2 months ago)
- Last Synced: 2024-11-27T16:42:43.977Z (2 months ago)
- Topics: ai, automation, creativity, discord, discord-bot, discord-js, gpt-3, image-generation, javascript, midjourney, nodejs, prompt-engineering, prompts
- Language: JavaScript
- Homepage:
- Size: 183 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# midjourney-prompt-generator
midjourney-prompt-generator is a Discord bot that uses the OpenAI GPT-3 API to generate prompts for MidJourney AI image generation.
## Usage
The bot has one slash command:
`/prompt`
This command takes the following options:
- `prompt` - The natural language prompt to generate an image for
- `ratio` (optional) - The aspect ratio for the generated image. Options are `--ar 16:9`, `--ar 9:20`, `--ar 3:2`, `--ar 4:5`
- `choices` (optional) - The number of prompt choices to generate, between 1-5For example:
`/prompt "A cute puppy sitting in a field of flowers" --ar 3:2`
This will generate a prompt like:
```
A cute puppy sitting in a field of flowers --ar 3:2
```The bot uses the OpenAI API to generate multiple prompt choices and returns them formatted for use with MidJourney.
## Installation
1. Clone the repository
```
git clone https://github.com/imigueldiaz/midjourney-prompt-generator.git
```2. Install dependencies
```
npm install
```3. Create a `.env` file with your [OpenAI API key](https://openai.com/api/)
```
OPENAI_API_KEY=sk-...
```## Configuration
Before running the bot, you need to create a `config.json` file in the root directory of the project. This file is not included in the GitHub repository for security reasons. The `config.json` file should have the following structure:
```json
{
"token": "",
"clientId": "",
"guildId": ""
}
```
Each of the values in the `config.json` file can be obtained as follows:- `token`: This is your Discord bot token, which authorizes your bot to connect to Discord. You can obtain it from the [Discord Developer Portal](https://discord.com/developers/applications).
- `clientId`: This is the Client ID of your Discord application, which can also be obtained from the [Discord Developer Portal](https://discord.com/developers/applications).
- `guildId`: This is the ID of your Discord server (also known as a guild). You can obtain it by right-clicking your server name in the Discord app and selecting 'Copy ID'.Please replace ``, ``, and `` with your actual values.
4. Run the bot
```
npm start
```5. Add the bot to your Discord server
## Credits
- [OpenAI](https://openai.com/) for the GPT-3 API
- [MidJourney](https://www.midjourney.com/) for the AI image generation
- [Discord.js](https://discord.js.org/) for the Discord bot framework## License
This project is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details.