A newer version of the Gradio SDK is available:
6.0.2
HFStudio - Quick Start Guide
π Running Locally for Development
Prerequisites
- Node.js 18+ and npm
- Python 3.8+
Option 1: Quick Start (Recommended)
# Run both frontend and backend
./run_dev.sh
This will:
- Start the backend API server on http://localhost:11110
- Start the frontend dev server on http://localhost:11111
- Install dependencies automatically
Option 2: Manual Setup
Terminal 1 - Backend
cd backend
# Install dependencies
pip install -r requirements.txt
# Run the server
python -m hfstudio.cli --dev
# Or install as package and run
pip install -e .
hfstudio --dev
Backend will run on http://localhost:11110
- API docs: http://localhost:11110/docs
- ReDoc: http://localhost:11110/redoc
Terminal 2 - Frontend
cd frontend
# Install dependencies
npm install
# Run dev server
npm run dev
Frontend will run on http://localhost:11111
π Project Structure
hfstudio/
βββ frontend/ # Svelte UI (port 11111)
β βββ src/
β βββ routes/ # Page components
β βββ app.css # Tailwind styles
βββ backend/ # Python API (port 11110)
β βββ hfstudio/
β βββ server.py # FastAPI server
β βββ cli.py # CLI interface
βββ run_dev.sh # Dev startup script
π¨ UI Features
- Text Input: Large textarea for text-to-speech input
- Voice Selection: Choose from available voices
- Model Selection: Switch between TTS models
- Parameter Controls: Adjust speed, stability, similarity
- Mode Toggle: Switch between API and Local execution
- Audio Player: Play and download generated speech
π§ Development Tips
Frontend Changes
- Edit files in
frontend/src/ - Hot reload is enabled - changes appear instantly
- Tailwind classes are available
Backend Changes
- Edit files in
backend/hfstudio/ - With
--devflag, server auto-reloads on changes - Test API endpoints at http://localhost:11110/docs
Adding New Features
- Frontend components go in
frontend/src/lib/components/ - API endpoints go in
backend/hfstudio/server.py - TTS models will go in
backend/hfstudio/models/
π Troubleshooting
Port Already in Use
# Change frontend port
cd frontend
npm run dev -- --port 11112
# Change backend port
cd backend
python -m hfstudio.cli --port 11112
Missing Dependencies
# Frontend
cd frontend && npm install
# Backend
cd backend && pip install -r requirements.txt
CORS Issues
Make sure both servers are running and check the CORS configuration in backend/hfstudio/server.py