This project is a Flask application that allows users to generate images using the DALL-E 2 API and manage their own gallery of generated images.
- Generate images using the DALL-E 2 API.
- Save and manage generated images.
- View a gallery of all generated images.
- Generate descriptions for the images.
-
Clone the repository:
git clone https://github.com/AKhart1/DALLE-WZIM.git cd gallery-generator
-
Create and activate a virtual environment::
python -m venv venv source venv/bin/activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up environment variables:
Create a '.env' file in the root directory of the project and add your OpenAI API key:
MY_SECRET=your_openai_api_key_here
-
Create necessary directories and files:
mkdir -p app/static/generated_images echo '{"images": []}' > app/image_data.json
Start the Flask application by running:
pyton ./app/main.py
or
uvicorn app.main:app --reload
The application will be accessible at http://127.0.0.1:5000.
- Navigate to http://13.60.129.45:5000.
- Enter a prompt in the input field and submit.
- The generated image will be displayed on the page.
- Navigate to http://13.60.129.45:5000/get_images to view the list of all generated images in JSON format.
The application uses the following environment variables:
MY_SECRET
: Your OpenAI API key.
gallery-generator/
├── app/
│ ├── static/
│ │ └── generated_images/
│ ├── templates/
│ │ └── index.html
│ ├── image_data.json
│ ├── __init__.py
│ ├── auto-prompt.py
│ └── main.py
├── .env
├── requirements.txt
└── README.md
- Flask
- requests
- python-dotenv
- Pillow
- Boto3
Install the dependencies using:
pip install -r requirements.txt
This project is licensed under the MIT License. See the LICENSE file for details.
The application is deployed on an AWS EC2 instance, utilizing the following AWS services and configurations:
- IAM Roles: Secure access management for the EC2 instance.
- Elastic IPs: Static IP address for reliable access.
- Security Groups: Firewall rules to control traffic to the EC2 instance.
- Secret Manager: Secure sensetive data as tokens, passwords and etc.
Feel free to contribute to the project by creating pull requests or opening issues for any bugs or feature requests. Enjoy generating your own gallery of images!