This project demonstrates the creation of a "Text to Image" application using Python, OpenAI, and Streamlit. The following technologies and services are used:
Streamlit
as a server and handling front end.- OpenAI API key from
OpenAI
. DALL.E-2
model for text-to-image generation.AWS EC2
for deployment (24/7 running).
- Create free accounts on OpenAI and AWS.
- Create a Streamlit App.
- Create an EC2 instance on AWS.
- Git clone this repository on the EC2 instance.
- Install the requirements.
- Use the
OPENAI_API_KEY
in your code (avoid using static values, use global variables). - Run the script on the EC2 instance.
To use this project:
- Clone the repository.
- Open a terminal in the working directory.
- Run the following command to install the required dependencies:
pip install -r requirements.txt
- Set the
OPENAI_API_KEY
as a global variable in your environment (replace-------API KEY--------
with your actual API key):export OPENAI_API_KEY="-------API KEY--------"
- The
App.py
file contains the Streamlit application. - Run the script with the following command:
nohup python3 streamlit run App.py --server.port 80
- To stop the running application:
- Get the process ID of the running process:
ps -ef
- Kill the process using its ID:
kill [PROCESS_ID]
- Get the process ID of the running process:
For a more detailed explanation of this project, refer to the tutorial on the Machine Learning Hub YouTube channel.
If you find this project helpful, consider supporting me:
- Buy me a Coffee☕
- Donate via PayPal (It will inspire me to work on more projects)
Feel free to follow me and star⭐ this repository!