refactor: rename project Lyria Studio → Kithara Studio

- App name, UI text, page titles → Kithara Studio
- Python module: lyria_client.py → kithara_client.py
- Tailwind color classes: lyria-* → kithara-*
- CSS custom properties: --lyria-* → --kithara-*
- Database: lyria.db → kithara.db
- Package name: kithara-studio-frontend
- localStorage key: kithara-saved-searches
- Add project logo (lyre icon, black on transparent, invert via CSS)

Preserved as Google's property:
- LYRIA_API_KEY, LYRIA_BASE_URL, LYRIA_DEFAULT_MODEL env vars
- LYRIA_MODELS dict and model IDs (lyria-3-clip-preview, lyria-3-pro-preview)
- Google Lyria API references in error messages and docstrings
This commit is contained in:
rin.kagamine committed 2026-05-31 09:45:22 -04:00
1 parent 6c1e1b4509
commit 816f8fbd2f
20 files changed
+191 -193

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ import uuid
from datetime import datetime, timezone
from pathlib import Path
DB_PATH = Path(__file__).parent.parent / "data" / "lyria.db"
DB_PATH = Path(__file__).parent.parent / "data" / "kithara.db"
DB_PATH.parent.mkdir(parents=True, exist_ok=True)
# Timezone from TZ env var (default: America/New_York)
@@ -4,7 +4,7 @@ import os
import logging
from pathlib import Path
logger = logging.getLogger("lyria_client")
logger = logging.getLogger("kithara_client")
LYRIA_API_KEY = os.getenv("LYRIA_API_KEY", "")
LYRIA_BASE_URL = "https://generativelanguage.googleapis.com/v1beta"
@@ -50,11 +50,11 @@ async def generate_clip(prompt: str, model: str = "lyria-3-clip-preview", durati
block_reason = data.get("blockReason", "")
if block_reason:
block_message = data.get("blockReasonMessage", "")
logger.warning(f"Lyria API blocked: {block_reason} — {block_message}")
logger.warning(f"Google Lyria API blocked: {block_reason} — {block_message}")
return {"success": False, "error": f"Prompt was filtered. Try describing the sound using mood, instruments, and tempo instead of genre names. ({block_message or block_reason})"}
# Extract base64 audio from response
# Lyria returns parts array: first part may be text (e.g. "<instrumental>"),
# Google Lyria returns parts array: first part may be text (e.g. "<instrumental>"),
# audio is in inlineData of a subsequent part.
candidates = data.get("candidates", [])
if not candidates:
@@ -103,7 +103,7 @@ async def generate_clip(prompt: str, model: str = "lyria-3-clip-preview", durati
error_detail = e.response.json().get("error", {}).get("message", str(e))
except:
error_detail = str(e)
return {"success": False, "error": f"Lyria API error: {error_detail}"}
return {"success": False, "error": f"Google Lyria API error: {error_detail}"}
except Exception as e:
return {"success": False, "error": f"Client error: {str(e)}"}
+4 -4
View File
@@ -6,18 +6,18 @@ import os
import shutil
from dotenv import load_dotenv
# Load environment variables BEFORE importing lyria_client (it reads env at module level)
# Load environment variables BEFORE importing kithara_client (it reads env at module level)
load_dotenv(Path(__file__).parent.parent / ".env")
from models import GenerateRequest, GenerateResponse, ClipList, RenameRequest, MetadataRequest, GenerateArtworkRequest, LYRIA_MODELS, DEFAULT_MODEL
from database import init_db, create_clip, get_clips, get_clip, delete_clip, update_clip_status, rename_clip, set_artwork, remove_artwork, delete_all_clips, set_analysis, update_metadata
from lyria_client import generate_clip, save_clip_file
from kithara_client import generate_clip, save_clip_file
from waveform import generate_waveform_svg, get_waveform_path
from analysis import analyze_clip
from image_gen import generate_artwork, get_image_gen_config, get_available_models, SAFETY_LEVELS
from text_gen import suggest_prompts, get_text_gen_config, get_available_models as get_text_models
app = FastAPI(title="Lyria Studio", version="0.1.0")
app = FastAPI(title="Kithara Studio", version="0.1.0")
app.add_middleware(
CORSMiddleware,
@@ -49,7 +49,7 @@ async def list_models():
return {"models": LYRIA_MODELS, "default": DEFAULT_MODEL}
async def _generate_and_save(clip_id: str, prompt: str, model: str, duration: int):
"""Background task: call Lyria API and save the result.
"""Background task: call Google Lyria API and save the result.
DR-LYRIA-001: Pre-generates waveform SVG after clip is ready,
so users never wait for on-demand generation.