CloudArtify is a web application that utilizes Cloudinary's AI Background Removal add-on and OpenAI's DALL-E to transform images. Users can upload an image and generate a spooky or nightmarish background based on a text prompt, which is then applied to the uploaded image.
- Upload an image file (JPG, JPEG).
- Generate a spooky background using a text prompt.
- Remove the background of the uploaded image and replace it with the generated background.
- Display the transformed image in the web application.
- Python
- Streamlit
- Cloudinary
- OpenAI DALL-E
- dotenv for environment variable management
-
Clone the repository:
git clone https://github.com/Terieyenike/streamlit_spooky_bg cd streamlit_spooky_bg -
Install the required packages:
pip install -r requirements.txt
-
Set up environment variables: Create a
.envfile in the root directory and add your Cloudinary and OpenAI API keys:OPENAI_API_KEY=your_openai_api_key CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
-
Run the application:
streamlit run app.py
-
Open your web browser and go to
http://localhost:8501. -
Upload an image and enter a prompt to generate a spooky background.
-
Click the "Generate and Transform image" button to see the result.
Contributions are welcome! Please feel free to submit a pull request or open an issue.
This project is licensed under the MIT License.
- Cloudinary for their powerful image management and AI capabilities.
- OpenAI for providing the DALL-E model for image generation.
