feat: add video-to-video models (Kling O3 reference, 4K, v3 motion control)#211
feat: add video-to-video models (Kling O3 reference, 4K, v3 motion control)#211SecurityQQ merged 1 commit intomainfrom
Conversation
…ntrol) Add 6 new Kling video models with video input support: - kling-v3-4k: native 4K image-to-video ($0.42/sec) - kling-v3-ref: O3 Pro reference-to-video with character consistency ($0.112-0.14/sec) - kling-v3-4k-ref: O3 4K reference-to-video ($0.42/sec) - kling-v3-v2v-ref: O3 Standard video-to-video reference preserving motion/camera ($0.126/sec) - kling-v3-motion: V3 Pro motion control - transfer motion to character (up to 30s, $0.168/sec) - kling-v3-motion-standard: V3 Standard motion control ($0.126/sec) Also: - GenerateVideoPrompt now accepts singular or array for images/audio/video fields - Video action routes video+image to motion control, video-only to v2v reference - Added v2v/vid2vid resolver aliases - Added motionControl() and videoToVideoReference() convenience methods to fal provider
|
Caution Review failedPull request was closed or merged during review 📝 Walkthroughwalkthroughadds expanded kling video model variants and new video transformation capabilities. changes
estimated code review effort🎯 3 (moderate) | ⏱️ ~25 minutes possibly related prs
poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
GenerateVideoPromptaccept both singular and array forimages/audio/videofieldsvideoinput to thevideoaction with automatic routing (video+image → motion control, video-only → v2v reference)New Models
kling-v3-4kfal-ai/kling-video/o3/4k/image-to-videokling-v3-reffal-ai/kling-video/o3/pro/reference-to-videokling-v3-4k-reffal-ai/kling-video/o3/4k/reference-to-videokling-v3-v2v-reffal-ai/kling-video/o3/standard/video-to-video/referencekling-v3-motionfal-ai/kling-video/v3/pro/motion-controlkling-v3-motion-standardfal-ai/kling-video/v3/standard/motion-controlChanges by file
AI SDK Provider Layer
src/ai-sdk/providers/fal.ts— AddedREFERENCE_VIDEO_MODELSandV2V_REFERENCE_MODELSmaps,kling-v3-4ktoVIDEO_MODELS, v3 motion models toMOTION_CONTROL_MODELS. New dispatch branches for reference-to-video and v2v-reference with proper input mapping (start/end images, video_url, image_urls, generate_audio, keep_audio). New resolver methods.src/ai-sdk/providers/model-rules.ts— Duration rules for all 4 new duration-based models (stringIntDuration(3, 15, 5))src/ai-sdk/generate-video.ts—GenerateVideoPrompttype now acceptsDataContent | Array<DataContent>for images/audio/video (backwards compatible).normalizePrompt()usestoArray()helper for uniform handling.Definition Layer
src/definitions/models/kling.ts— 6 newModelDefinitionexports with Zod schemas and pricing. Motion control models default tocharacter_orientation: "video"(supports up to 30s reference video).src/definitions/models/index.ts— Registered all 6 new definitions in exports andallModels[]src/definitions/actions/video.ts— Addedvideoinput field. Routes: video+image →motionControl(), video-only →videoToVideoReference()Legacy Provider
src/providers/fal.ts— AddedmotionControl()andvideoToVideoReference()convenience methods withensureUrl()for local file upload supportUI/DX
src/react/renderers/progress.ts— Time estimates for all 6 new modelssrc/core/registry/resolver.ts— Addedv2vandvid2vidaliasesUsage
Verification
bunx tsc --noEmit— zero new errors (all errors are pre-existing Uint8Array/heygen/captions issues)bun test src/ai-sdk/providers/fal.test.ts— 13/13 pass