From 70be28025bbaf5721d71e38b3f8ce8fe2c796661 Mon Sep 17 00:00:00 2001 From: shrimbly Date: Wed, 8 Apr 2026 15:17:45 +1200 Subject: [PATCH] feat: add singular-key handling for Seedance/Wan frame URL params Add first_frame_url, last_frame_url, and first_clip_url to the singular-key checks in generateWithKie() so these params receive a single string URL instead of being wrapped in an array. Co-Authored-By: Claude Sonnet 4.5 --- src/app/api/generate/providers/kie.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/api/generate/providers/kie.ts b/src/app/api/generate/providers/kie.ts index c33d005f..82326010 100644 --- a/src/app/api/generate/providers/kie.ts +++ b/src/app/api/generate/providers/kie.ts @@ -432,7 +432,7 @@ export async function generateWithKie( // Single data URL - upload it const url = await uploadImageToKie(requestId, apiKey, value); // Singular keys get a string, plural keys get an array - if (key === "image_url" || key === "video_url" || key === "tail_image_url") { + if (key === "image_url" || key === "video_url" || key === "tail_image_url" || key === "first_frame_url" || key === "last_frame_url" || key === "first_clip_url") { inputParams[key] = url; } else { inputParams[key] = [url]; @@ -453,7 +453,7 @@ export async function generateWithKie( } if (processedArray.length > 0) { // Singular keys get first element, plural keys get full array - if (key === "image_url" || key === "video_url" || key === "tail_image_url") { + if (key === "image_url" || key === "video_url" || key === "tail_image_url" || key === "first_frame_url" || key === "last_frame_url" || key === "first_clip_url") { inputParams[key] = processedArray[0]; } else { inputParams[key] = processedArray; @@ -483,7 +483,7 @@ export async function generateWithKie( } // Some models use singular string, others use arrays - if (imageKey === "image_url" || imageKey === "video_url") { + if (imageKey === "image_url" || imageKey === "video_url" || imageKey === "first_frame_url" || imageKey === "last_frame_url" || imageKey === "first_clip_url") { inputParams[imageKey] = imageUrls[0]; } else { inputParams[imageKey] = imageUrls;