Skip to content

The open-source AI voice studio. Clone, dictate, create.

Merge branch 'main' into fix/model-size-selection-ignored

Jamie Pinebaca111d501a
diff --cc backend/main.py
index 94810c1e,f0048ef6..e218d237
--- a/backend/main.py
+++ b/backend/main.py
@@@ -541,10 -599,13 +599,15 @@@ async def generate_speech
profile = await profiles.get_profile(data.profile_id, db)
if not profile:
raise HTTPException(status_code=404, detail="Profile not found")
+
+ # Generate audio
+
+ # Resolve model size and load the correct model FIRST.
+ # This must happen before create_voice_prompt_for_profile because that
+ # function calls load_model_async(None), which falls back to self.model_size.
+ # If the model is already loaded with the right size at that point, it
+ # returns immediately and the voice prompt is created by the correct model.
tts_model = tts.get_tts_model()
- # Load the requested model size if different from current (async to not block)
model_size = data.model_size or "1.7B"
# Check if model needs to be downloaded first