videoAI / SETUP.md
sravya's picture
Upload 33 files
54ed165 verified

๐Ÿš€ Complete Setup Guide

Prerequisites

  • Python 3.9 or higher
  • Git
  • 10GB free disk space (for local models)

Step-by-Step Setup

1. Clone the Repository

git clone <your-repo-url>
cd hailuo-clone

2. Create Virtual Environment

python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Choose Your Backend

Option A: Replicate API (Recommended)

# Install dependencies
pip install -r requirements.txt
pip install replicate

# Get API token from https://replicate.com/account/api-tokens
# Create .env file
echo "REPLICATE_API_TOKEN=your_token_here" > .env

# Run backend
python backend_replicate.py

# Open index.html in browser

Option B: Local Generation

# Install PyTorch (GPU version)
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

# Or CPU version
pip install torch torchvision torchaudio

# Install other dependencies
pip install -r requirements_local.txt

# Run backend
python backend_local.py

# Open index_local.html in browser

Option C: Hugging Face Spaces

# Install dependencies
pip install -r requirements.txt

# Run backend
python backend_enhanced.py

# Open index_enhanced.html in browser

4. Test the Setup

  1. Open the appropriate HTML file in your browser
  2. Enter a test prompt: "A cat playing with a ball of yarn"
  3. Click "Generate Video"
  4. Wait for the video to generate

Quick Commands

Start Replicate Backend

source venv/bin/activate
python backend_replicate.py

Start Local Backend

source venv/bin/activate
python backend_local.py

Start Enhanced Backend

source venv/bin/activate
python backend_enhanced.py

Troubleshooting

Port Already in Use

# Find process using port 5000
lsof -i :5000

# Kill the process
kill -9 <PID>

Missing Dependencies

# Reinstall all dependencies
pip install --upgrade -r requirements.txt

API Token Issues

# Verify .env file exists
cat .env

# Should show: REPLICATE_API_TOKEN=your_token_here

Next Steps