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:
@@ -45,6 +45,13 @@ class OmniVoiceSpeakers:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(cls):
|
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 {
|
return {
|
||||||
"required": {
|
"required": {
|
||||||
"num_speakers": ("INT", {
|
"num_speakers": ("INT", {
|
||||||
@@ -74,8 +81,7 @@ class OmniVoiceSpeakers:
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
# speaker_1 … speaker_8 are added/removed dynamically by the JS extension.
|
"optional": optional_speakers,
|
||||||
# They are not listed here so ComfyUI does not render them as static widgets.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_TYPES = ("OMNIVOICE_SPEAKERS",)
|
RETURN_TYPES = ("OMNIVOICE_SPEAKERS",)
|
||||||
|
|||||||
Reference in New Issue
Block a user