simplify: remove language param entirely — model detects from instruct string

Chinese characters vs English words are self-identifying to the model.
No need for a separate language signal on either node.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-05 20:44:27 +02:00
parent 2b13e55dc5
commit 340c0aa402
2 changed files with 5 additions and 14 deletions
+1 -10
View File
@@ -62,13 +62,6 @@ class OmniVoiceGenerate:
"default": "", "default": "",
"tooltip": "Transcription of ref_audio. Connect a Whisper (or other STT) node for best results.", "tooltip": "Transcription of ref_audio. Connect a Whisper (or other STT) node for best results.",
}), }),
"language": ("STRING", {
"default": "auto",
"tooltip": (
"Connect the 'language' output from OmniVoice Voice Design — it sets this automatically.\n"
"Only needed in voice_design/auto_voice mode. Leave 'auto' for voice_cloning."
),
}),
"instruct": ("STRING", { "instruct": ("STRING", {
"default": "", "default": "",
"tooltip": ( "tooltip": (
@@ -120,13 +113,11 @@ class OmniVoiceGenerate:
FUNCTION = "generate" FUNCTION = "generate"
CATEGORY = "OmniVoice" CATEGORY = "OmniVoice"
def generate(self, model, text, mode, ref_audio=None, ref_text="", language="auto", def generate(self, model, text, mode, ref_audio=None, ref_text="",
instruct="", guidance_scale=2.0, speed=1.0, num_step=32, seed=0): instruct="", guidance_scale=2.0, speed=1.0, num_step=32, seed=0):
if seed != 0: if seed != 0:
torch.manual_seed(seed) torch.manual_seed(seed)
kwargs = {"text": text, "speed": speed, "num_step": num_step, "guidance_scale": guidance_scale} 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: if mode == "voice_cloning" and ref_audio is None:
raise ValueError("voice_cloning mode requires ref_audio to be connected") raise ValueError("voice_cloning mode requires ref_audio to be connected")
+4 -4
View File
@@ -59,8 +59,8 @@ class OmniVoiceVoiceDesign:
}, },
} }
RETURN_TYPES = ("STRING", "STRING") RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("instruct", "language") RETURN_NAMES = ("instruct",)
FUNCTION = "compose" FUNCTION = "compose"
CATEGORY = "OmniVoice" CATEGORY = "OmniVoice"
@@ -68,7 +68,7 @@ class OmniVoiceVoiceDesign:
zh_gender="none", zh_age="none", zh_pitch="none", zh_dialect="none"): zh_gender="none", zh_age="none", zh_pitch="none", zh_dialect="none"):
if language == "Chinese": if language == "Chinese":
parts = [v for v in [zh_gender, zh_age, zh_pitch, zh_dialect] if v != "none"] parts = [v for v in [zh_gender, zh_age, zh_pitch, zh_dialect] if v != "none"]
return ("".join(parts), "Chinese") return ("".join(parts),)
else: else:
parts = [v for v in [gender, age, pitch, accent] if v != "none"] parts = [v for v in [gender, age, pitch, accent] if v != "none"]
return (", ".join(parts), "English") return (", ".join(parts),)