From 659257a36f11d92cc0d57ddf34ebea5a5e0d693b Mon Sep 17 00:00:00 2001 From: shrimbly Date: Sat, 18 Apr 2026 19:57:16 +1200 Subject: [PATCH] fix: correct Seedance 2.0 and Nano Banana 2 API parameter schemas - Seedance 2.0 T2V/I2V: expand aspect_ratio enum (add 4:3, 3:4, 21:9, adaptive), add 480p resolution, change duration default from 8 to 5 - Seedance 2.0 Fast T2V/I2V: same aspect_ratio fix, add 480p but remove 1080p (unsupported), change duration default from 8 to 5 - Nano Banana 2: expand aspect_ratio enum to full set (15 values), remove invalid 512 resolution, add output_format parameter (jpg/png) - Fix Nano Banana 2 pageUrl to match actual docs path (nanobanana2) Co-Authored-By: Claude Opus 4.6 --- src/app/api/generate/providers/kie.ts | 2 +- src/app/api/models/[modelId]/route.ts | 29 ++++++++++++++------------- src/app/api/models/route.ts | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/app/api/generate/providers/kie.ts b/src/app/api/generate/providers/kie.ts index 1d1a425f..9dfc5765 100644 --- a/src/app/api/generate/providers/kie.ts +++ b/src/app/api/generate/providers/kie.ts @@ -105,7 +105,7 @@ export function getKieModelDefaults(modelId: string): Record { return { aspect_ratio: "16:9", resolution: "720p", - duration: 8, + duration: 5, generate_audio: true, web_search: false, }; diff --git a/src/app/api/models/[modelId]/route.ts b/src/app/api/models/[modelId]/route.ts index ba1aa55f..4e3023ef 100644 --- a/src/app/api/models/[modelId]/route.ts +++ b/src/app/api/models/[modelId]/route.ts @@ -750,8 +750,9 @@ function getKieSchema(modelId: string): ExtractedSchema { }, "nano-banana-2": { parameters: [ - { name: "aspect_ratio", type: "string", description: "Output aspect ratio", enum: ["1:1", "2:3", "3:2", "4:3", "16:9", "9:16", "21:9", "auto"], default: "auto" }, - { name: "resolution", type: "string", description: "Output resolution", enum: ["512", "1K", "2K", "4K"], default: "1K" }, + { name: "aspect_ratio", type: "string", description: "Output aspect ratio", enum: ["1:1", "1:4", "1:8", "2:3", "3:2", "3:4", "4:1", "4:3", "4:5", "5:4", "8:1", "9:16", "16:9", "21:9", "auto"], default: "auto" }, + { name: "resolution", type: "string", description: "Output resolution", enum: ["1K", "2K", "4K"], default: "1K" }, + { name: "output_format", type: "string", description: "Output image format", enum: ["jpg", "png"], default: "jpg" }, ], inputs: [ { name: "prompt", type: "text", required: true, label: "Prompt" }, @@ -860,9 +861,9 @@ function getKieSchema(modelId: string): ExtractedSchema { // ============ Video models ============ "bytedance/seedance-2/text-to-video": { parameters: [ - { name: "aspect_ratio", type: "string", description: "Output aspect ratio", enum: ["16:9", "9:16", "1:1"], default: "16:9" }, - { name: "resolution", type: "string", description: "Output resolution", enum: ["720p", "1080p"], default: "720p" }, - { name: "duration", type: "integer", description: "Video duration in seconds (4-15)", default: 8, minimum: 4, maximum: 15 }, + { name: "aspect_ratio", type: "string", description: "Output aspect ratio", enum: ["1:1", "4:3", "3:4", "16:9", "9:16", "21:9", "adaptive"], default: "16:9" }, + { name: "resolution", type: "string", description: "Output resolution", enum: ["480p", "720p", "1080p"], default: "720p" }, + { name: "duration", type: "integer", description: "Video duration in seconds (4-15)", default: 5, minimum: 4, maximum: 15 }, { name: "generate_audio", type: "boolean", description: "Generate audio with the video", default: true }, { name: "web_search", type: "boolean", description: "Enable web search for prompt enhancement", default: false }, { name: "seed", type: "integer", description: "Random seed for reproducibility", minimum: 0 }, @@ -871,9 +872,9 @@ function getKieSchema(modelId: string): ExtractedSchema { }, "bytedance/seedance-2/image-to-video": { parameters: [ - { name: "aspect_ratio", type: "string", description: "Output aspect ratio", enum: ["16:9", "9:16", "1:1"], default: "16:9" }, - { name: "resolution", type: "string", description: "Output resolution", enum: ["720p", "1080p"], default: "720p" }, - { name: "duration", type: "integer", description: "Video duration in seconds (4-15)", default: 8, minimum: 4, maximum: 15 }, + { name: "aspect_ratio", type: "string", description: "Output aspect ratio", enum: ["1:1", "4:3", "3:4", "16:9", "9:16", "21:9", "adaptive"], default: "16:9" }, + { name: "resolution", type: "string", description: "Output resolution", enum: ["480p", "720p", "1080p"], default: "720p" }, + { name: "duration", type: "integer", description: "Video duration in seconds (4-15)", default: 5, minimum: 4, maximum: 15 }, { name: "generate_audio", type: "boolean", description: "Generate audio with the video", default: true }, { name: "web_search", type: "boolean", description: "Enable web search for prompt enhancement", default: false }, { name: "seed", type: "integer", description: "Random seed for reproducibility", minimum: 0 }, @@ -885,9 +886,9 @@ function getKieSchema(modelId: string): ExtractedSchema { }, "bytedance/seedance-2-fast/text-to-video": { parameters: [ - { name: "aspect_ratio", type: "string", description: "Output aspect ratio", enum: ["16:9", "9:16", "1:1"], default: "16:9" }, - { name: "resolution", type: "string", description: "Output resolution", enum: ["720p", "1080p"], default: "720p" }, - { name: "duration", type: "integer", description: "Video duration in seconds (4-15)", default: 8, minimum: 4, maximum: 15 }, + { name: "aspect_ratio", type: "string", description: "Output aspect ratio", enum: ["1:1", "4:3", "3:4", "16:9", "9:16", "21:9", "adaptive"], default: "16:9" }, + { name: "resolution", type: "string", description: "Output resolution", enum: ["480p", "720p"], default: "720p" }, + { name: "duration", type: "integer", description: "Video duration in seconds (4-15)", default: 5, minimum: 4, maximum: 15 }, { name: "generate_audio", type: "boolean", description: "Generate audio with the video", default: true }, { name: "web_search", type: "boolean", description: "Enable web search for prompt enhancement", default: false }, { name: "seed", type: "integer", description: "Random seed for reproducibility", minimum: 0 }, @@ -896,9 +897,9 @@ function getKieSchema(modelId: string): ExtractedSchema { }, "bytedance/seedance-2-fast/image-to-video": { parameters: [ - { name: "aspect_ratio", type: "string", description: "Output aspect ratio", enum: ["16:9", "9:16", "1:1"], default: "16:9" }, - { name: "resolution", type: "string", description: "Output resolution", enum: ["720p", "1080p"], default: "720p" }, - { name: "duration", type: "integer", description: "Video duration in seconds (4-15)", default: 8, minimum: 4, maximum: 15 }, + { name: "aspect_ratio", type: "string", description: "Output aspect ratio", enum: ["1:1", "4:3", "3:4", "16:9", "9:16", "21:9", "adaptive"], default: "16:9" }, + { name: "resolution", type: "string", description: "Output resolution", enum: ["480p", "720p"], default: "720p" }, + { name: "duration", type: "integer", description: "Video duration in seconds (4-15)", default: 5, minimum: 4, maximum: 15 }, { name: "generate_audio", type: "boolean", description: "Generate audio with the video", default: true }, { name: "web_search", type: "boolean", description: "Enable web search for prompt enhancement", default: false }, { name: "seed", type: "integer", description: "Random seed for reproducibility", minimum: 0 }, diff --git a/src/app/api/models/route.ts b/src/app/api/models/route.ts index 8580f6fe..cb1f451b 100644 --- a/src/app/api/models/route.ts +++ b/src/app/api/models/route.ts @@ -162,7 +162,7 @@ const KIE_MODELS: ProviderModel[] = [ provider: "kie", capabilities: ["text-to-image", "image-to-image"], coverImage: undefined, - pageUrl: "https://docs.kie.ai/market/google/nano-banana-2", + pageUrl: "https://docs.kie.ai/market/google/nanobanana2", }, { id: "google/imagen4",