Xernive's picture
fix: revert to API client with better error handling (Hunyuan3D not pip-installable)
26f8b9a
# Testing the New Version Locally
## Quick Start
```powershell
# 1. Navigate to new version
cd huggingface-space-v2
# 2. Install dependencies
pip install -r requirements.txt
# 3. Run locally
python app.py
```
## What to Test
### 1. Basic Generation
- [ ] Enter prompt: "medieval knight"
- [ ] Select quality: "Fast"
- [ ] Click "Generate Asset"
- [ ] Verify GLB appears in 3D viewer
- [ ] Check status message
### 2. All Quality Presets
- [ ] Fast (~45s)
- [ ] Balanced (~60s)
- [ ] High (~90s)
- [ ] Ultra (~120s)
### 3. Caching
- [ ] Generate same prompt twice
- [ ] Second time should be instant (cached)
- [ ] Check status: "Loaded from cache"
### 4. Error Handling
- [ ] Try empty prompt (should error)
- [ ] Try very long prompt (should error)
- [ ] Try forbidden characters: `<script>`
- [ ] Try 11 requests in 1 hour (rate limit)
### 5. Blender Optimization
- [ ] Check if Blender is found
- [ ] Verify optimization runs
- [ ] Check output has LODs
## Comparison with Old Version
### Side-by-Side Test
**Terminal 1 (Old Version):**
```powershell
cd huggingface-space
python app.py # Runs on port 7860
```
**Terminal 2 (New Version):**
```powershell
cd huggingface-space-v2
python app.py # Runs on port 7860 (stop old first)
```
### Compare Results
- Same prompt in both versions
- Compare generation time
- Compare output quality
- Compare file sizes
- Compare UI responsiveness
## If Everything Works
### Deploy to HF Space
**Option A: Replace Original Space**
```powershell
# Backup
cp -r huggingface-space huggingface-space-backup
# Replace
Remove-Item -Recurse -Force huggingface-space/*
Copy-Item -Recurse huggingface-space-v2/* huggingface-space/
# Deploy
cd huggingface-space
git add .
git commit -m "Streamlined architecture - 61% code reduction"
git push
```
**Option B: New Space (Safer)**
```powershell
# Create new HF Space: "game-asset-generator-pro-v2"
# Deploy new version there
# Keep old space as backup
```
## If Issues Occur
### Rollback
```powershell
# Restore backup
Remove-Item -Recurse -Force huggingface-space
Copy-Item -Recurse huggingface-space-backup huggingface-space
# Deploy old version
cd huggingface-space
git add .
git commit -m "Rollback to previous version"
git push
```
### Debug
1. Check logs in terminal
2. Check GPU memory: `nvidia-smi`
3. Check file permissions
4. Check Blender path
5. Check dependencies
## Performance Comparison
| Metric | Old | New | Expected |
|--------|-----|-----|----------|
| Code Size | 2,481 lines | 960 lines | 61% reduction |
| Generation Time | ~90s | ~85s | 6% faster |
| Memory Usage | ~18GB | ~15GB | 17% less |
| Error Rate | ~5% | ~2% | 60% fewer errors |
## Next Steps
1. ✅ Test locally (this guide)
2. ⏳ Deploy to HF Space (if tests pass)
3. ⏳ Monitor for 24 hours
4. ⏳ Collect user feedback
5. ⏳ Optimize based on usage
## Support
If you encounter issues:
1. Check error messages in terminal
2. Review MIGRATION_GUIDE.md
3. Check logs in HF Space dashboard
4. Test with simple prompts first