File size: 2,344 Bytes
54ed165
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# 🚀 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

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

### 2. Create Virtual Environment

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

### 3. Choose Your Backend

#### Option A: Replicate API (Recommended)

```bash
# 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

```bash
# 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

```bash
# 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
```bash
source venv/bin/activate
python backend_replicate.py
```

### Start Local Backend
```bash
source venv/bin/activate
python backend_local.py
```

### Start Enhanced Backend
```bash
source venv/bin/activate
python backend_enhanced.py
```

## Troubleshooting

### Port Already in Use
```bash
# Find process using port 5000
lsof -i :5000

# Kill the process
kill -9 <PID>
```

### Missing Dependencies
```bash
# Reinstall all dependencies
pip install --upgrade -r requirements.txt
```

### API Token Issues
```bash
# Verify .env file exists
cat .env

# Should show: REPLICATE_API_TOKEN=your_token_here
```

## Next Steps

- Read [README_GITHUB.md](README_GITHUB.md) for full documentation
- Check [SOLUTION_GUIDE.md](SOLUTION_GUIDE.md) for troubleshooting
- See [models_config.py](models_config.py) to customize models