Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
6.2.0
π Hugging Face Deployment Guide
Quick Deploy to Hugging Face Spaces
1. Create New Space
- Go to Hugging Face Spaces
- Click "Create new Space"
- Choose SDK: Gradio
- Set visibility: Public
2. Upload Files
Upload these essential files:
app.py(main application)requirements.txt(dependencies)config.yaml(space configuration)README.md(documentation)packages.txt(system dependencies)Dockerfile(optional)
3. Configure Secrets
In Space settings, add:
GEMINI_API_KEY: Your Google AI API keyELEVENLABS_API_KEY: Your ElevenLabs API key (optional)
4. Space Configuration (config.yaml)
title: "π Nano Banana: Dynamic Image Creation"
emoji: π
colorFrom: yellow
colorTo: orange
sdk: gradio
sdk_version: "4.44.0"
app_file: app.py
5. API Keys Setup
Gemini API Key (Required)
- Visit Google AI Studio
- Create new API key
- Add to Space secrets as
GEMINI_API_KEY
ElevenLabs API Key (Optional)
- Sign up at ElevenLabs
- Get API key from dashboard
- Add to Space secrets as
ELEVENLABS_API_KEY
6. Deployment Process
- Upload files to Space
- Add API keys in Settings > Variables and secrets
- Space will automatically build and deploy
- Access your live demo at the Space URL
7. Edge Cases Handled
- β Missing API keys (graceful degradation)
- β Rate limiting (automatic retry with backoff)
- β Large images (automatic resizing)
- β Network timeouts (retry mechanism)
- β Invalid prompts (validation)
- β Optional features fallback
8. Performance Optimizations
- Image compression and resizing
- Rate limiting compliance (20 images/minute)
- Efficient memory usage
- Error recovery mechanisms
9. Competition Compliance
- Gemini 2.5 Flash Image as primary model
- Optional enhancements (YOLO, ElevenLabs)
- Public accessibility without login
- Video demo ready interface