Spaces:
Runtime error
Runtime error
A newer version of the Gradio SDK is available:
6.1.0
Hunyuan3D Error Handling Fix
Issue
The Hunyuan3D generator was failing with "list index out of range" error when parsing API results.
Root Cause
The new code had simplified error handling that didn't account for all possible result formats from the Hunyuan3D API:
- Empty tuples
- Different dict key names ('value', 'path', 'name')
- Non-dict/non-string result types
Fix Applied
Updated huggingface-space-v2/generators/hunyuan.py with:
Robust Result Parsing:
- Check for empty tuples before accessing
result[0] - Try multiple dict keys: 'value', 'path', 'name'
- Fallback to string conversion for unexpected formats
- Validate GLB file exists before returning
- Check for empty tuples before accessing
Enhanced Logging:
- Log raw result type and content
- Log all API parameters
- Log connection status
- Full traceback on errors
Better Error Messages:
- Specific message for "list index out of range" (server-side failure)
- Specific message for timeouts (suggest lower quality)
- Generic fallback with full error details
Testing
To test the fix:
cd huggingface-space-v2
python test_mesh_generation.py
Or deploy to HF Space:
./FINAL_DEPLOYMENT.ps1
Expected Behavior
- If Hunyuan3D API returns unexpected format: Clear error message suggesting retry
- If generation times out: Suggest using lower quality preset
- All errors include full traceback for debugging
- Successful generations work as before
Deployment Status
- ✅ Fix applied to
generators/hunyuan.py - ⏳ Ready for deployment
- ⏳ Needs testing on HF Space
Next Steps
- Deploy to HF Space
- Test with various prompts and quality settings
- Monitor logs for any remaining issues
- Update MCP server if needed