) {
- {/* Lightbox Modal */}
- {showLightbox && contentSrc && (
+ {/* Lightbox Modal (skip for audio) */}
+ {showLightbox && contentSrc && !isAudio && (
setShowLightbox(false)}
diff --git a/src/store/execution/simpleNodeExecutors.ts b/src/store/execution/simpleNodeExecutors.ts
index 0cfcd24d..b451cf7c 100644
--- a/src/store/execution/simpleNodeExecutors.ts
+++ b/src/store/execution/simpleNodeExecutors.ts
@@ -147,9 +147,40 @@ export async function executePromptConstructor(ctx: NodeExecutionContext): Promi
*/
export async function executeOutput(ctx: NodeExecutionContext): Promise {
const { node, getConnectedInputs, updateNodeData, saveDirectoryPath } = ctx;
- const { images, videos } = getConnectedInputs(node.id);
+ const { images, videos, audio } = getConnectedInputs(node.id);
- // Check videos array first (typed data from source)
+ // Check audio array first
+ if (audio.length > 0) {
+ const audioContent = audio[0];
+ updateNodeData(node.id, {
+ audio: audioContent,
+ image: null,
+ video: null,
+ contentType: "audio",
+ });
+
+ // Save to /outputs directory if we have a project path
+ if (saveDirectoryPath) {
+ const outputNodeData = node.data as OutputNodeData;
+ const outputsPath = `${saveDirectoryPath}/outputs`;
+
+ fetch("/api/save-generation", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ directoryPath: outputsPath,
+ audio: audioContent,
+ customFilename: outputNodeData.outputFilename || undefined,
+ createDirectory: true,
+ }),
+ }).catch((err) => {
+ console.error("Failed to save output:", err);
+ });
+ }
+ return;
+ }
+
+ // Check videos array (typed data from source)
if (videos.length > 0) {
const videoContent = videos[0];
updateNodeData(node.id, {
diff --git a/src/types/nodes.ts b/src/types/nodes.ts
index 80a161c2..19a8fb1e 100644
--- a/src/types/nodes.ts
+++ b/src/types/nodes.ts
@@ -242,7 +242,8 @@ export interface OutputNodeData extends BaseNodeData {
image: string | null;
imageRef?: string; // External image reference for storage optimization
video?: string | null; // Video data URL or HTTP URL
- contentType?: "image" | "video"; // Explicit content type hint
+ audio?: string | null; // Audio data URL or HTTP URL
+ contentType?: "image" | "video" | "audio"; // Explicit content type hint
outputFilename?: string; // Custom filename for saved outputs (without extension)
}