Browse Source

feat: add audio handle mapping and pass audio through video executor

Extend handleToSchemaName in getConnectedInputsPure() to map audio-0
handles to schema names, enabling audio data flow via dynamicInputs.
Update generateVideoExecutor to destructure audio from connected inputs
and allow execution when audio is the only connected input.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 3 months ago
parent
commit
5178b24294
  1. 10
      src/store/execution/generateVideoExecutor.ts
  2. 8
      src/store/utils/connectedInputs.ts

10
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",

8
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

Loading…
Cancel
Save