This project is a Streamlit-based web app that enables users to generate AI-generated images using text prompts. The app integrates two powerful image generation models: OpenAI's DALL-E and Huggingface's Diffusion models.
- DALL-E Integration: Generates images using OpenAI's DALL-E model.
- Huggingface Diffusers Integration: Generates images using Huggingface's Stable Diffusion model.
- Simple UI: Intuitive user interface to input text prompts and view generated images.
- CUDA Support: Utilizes GPU for faster image generation using Huggingface's Diffusers.
-
Clone the Repository
git clone https://github.com/shaadclt/Image-Generation-App-DALL-E-Huggingface-Diffusers.git cd Image-Generation-App-DALL-E-Huggingface-Diffusers -
Install Dependencies
Use the requirements.txt file to install the necessary packages:
pip install -r requirements.txt
-
Set Up API Keys
Create a
.envfile in the root directory and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key
-
Run the App
Run the Streamlit app:
streamlit run app.py
-
CUDA Setup (Optional for Diffusers)
Ensure you have the necessary GPU drivers and libraries for running Stable Diffusion with CUDA. This improves image generation performance.
- Select the model you want to use from the sidebar (
DALL-EorHuggingface Diffusers). - Input your text prompt in the provided field.
- Click the "Generate Image" button.
- View the generated image in the app interface.
Feel free to contribute by opening issues or submitting pull requests.
This project is licensed under the MIT License.