hfstudio / QUICKSTART.md
GitHub Action
Sync from GitHub: ffdd28283d24c66d2e788d9b4a630d7d9f76b0a1
d3f86d8

A newer version of the Gradio SDK is available: 6.0.2

Upgrade

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:

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

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

Adding New Features

  1. Frontend components go in frontend/src/lib/components/
  2. API endpoints go in backend/hfstudio/server.py
  3. 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