From aedbe2e7d9fec35611b4bcb2338862a008187d18 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Mon, 6 Apr 2026 09:41:56 +0200 Subject: [PATCH] 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 --- nodes/multi_speaker.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nodes/multi_speaker.py b/nodes/multi_speaker.py index 96918cd..2bba31a 100644 --- a/nodes/multi_speaker.py +++ b/nodes/multi_speaker.py @@ -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",)