Spaces:
Runtime error
Runtime error
A newer version of the Gradio SDK is available:
6.1.0
Pre-Deployment Checklist
โ Files Ready
-
app.py- Clean Gradio UI (150 lines) -
requirements.txt- Minimal dependencies (10 packages) -
Dockerfile- HF Space configuration -
.gitignore- Ignore temp files -
README.md- Documentation -
core/- Pipeline orchestration -
generators/- FLUX + Hunyuan3D -
processors/- Blender + Validator -
utils/- Cache + Security + Memory -
scripts/- External Blender script
๐ Pre-Deployment Steps
1. Local Testing (Optional but Recommended)
cd huggingface-space-v2
pip install -r requirements.txt
python app.py
Test:
- App launches without errors
- UI loads correctly
- Can enter prompt
- Can select quality
- Generate button works
2. Create New HF Space
Go to: https://huggingface.co/new-space
Settings:
- Space name:
game-asset-generator-pro-v2(or your choice) - License: MIT
- SDK: Gradio
- SDK Version: 4.44.0
- Hardware: L4 GPU (24GB VRAM)
- Visibility: Public or Private
3. Clone Space Repository
git clone https://huggingface.co/spaces/YOUR_USERNAME/SPACE_NAME
cd SPACE_NAME
4. Copy Files
Option A: Manual Copy
Copy-Item -Recurse D:\KIRO\Projects\XStudios\huggingface-space-v2\* .
Option B: Use Script
cd D:\KIRO\Projects\XStudios\huggingface-space-v2
.\QUICK_DEPLOY.ps1 -SpaceURL "https://huggingface.co/spaces/YOUR_USERNAME/SPACE_NAME"
5. Verify Files
Get-ChildItem -Recurse
Should see:
- app.py
- requirements.txt
- Dockerfile
- .gitignore
- README.md (with HF metadata header)
- core/ directory
- generators/ directory
- processors/ directory
- utils/ directory
- scripts/ directory
6. Update README Header
Ensure README.md starts with:
```yaml
title: 3D Asset Generator Pro V2 emoji: ๐ฎ colorFrom: blue colorTo: purple sdk: gradio sdk_version: 4.44.0 app_file: app.py pinned: false license: mit hardware: l4
### 7. Push to HF Space
```powershell
git add .
git commit -m "Initial deployment - Streamlined architecture"
git push
8. Monitor Build
- Go to Space URL
- Watch build logs
- Wait for "Running" status (~5-10 minutes)
Build should:
- Install dependencies
- Install Blender
- Start Gradio app
- Show "Running" status
๐งช Post-Deployment Testing
Basic Functionality
Open Space URL
- UI loads correctly
- No console errors
Test Generation (Fast)
- Prompt: "medieval knight"
- Quality: Fast
- Click Generate
- Wait ~45 seconds
- 3D model appears
- Status shows success
Test Caching
- Same prompt again
- Should be instant
- Status: "Loaded from cache"
Test Quality Presets
- Fast (~45s)
- Balanced (~60s)
- High (~90s)
- Ultra (~120s)
Error Handling
Test Invalid Inputs
- Empty prompt โ Error message
- Very long prompt โ Error message
- Forbidden chars
<script>โ Error message
Test Rate Limiting
- Make 11 requests quickly
- 11th should be rate limited
Advanced Features
Test Blender Optimization
- Check logs for "Blender found"
- Verify optimization runs
- Check output file size
Test Examples
- Click example prompts
- Verify they work
๐ Performance Metrics
After 1 hour of testing:
- Generation success rate: >95%
- Average generation time: <90s (High quality)
- Cache hit rate: >50%
- Error rate: <5%
- GPU memory usage: <20GB
- No OOM errors
๐ Troubleshooting
Build Fails
Check:
- requirements.txt has all dependencies
- Dockerfile syntax is correct
- No import errors in code
Fix:
# Test locally first
pip install -r requirements.txt
python app.py
Runtime Errors
Check Space logs:
- Click "Logs" tab
- Look for error messages
- Check GPU memory usage
Common issues:
- OOM โ Reduce quality presets
- Timeout โ Increase GPU duration
- API errors โ Check Hunyuan3D status
Blender Not Working
Check:
- Dockerfile installs Blender
- BLENDER_PATH is set correctly
- Blender script is executable
Fallback:
- Space will work without Blender
- Just skips optimization step
โจ Success Criteria
Space is successful if:
- โ Builds without errors
- โ UI loads correctly
- โ Generates assets successfully
- โ Caching works
- โ No OOM errors
- โ Performance is good
- โ Error messages are clear
๐ Next Steps
After successful deployment:
Share Space
- Share URL with team
- Add to project documentation
Monitor Performance
- Check daily for 1 week
- Review error logs
- Collect user feedback
Optimize
- Adjust quality presets if needed
- Tune cache settings
- Add features based on feedback
Consider Migration
- If all goes well for 1 week
- Migrate old Space to new architecture
- Or keep both running
๐ Deployment Complete!
Once all checkboxes are โ , your new Space is ready!
Space URL: https://huggingface.co/spaces/YOUR_USERNAME/SPACE_NAME
Key Features:
- 61% less code (2,481 โ 960 lines)
- Modern architecture (async/await, type hints)
- Clean structure (modular, testable)
- Same features (FLUX, Hunyuan3D, Blender, caching)
- Better maintainability
Enjoy your streamlined 3D asset generator! ๐ฎ