diff --git a/src/store/execution/generateVideoExecutor.ts b/src/store/execution/generateVideoExecutor.ts index 4bb47222..140eb2a3 100644 --- a/src/store/execution/generateVideoExecutor.ts +++ b/src/store/execution/generateVideoExecutor.ts @@ -33,7 +33,7 @@ export async function executeGenerateVideo( const { useStoredFallback = false } = options; - const { images: connectedImages, text: connectedText, dynamicInputs } = getConnectedInputs(node.id); + const { images: connectedImages, text: connectedText, audio: connectedAudio, dynamicInputs } = getConnectedInputs(node.id); // Get fresh node data from store const freshNode = getFreshNode(node.id); @@ -48,7 +48,8 @@ export async function executeGenerateVideo( text = connectedText ?? nodeData.inputPrompt; // Validate fallback inputs the same way as the regular path const hasPrompt = text || dynamicInputs.prompt || dynamicInputs.negative_prompt; - if (!hasPrompt && images.length === 0) { + const hasAudio = connectedAudio.length > 0; + if (!hasPrompt && images.length === 0 && !hasAudio) { updateNodeData(node.id, { status: "error", error: "Missing required inputs", @@ -58,9 +59,10 @@ export async function executeGenerateVideo( } else { images = connectedImages; text = connectedText; - // For dynamic inputs, check if we have at least a prompt + // For dynamic inputs, check if we have at least a prompt, images, or audio const hasPrompt = text || dynamicInputs.prompt || dynamicInputs.negative_prompt; - if (!hasPrompt && images.length === 0) { + const hasAudio = connectedAudio.length > 0; + if (!hasPrompt && images.length === 0 && !hasAudio) { updateNodeData(node.id, { status: "error", error: "Missing required inputs", diff --git a/src/store/utils/connectedInputs.ts b/src/store/utils/connectedInputs.ts index 9554e3e7..6099f09d 100644 --- a/src/store/utils/connectedInputs.ts +++ b/src/store/utils/connectedInputs.ts @@ -188,6 +188,7 @@ export function getConnectedInputsPure( if (inputSchema && inputSchema.length > 0) { const imageInputs = inputSchema.filter(i => i.type === "image"); const textInputs = inputSchema.filter(i => i.type === "text"); + const audioInputs = inputSchema.filter(i => i.type === "audio"); imageInputs.forEach((input, index) => { handleToSchemaName[`image-${index}`] = input.name; @@ -202,6 +203,13 @@ export function getConnectedInputsPure( handleToSchemaName["text"] = input.name; } }); + + audioInputs.forEach((input, index) => { + handleToSchemaName[`audio-${index}`] = input.name; + if (index === 0) { + handleToSchemaName["audio"] = input.name; + } + }); } // Cache passthrough node results so multiple edges from the same router/switch