Skip to content

Spidy20/DALLE_Image_Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DALL·E 2 Image Generator Python App

forthebadge made-with-python Python 3.8

YouTube Thumbnail

Overview

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).

Steps

  1. Create free accounts on OpenAI and AWS.
  2. Create a Streamlit App.
  3. Create an EC2 instance on AWS.
  4. Git clone this repository on the EC2 instance.
  5. Install the requirements.
  6. Use the OPENAI_API_KEY in your code (avoid using static values, use global variables).
  7. Run the script on the EC2 instance.

Usage

To use this project:

  1. Clone the repository.
  2. Open a terminal in the working directory.
  3. Run the following command to install the required dependencies:
    pip install -r requirements.txt
    
  4. 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--------"
    
  5. The App.py file contains the Streamlit application.
  6. Run the script with the following command:
    nohup python3 streamlit run App.py --server.port 80
    
  7. To stop the running application:
    • Get the process ID of the running process:
      ps -ef 
      
    • Kill the process using its ID:
      kill [PROCESS_ID]
      

For a more detailed explanation of this project, refer to the tutorial on the Machine Learning Hub YouTube channel.

Screenshots

Support

If you find this project helpful, consider supporting me:

Feel free to follow me and star⭐ this repository!

Releases

No releases published

Packages

No packages published

Languages