From 130dcd988e0554a6343c92fd45d808fd508789b3 Mon Sep 17 00:00:00 2001 From: historia Date: Wed, 9 Sep 2026 17:02:41 -0400 Subject: fix: model-specific instructions support and set cfg-scale 4 for breeze automatically --- audiobook.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'audiobook.py') diff --git a/audiobook.py b/audiobook.py index 302bb17..a610caa 100755 --- a/audiobook.py +++ b/audiobook.py @@ -394,9 +394,22 @@ def convert(backend: str, voice: str = None, clone: str = None, print("[INFO] Conversion cancelled; nothing was converted") return 0 else: - # qwen: instructions design the voice (VoiceDesign model), a - # reference .wav clones one (Base), otherwise a built-in speaker. - if (instructions or "").strip(): + # qwen: a built-in speaker (CustomVoice — with the instructions + # text, if given, sent as that model's delivery/style control), a + # reference .wav clone (Base), or instructions alone designing the + # voice (VoiceDesign). Instructions never *switch* the mode: + # speaker+instructions is a directed CustomVoice run, and + # clone+instructions is refused — the Base demo has no + # voice-direction route, so silently redesigning the voice would + # drop the chosen reference. + wants_instructions = bool((instructions or "").strip()) + if clone and wants_instructions: + raise ValueError( + "The qwen-tts Base (voice cloning) demo cannot take style " + "instructions. Drop --instructions, or pick a CustomVoice " + "speaker with --voice (which sends them as delivery " + "control) or the VoiceDesign model (--instructions only).") + if wants_instructions and not (voice or "").strip(): voice_mode = VOICE_MODE_DESIGN else: voice_mode = VOICE_MODE_CLONE if clone else VOICE_MODE_CUSTOM -- cgit v1.2.3