Browse Source

fix: correct background_source enum values for Kling 3.0 Motion Control

Per Kie docs, background_source accepts "input_video"/"input_image",
not "image"/"video". The previous wrong values were being sent to the
API after schema defaults pre-population, causing request rejection.

Also added background_source to getKieModelDefaults() for consistency.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 3 months ago
parent
commit
04c6ee02c5
  1. 1
      src/app/api/generate/providers/kie.ts
  2. 2
      src/app/api/models/[modelId]/route.ts

1
src/app/api/generate/providers/kie.ts

@ -139,6 +139,7 @@ export function getKieModelDefaults(modelId: string): Record<string, unknown> {
return {
mode: "pro",
character_orientation: "video",
background_source: "input_video",
};
// Kling 2.6 video models

2
src/app/api/models/[modelId]/route.ts

@ -990,7 +990,7 @@ function getKieSchema(modelId: string): ExtractedSchema {
parameters: [
{ name: "mode", type: "string", description: "Generation mode", enum: ["std", "pro"], default: "pro" },
{ name: "character_orientation", type: "string", description: "Character orientation source", enum: ["image", "video"], default: "video" },
{ name: "background_source", type: "string", description: "Background source", enum: ["image", "video"], default: "video" },
{ name: "background_source", type: "string", description: "Background source", enum: ["input_video", "input_image"], default: "input_video" },
],
inputs: [
{ name: "prompt", type: "text", required: false, label: "Prompt" },

Loading…
Cancel
Save