The Midjourney Prompt Generator is a Python-based application that allows users to generate high-quality prompts for Midjourney, an AI tool for creating artistic images. This tool integrates with the Gemini API to generate prompts based on user inputs.
The Midjourney Prompt Generator is designed to help users create prompts for the Midjourney AI, which can be used to generate artistic images. The application provides a user-friendly interface for entering various prompt parameters and generates refined prompts ready for use with Midjourney.
- User-Friendly Interface: A Streamlit web app that allows easy input of prompt parameters.
- Customizable Prompts: Users can specify various elements such as base idea, art style, mood, and more.
- API Integration: Utilizes the Gemini API to generate prompts.
- Prompt Management: Generates and displays multiple prompts based on user specifications.
- Python 3.7 or later
- Streamlit
python-dotenv
for environment variable managementgoogle-generativeai
for Gemini API integration
-
Clone the Repository:
git clone https://github.com/Nafi7393/Midjourney-Prompt-Builder.git cd Midjourney-Prompt-Builder
-
Create a Virtual Environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies:
pip install -r requirements.txt
-
Create a
.env
File: Create a.env
file in the root directory of the project and add your Gemini API key:GEMINI_API_KEY=your_gemini_api_key
-
Streamlit: Make sure you have Streamlit installed to run the web interface. If not, install it using:
pip install streamlit
-
Run the Application:
streamlit run app.py
- Open the Application:
Navigate to
http://localhost:8501
in your web browser to access the Streamlit app. - Input Parameters:
- Base Idea: Enter the core concept for the artwork.
- Art Style: Specify the desired art style (e.g., pop art, surrealism).
- Mood or Theme: Describe the mood or theme of the artwork.
- Specific Elements: Add any specific elements to be included in the artwork.
- Emotion or Feeling: Specify the emotion or feeling to evoke.
- Color Palette: Choose the color palette for the artwork.
- Additional Details: Provide any additional details to enhance the prompt.
- Composition Style: Define the composition style of the artwork.
-
Generate Prompts: Click the "Generate Prompts" button to create prompts based on your inputs.
-
View Results: The generated prompts will be displayed in the app, ready for use with Midjourney.
Below is a demo showcasing the generated prompts and corresponding images. The images are for visualization purposes and demonstrate the potential output of using the generated prompts with Midjourney.
Note: The project only generates prompts. You need to use Midjourney to create the actual images based on these prompts.
The Gemini API is used to generate prompts for Midjourney. To use this tool, you need an API key from Gemini. You can obtain your API key by following the instructions in the Gemini API Documentation.
Steps to Get an API Key:
- Visit the Gemini API Key page.
- Sign in with your Google account.
- Follow the instructions to generate and obtain your API key.
Contributions are welcome! If you would like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature
). - Make your changes and commit them (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/your-feature
). - Create a new Pull Request.