fix: declare speaker_1..8 in INPUT_TYPES so ComfyUI validation accepts them

Dynamic JS inputs that are not listed in INPUT_TYPES may be rejected by
ComfyUI's prompt validator and not passed to the Python function. Declaring
all 8 slots as optional fixes this while JS still controls which slots are
visible on the node.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-06 09:41:56 +02:00
parent 26295e4db7
commit aedbe2e7d9
+8 -2
View File
@@ -45,6 +45,13 @@ class OmniVoiceSpeakers:
@classmethod
def INPUT_TYPES(cls):
# speaker_1…speaker_8 are declared here so ComfyUI validation accepts them.
# Visibility is controlled by the JS extension (web/multi_speaker.js):
# only the first num_speakers slots are shown as live inputs.
optional_speakers = {
f"speaker_{i}": ("OMNIVOICE_SPEAKER", {})
for i in range(1, 9)
}
return {
"required": {
"num_speakers": ("INT", {
@@ -74,8 +81,7 @@ class OmniVoiceSpeakers:
},
),
},
# speaker_1 … speaker_8 are added/removed dynamically by the JS extension.
# They are not listed here so ComfyUI does not render them as static widgets.
"optional": optional_speakers,
}
RETURN_TYPES = ("OMNIVOICE_SPEAKERS",)