feat: Integrate IndexTTS2 model and update related schemas and frontend components

This commit is contained in:
2026-03-12 13:30:53 +08:00
parent e5b5a16364
commit 8aec4f6f44
151 changed files with 40077 additions and 85 deletions

View File

@@ -573,6 +573,16 @@ async def generate_project(project_id: int, user: User, db: Session, chapter_ind
"language": "zh",
"instruct": _get_gendered_instruct(char.gender, design.instruct),
})
elif char.use_indextts2 and design.ref_audio_path and Path(design.ref_audio_path).exists():
from core.tts_service import IndexTTS2Backend
indextts2 = IndexTTS2Backend()
audio_bytes = await indextts2.generate(
text=seg.text,
spk_audio_prompt=design.ref_audio_path,
output_path=str(audio_path),
emo_text=char.instruct or None,
emo_alpha=0.6,
)
else:
if design.voice_cache_id:
from core.cache_manager import VoiceCacheManager