diff options
| author | historia <historiavg@proton.me> | 2026-09-09 17:02:41 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-09-09 17:02:41 -0400 |
| commit | 130dcd988e0554a6343c92fd45d808fd508789b3 (patch) | |
| tree | 0162c1593eff0f9214f111f600f23efd624eb3c3 /app/converter/clients/sglomni.py | |
| parent | 71f2c85aa5ea2aa5fe5f31537f5979459e82fcdd (diff) | |
| download | tts-audiobook-generator-130dcd988e0554a6343c92fd45d808fd508789b3.tar.gz | |
fix: model-specific instructions support and set cfg-scale 4 for breeze automatically
Diffstat (limited to 'app/converter/clients/sglomni.py')
| -rw-r--r-- | app/converter/clients/sglomni.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/converter/clients/sglomni.py b/app/converter/clients/sglomni.py index 6b8493b..13b98d7 100644 --- a/app/converter/clients/sglomni.py +++ b/app/converter/clients/sglomni.py @@ -175,6 +175,11 @@ class SgOmniTTSClient(BaseTTSClient): raise RuntimeError( f"{entry.label} designs the voice from an instruction: " 'pass --instructions "..." describing the voice.') + if self.instructions and not entry.supports_instructions: + raise RuntimeError( + f"{entry.label} does not consume style instructions: the " + "server would silently ignore them. Remove --instructions, " + "or pick a model that supports them (Qwen3-TTS, MOSS-TTS).") if entry.capability == "clone" and entry.requires_reference \ and not self.ref_audio: raise RuntimeError( @@ -377,6 +382,16 @@ class SgOmniTTSClient(BaseTTSClient): payload["ref_audio"] = self._ref_audio_value() if self.ref_text: payload["ref_text"] = self.ref_text + if entry.supports_instructions and self.instructions: + # Reference + separate style instruction (Qwen3-TTS Base + # instruction conditioning, MOSS v1.5 user message). NOT + # the design task_type: the reference stays the voice. + payload["instructions"] = self.instructions + elif entry.supports_instructions and self.instructions: + # Speaker models (Qwen3-TTS CustomVoice) also shape the + # delivery with an instruction; unsupported models never get + # one (checked at connect). + payload["instructions"] = self.instructions return payload def _request_wav(self, text: str) -> bytes: |
