This Flask app allows you to generate images using the OpenAI API based on a given prompt. It uses the OpenAI GPT-3 API to create images based on the provided prompt.
-
Clone the repository:
git clone https://github.com/codewithdark-git/ai-image-generator-flask-app.git cd ai-image-generator-flask-app
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up your OpenAI API key:
- Open the
config.py
file and replaceYOUR_OPENAI_API_KEY
with your actual OpenAI API key.
- Open the
-
Run the Flask app:
python bot.py
The app will be accessible at
http://127.0.0.1:5000/
in your web browser.
Visit the home page to interact with the Ai Image Generator.
Make a request to the /generateimages/<prompt>
endpoint to generate images based on a specific prompt. For example:
- Open your browser and go to
http://127.0.0.1:5000/generateimages/your_prompt_here
.
The generated images will be displayed on the home page or as specified in your HTML and JavaScript code.
- Flask
- OpenAI
Ensure that you have a valid OpenAI API key and set it in the config.py
file.
@codewithdark-git
This project is licensed under the MIT License - see the LICENSE file for details.