This project uses the Cloudinary AI API to change the background of an uploaded image based on a user-provided prompt. It's built using Streamlit for the front-end, and integrates Cloudinary for image processing. The user can upload an image, input a prompt, and see a transformed image with an AI-generated background.
- Upload images in JPG, JPEG, or PNG format.
- Enter a text prompt for background transformation (e.g., "futuristic city at night").
- View the transformed image in real-time.
- Download the transformed image directly from the app.
- The user uploads an image.
- The user enters a prompt (such as "forest at sunset").
- The app sends the image and prompt to Cloudinary's AI API.
- Cloudinary processes the image and replaces the background based on the prompt.
- The user can view and download the transformed image.
- Python: Backend logic.
- Streamlit: Frontend for user interaction.
- Cloudinary: API for image transformation.
- Pillow (PIL): For image manipulation.
- Requests: For handling API calls.
- Python installed on your system.
- A Cloudinary account (for API credentials).
- Clone the repository:
git clone https://github.com/arya-io/AI-Background-Changer.git cd AI-Background-Changer
- Install the required dependencies:
pip install -r requirements.txt
- Set up your Cloudinary credentials:
Copy
config_template.py
toconfig.py
and fill in your Cloudinary credentials.cp config_template.py config.py
- Run the Streamlit app:
streamlit run app.py
- Open your web browser and go to
http://localhost:8501
to access the app. - Upload an image and enter a prompt describing the background you'd like. Click "Submit" to transform the image. You can then download the transformed image.
Contributions are welcome! If you have suggestions or improvements, please feel free to:
- Open an issue to discuss any changes you'd like to see.
- Submit a pull request with your proposed changes.
Please make sure to follow the project's coding style and include tests for any new features.
This project is licensed under the MIT License. See the LICENSE file for more details.