Step 1: Clone or Download the Project
Begin by cloning the project from GitHub ([GitHub link]) or downloading the ZIP Archive
. Extract the contents to a directory of your choice. This repository contains all necessary Python scripts, HTML files, and dependencies.
Step 2: Set Up the .env File
Create a .env
file in your project directory. Add your Groq API key and Hugging Face API key to this file, as demonstrated below :
GROQ_API_KEY=YOUR_GROQ_API_KEY
HUGGINGFACE_API_KEY=YOUR_HUGGING_FACE_API_KEY
Replace YOUR_GROQ_API_KEY
and YOUR_HUGGING_FACE_API_KEY
with the actual API keys you obtained earlier. This file securely stores your credentials, preventing them from being exposed in your code.
Step 3: Create a Conda Environment
Open your terminal or Anaconda Prompt. Create a Conda environment with Python 3.10 using the following command :
conda create -n superhero python=3.10
Activate the newly created environment:
conda activate superhero
This isolates your project dependencies, preventing conflicts with other Python projects on your system.
Step 4: Install Dependencies
Install the required Python packages using pip. Navigate to your project directory in the terminal and run:
pip install -r requirements.txt
This command installs all packages listed in the requirements.txt
file, ensuring your project has all necessary dependencies.
Step 5: Run the Flask Application
Start the Flask application by running the app.py
script:
python app.py
This launches the web server, making your AI Superhero Transformer accessible through your web browser. The terminal will display a message indicating the server is running and providing the local address.
Then, open your web browser and navigate to http://localhost:5000
. You should see the AI Superhero Transformer web interface, ready to transform your photos into superhero art!