feat: add language selector for voice_design + Chinese instruct support
- Generate: language dropdown (auto/English/Chinese), passed only in voice_design and auto_voice modes where it selects the instruct vocab - VoiceDesign: Chinese mode with dialect/age/pitch/gender dropdowns using the model's validated Chinese instruct vocabulary (全角逗号) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+15
-1
@@ -62,6 +62,18 @@ class OmniVoiceGenerate:
|
||||
"default": "",
|
||||
"tooltip": "Transcription of ref_audio. Connect a Whisper (or other STT) node for best results.",
|
||||
}),
|
||||
"language": (
|
||||
["auto", "English", "Chinese"],
|
||||
{
|
||||
"default": "auto",
|
||||
"tooltip": (
|
||||
"Used in voice_design mode to select the instruct vocabulary.\n"
|
||||
"'English' uses English instruct items (male, female, british accent …)\n"
|
||||
"'Chinese' uses Chinese dialect items (男, 女, 四川话, 东北话 …)\n"
|
||||
"Has no effect in voice_cloning mode (language is inferred from text)."
|
||||
),
|
||||
},
|
||||
),
|
||||
"instruct": ("STRING", {
|
||||
"default": "",
|
||||
"tooltip": (
|
||||
@@ -113,11 +125,13 @@ class OmniVoiceGenerate:
|
||||
FUNCTION = "generate"
|
||||
CATEGORY = "OmniVoice"
|
||||
|
||||
def generate(self, model, text, mode, ref_audio=None, ref_text="",
|
||||
def generate(self, model, text, mode, ref_audio=None, ref_text="", language="auto",
|
||||
instruct="", guidance_scale=2.0, speed=1.0, num_step=32, seed=0):
|
||||
if seed != 0:
|
||||
torch.manual_seed(seed)
|
||||
kwargs = {"text": text, "speed": speed, "num_step": num_step, "guidance_scale": guidance_scale}
|
||||
if mode != "voice_cloning" and language and language != "auto":
|
||||
kwargs["language"] = language
|
||||
|
||||
if mode == "voice_cloning" and ref_audio is None:
|
||||
raise ValueError("voice_cloning mode requires ref_audio to be connected")
|
||||
|
||||
Reference in New Issue
Block a user