From 285b34eb61a57490419ddc906d0742556fd54df7 Mon Sep 17 00:00:00 2001 From: shrimbly Date: Wed, 8 Apr 2026 15:22:33 +1200 Subject: [PATCH] feat: add Kling 3.0, Kling 3.0 Motion, Wan 2.7 T2V/I2V models Add Kling 3.0 (t2v + i2v), Kling 3.0 Motion Control, Wan 2.7 text-to-video, and Wan 2.7 image-to-video with registry entries, schemas, defaults, and image input keys. Co-Authored-By: Claude Sonnet 4.5 --- src/app/api/generate/providers/kie.ts | 34 ++++++++++++++ src/app/api/models/[modelId]/route.ts | 66 +++++++++++++++++++++++++++ src/app/api/models/route.ts | 45 ++++++++++++++++++ 3 files changed, 145 insertions(+) diff --git a/src/app/api/generate/providers/kie.ts b/src/app/api/generate/providers/kie.ts index 70a6d5eb..66471808 100644 --- a/src/app/api/generate/providers/kie.ts +++ b/src/app/api/generate/providers/kie.ts @@ -125,6 +125,22 @@ export function getKieModelDefaults(modelId: string): Record { mode: "normal", }; + // Kling 3.0 video models + case "kling-3.0/video/text-to-video": + case "kling-3.0/video/image-to-video": + return { + aspect_ratio: "16:9", + duration: "5", + mode: "pro", + }; + + // Kling 3.0 motion control + case "kling-3.0/motion-control": + return { + mode: "pro", + character_orientation: "video", + }; + // Kling 2.6 video models case "kling-2.6/text-to-video": case "kling-2.6/image-to-video": @@ -164,6 +180,20 @@ export function getKieModelDefaults(modelId: string): Record { resolution: "1080p", }; + // Wan 2.7 video models + case "wan/2-7-text-to-video": + return { + duration: 5, + resolution: "1080p", + ratio: "16:9", + }; + + case "wan/2-7-image-to-video": + return { + duration: 5, + resolution: "1080p", + }; + // Topaz video upscale case "topaz/video-upscale": return { @@ -216,8 +246,12 @@ export function getKieImageInputKey(modelId: string): string { if (modelId === "bytedance/seedance-2/image-to-video" || modelId === "bytedance/seedance-2-fast/image-to-video") return "first_frame_url"; // Kling 2.5 turbo I2V uses singular image_url if (modelId === "kling/v2-5-turbo-image-to-video-pro") return "image_url"; + // Kling 3.0 motion control uses input_urls + if (modelId === "kling-3.0/motion-control") return "input_urls"; // Kling 2.6 motion control uses input_urls if (modelId === "kling-2.6/motion-control") return "input_urls"; + // Wan 2.7 I2V uses first_frame_url (singular) + if (modelId === "wan/2-7-image-to-video") return "first_frame_url"; // Topaz video upscale uses video_url (singular) if (modelId === "topaz/video-upscale") return "video_url"; // Veo 3 models use imageUrls diff --git a/src/app/api/models/[modelId]/route.ts b/src/app/api/models/[modelId]/route.ts index 960754ba..25f1e113 100644 --- a/src/app/api/models/[modelId]/route.ts +++ b/src/app/api/models/[modelId]/route.ts @@ -961,6 +961,43 @@ function getKieSchema(modelId: string): ExtractedSchema { { name: "video_urls", type: "image", required: true, label: "Video", isArray: true }, ], }, + "kling-3.0/video/text-to-video": { + parameters: [ + { name: "aspect_ratio", type: "string", description: "Output aspect ratio", enum: ["16:9", "9:16", "1:1"], default: "16:9" }, + { name: "duration", type: "string", description: "Video duration in seconds", enum: ["3", "5", "10", "15"], default: "5" }, + { name: "mode", type: "string", description: "Generation mode", enum: ["std", "pro"], default: "pro" }, + { name: "sound", type: "boolean", description: "Enable sound generation", default: false }, + { name: "seed", type: "integer", description: "Random seed for reproducibility", minimum: 0 }, + ], + inputs: [ + { name: "prompt", type: "text", required: false, label: "Prompt" }, + ], + }, + "kling-3.0/video/image-to-video": { + parameters: [ + { name: "aspect_ratio", type: "string", description: "Output aspect ratio", enum: ["16:9", "9:16", "1:1"], default: "16:9" }, + { name: "duration", type: "string", description: "Video duration in seconds", enum: ["3", "5", "10", "15"], default: "5" }, + { name: "mode", type: "string", description: "Generation mode", enum: ["std", "pro"], default: "pro" }, + { name: "sound", type: "boolean", description: "Enable sound generation", default: false }, + { name: "seed", type: "integer", description: "Random seed for reproducibility", minimum: 0 }, + ], + inputs: [ + { name: "prompt", type: "text", required: false, label: "Prompt" }, + { name: "image_urls", type: "image", required: true, label: "Image", isArray: true }, + ], + }, + "kling-3.0/motion-control": { + 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" }, + ], + inputs: [ + { name: "prompt", type: "text", required: false, label: "Prompt" }, + { name: "input_urls", type: "image", required: true, label: "Image", isArray: true }, + { name: "video_urls", type: "image", required: true, label: "Video", isArray: true }, + ], + }, "kling/v2-5-turbo-text-to-video-pro": { parameters: [ { name: "aspect_ratio", type: "string", description: "Output aspect ratio", enum: ["16:9", "9:16", "1:1"], default: "16:9" }, @@ -1006,6 +1043,35 @@ function getKieSchema(modelId: string): ExtractedSchema { { name: "image_urls", type: "image", required: true, label: "Image", isArray: true }, ], }, + "wan/2-7-text-to-video": { + parameters: [ + { name: "resolution", type: "string", description: "Output resolution", enum: ["720p", "1080p"], default: "1080p" }, + { name: "ratio", type: "string", description: "Output aspect ratio", enum: ["16:9", "9:16", "1:1", "4:3", "3:4"], default: "16:9" }, + { name: "duration", type: "integer", description: "Video duration in seconds (2-15)", default: 5, minimum: 2, maximum: 15 }, + { name: "prompt_extend", type: "boolean", description: "Enable prompt extension", default: true }, + { name: "watermark", type: "boolean", description: "Add watermark", default: false }, + { name: "seed", type: "integer", description: "Random seed for reproducibility", minimum: 0 }, + ], + inputs: [ + { name: "prompt", type: "text", required: true, label: "Prompt" }, + { name: "negative_prompt", type: "text", required: false, label: "Negative Prompt" }, + ], + }, + "wan/2-7-image-to-video": { + parameters: [ + { name: "resolution", type: "string", description: "Output resolution", enum: ["720p", "1080p"], default: "1080p" }, + { name: "duration", type: "integer", description: "Video duration in seconds (2-15)", default: 5, minimum: 2, maximum: 15 }, + { name: "prompt_extend", type: "boolean", description: "Enable prompt extension", default: true }, + { name: "watermark", type: "boolean", description: "Add watermark", default: false }, + { name: "seed", type: "integer", description: "Random seed for reproducibility", minimum: 0 }, + ], + inputs: [ + { name: "prompt", type: "text", required: false, label: "Prompt" }, + { name: "negative_prompt", type: "text", required: false, label: "Negative Prompt" }, + { name: "first_frame_url", type: "image", required: true, label: "First Frame" }, + { name: "last_frame_url", type: "image", required: false, label: "Last Frame" }, + ], + }, "wan/2-6-video-to-video": { parameters: [ { name: "duration", type: "string", description: "Video duration in seconds", enum: ["5", "10"], default: "5" }, diff --git a/src/app/api/models/route.ts b/src/app/api/models/route.ts index 71249e9b..8580f6fe 100644 --- a/src/app/api/models/route.ts +++ b/src/app/api/models/route.ts @@ -320,6 +320,33 @@ const KIE_MODELS: ProviderModel[] = [ coverImage: undefined, pageUrl: "https://kie.ai/kling-2-6", }, + { + id: "kling-3.0/video/text-to-video", + name: "Kling 3.0", + description: "Kling 3.0 text-to-video generation via Kie.ai. Supports 3-15 second videos with sound.", + provider: "kie", + capabilities: ["text-to-video"], + coverImage: undefined, + pageUrl: "https://docs.kie.ai/market/kling/3-0", + }, + { + id: "kling-3.0/video/image-to-video", + name: "Kling 3.0 I2V", + description: "Kling 3.0 image-to-video generation via Kie.ai. Supports up to 2 reference images.", + provider: "kie", + capabilities: ["image-to-video"], + coverImage: undefined, + pageUrl: "https://docs.kie.ai/market/kling/3-0", + }, + { + id: "kling-3.0/motion-control", + name: "Kling 3.0 Motion Control", + description: "Kling 3.0 motion transfer from video to static image via Kie.ai.", + provider: "kie", + capabilities: ["image-to-video"], + coverImage: undefined, + pageUrl: "https://docs.kie.ai/market/kling/3-0-motion", + }, { id: "kling/v2-5-turbo-text-to-video-pro", name: "Kling 2.5 Turbo", @@ -367,6 +394,24 @@ const KIE_MODELS: ProviderModel[] = [ coverImage: undefined, pageUrl: "https://kie.ai/wan-2-6", }, + { + id: "wan/2-7-text-to-video", + name: "Wan 2.7", + description: "Wan 2.7 text-to-video generation via Kie.ai. Supports prompt extension and watermark control.", + provider: "kie", + capabilities: ["text-to-video"], + coverImage: undefined, + pageUrl: "https://docs.kie.ai/market/wan/2-7-t2v", + }, + { + id: "wan/2-7-image-to-video", + name: "Wan 2.7 I2V", + description: "Wan 2.7 image-to-video generation via Kie.ai. Supports first and last frame control.", + provider: "kie", + capabilities: ["image-to-video"], + coverImage: undefined, + pageUrl: "https://docs.kie.ai/market/wan/2-7-i2v", + }, { id: "topaz/video-upscale", name: "Topaz Video Upscale",