File size: 4,742 Bytes
38572a2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# Quick Start Guide

## πŸš€ Deploy in 5 Minutes

### Step 1: Complete the Inference (REQUIRED)
⚠️ **The code has placeholders for actual video generation**

See [TODO.md](./TODO.md) for details on integrating the inference logic.

### Step 2: Create HuggingFace Space

1. Go to https://huggingface.co/new-space
2. Fill in:
   - **Name**: `infinitetalk` (or your choice)
   - **License**: `apache-2.0`
   - **SDK**: `Gradio`
   - **Hardware**: `ZeroGPU` ✨ (FREE tier available!)
3. Click **Create Space**

### Step 3: Upload Files

**Via Web UI** (easiest):
1. Click "Files" tab in your Space
2. Drag and drop all files from this directory:
   ```
   README.md
   app.py
   requirements.txt
   packages.txt
   .gitignore
   LICENSE.txt
   src/ (folder)
   wan/ (folder)
   utils/ (folder)
   assets/ (folder)
   examples/ (folder)
   ```
3. Click "Commit changes"

**Via Git**:
```bash
git clone https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
cd YOUR_SPACE_NAME
cp -r /path/to/infinitetalk-hf-space/* .
git add .
git commit -m "Initial deployment"
git push
```

### Step 4: Wait for Build

- Build time: **5-10 minutes**
- Check "Logs" tab for progress
- Flash-attn compilation takes longest

### Step 5: Test

1. Space shows "Running" βœ…
2. First generation downloads models (2-3 min)
3. Try image-to-video example
4. Try video dubbing example

## ⚑ Quick Commands

```bash
# View directory structure
ls -la

# Check file sizes
du -sh *

# Count lines of code
find . -name "*.py" | xargs wc -l

# Test Python syntax
python -m py_compile app.py

# View logs (after deployment)
# Go to your Space β†’ Logs tab
```

## 🎯 Common Issues & Fixes

### Build Fails
- **Check Logs tab** for specific error
- **Flash-attn timeout?** Normal, wait 10-15 min
- **Still failing?** Try Dockerfile approach (see DEPLOYMENT.md)

### Models Don't Download
- Check https://status.huggingface.co
- Verify model repo IDs in `utils/model_loader.py`
- Add HF_TOKEN in Space settings if needed

### Out of Memory
- Use 480p instead of 720p
- Reduce steps to 30
- Process shorter videos (<10s)

### Space Stuck
- Refresh page
- Check if in queue (ZeroGPU)
- Wait for quota to refill

## πŸ“Š Files Overview

| File/Folder | Purpose | Lines | Critical? |
|-------------|---------|-------|-----------|
| `README.md` | Space metadata | ~50 | βœ… Yes |
| `app.py` | Main application | ~350 | βœ… Yes |
| `requirements.txt` | Python packages | ~30 | βœ… Yes |
| `packages.txt` | System packages | ~4 | βœ… Yes |
| `utils/model_loader.py` | Model management | ~200 | βœ… Yes |
| `utils/gpu_manager.py` | Memory management | ~150 | βœ… Yes |
| `src/` | Audio analysis | - | βœ… Yes |
| `wan/` | Model code | - | βœ… Yes |
| `assets/` | UI assets | - | Optional |
| `examples/` | Sample data | - | Optional |

## πŸ”§ Pre-Deployment Checklist

- [x] All files present
- [x] README.md has YAML metadata
- [x] requirements.txt is properly ordered
- [x] ZeroGPU hardware configured
- [ ] **Inference logic integrated** ⬅️ CRITICAL
- [ ] Tested locally (if possible)
- [ ] Examples prepared

## πŸ’° Cost Breakdown

### Free Tier
- **Cost**: $0
- **GPU**: H200 (70GB VRAM)
- **Quota**: 300s per session, 600s max
- **Usage**: ~3-5 generations per quota
- **Best for**: Testing, demos, light use

### PRO Tier
- **Cost**: $9/month
- **GPU**: Same H200
- **Quota**: 8Γ— more (1500s)
- **Spaces**: Up to 10
- **Best for**: Regular use, public demos

## πŸ“ˆ Performance Expectations

| Task | Resolution | Time | VRAM |
|------|-----------|------|------|
| Model download | - | 2-3 min | - |
| 10s video | 480p | ~40s | ~38GB |
| 10s video | 720p | ~70s | ~55GB |
| 30s video | 480p | ~90s | ~45GB |

## πŸŽ“ Learning Resources

- [HuggingFace Spaces Tutorial](https://huggingface.co/docs/hub/spaces-overview)
- [Gradio Documentation](https://gradio.app/docs)
- [ZeroGPU Guide](https://huggingface.co/docs/hub/spaces-zerogpu)
- [InfiniteTalk Paper](https://arxiv.org/abs/2508.14033)

## βœ… Success Checklist

After deployment:

1. [ ] Space builds successfully
2. [ ] No errors in Logs
3. [ ] UI loads properly
4. [ ] Models download on first run
5. [ ] Image-to-video works
6. [ ] Video dubbing works
7. [ ] No OOM errors
8. [ ] Memory cleanup works
9. [ ] Can run multiple generations
10. [ ] Results look good!

## πŸ†˜ Need Help?

1. **Check** [TODO.md](./TODO.md) for implementation details
2. **Read** [DEPLOYMENT.md](./DEPLOYMENT.md) for troubleshooting
3. **Review** [PROJECT_SUMMARY.md](./PROJECT_SUMMARY.md) for overview
4. **Ask** on HuggingFace Forums: https://discuss.huggingface.co
5. **File issue** on InfiniteTalk GitHub: https://github.com/MeiGen-AI/InfiniteTalk

---

**Ready?** Complete the inference integration, then deploy! πŸš€