diff --git a/src/components/WorkflowCanvas.tsx b/src/components/WorkflowCanvas.tsx index 884b43ae..17d3b7fe 100644 --- a/src/components/WorkflowCanvas.tsx +++ b/src/components/WorkflowCanvas.tsx @@ -124,6 +124,8 @@ const getNodeHandles = (nodeType: string): { inputs: string[]; outputs: string[] return { inputs: ["image", "text"], outputs: ["video"] }; case "generate3d": return { inputs: ["image", "text"], outputs: ["3d"] }; + case "generateAudio": + return { inputs: ["text"], outputs: ["audio"] }; case "llmGenerate": return { inputs: ["text", "image"], outputs: ["text"] }; case "splitGrid": @@ -810,7 +812,7 @@ export function WorkflowCanvas() { sourceHandleIdForNewNode = "image"; } } else if (handleType === "text") { - if (nodeType === "nanoBanana" || nodeType === "generateVideo" || nodeType === "llmGenerate") { + if (nodeType === "nanoBanana" || nodeType === "generateVideo" || nodeType === "generateAudio" || nodeType === "llmGenerate") { targetHandleId = "text"; // llmGenerate also has a text output if (nodeType === "llmGenerate") { @@ -841,6 +843,10 @@ export function WorkflowCanvas() { if (nodeType === "audioInput") { // AudioInput outputs audio sourceHandleIdForNewNode = "audio"; + } else if (nodeType === "generateAudio") { + // GenerateAudio outputs audio + sourceHandleIdForNewNode = "audio"; + targetHandleId = "text"; } else if (nodeType === "videoStitch") { // VideoStitch accepts audio targetHandleId = "audio"; diff --git a/src/types/api.ts b/src/types/api.ts index ceb3f652..080da5bc 100644 --- a/src/types/api.ts +++ b/src/types/api.ts @@ -16,7 +16,7 @@ export interface GenerateRequest { resolution?: Resolution; // Only for Nano Banana Pro model?: ModelType; useGoogleSearch?: boolean; // Only for Nano Banana Pro - mediaType?: "image" | "video" | "3d"; // Indicates expected output type for provider routing + mediaType?: "image" | "video" | "3d" | "audio"; // Indicates expected output type for provider routing } export interface GenerateResponse { @@ -24,8 +24,10 @@ export interface GenerateResponse { image?: string; video?: string; videoUrl?: string; // For large videos, return URL directly + audio?: string; // Base64 audio data + audioUrl?: string; // For large audio, return URL directly model3dUrl?: string; // For 3D models, return GLB URL directly - contentType?: "image" | "video" | "3d"; + contentType?: "image" | "video" | "3d" | "audio"; error?: string; }