/** * Video Generation API * * This file contains the implementation for video generation models including: * - alibaba/wan2.1-t2v-plus (Text-to-Video) * - alibaba/wan2.1-t2v-turbo (Text-to-Video) * - alibaba/wan2.2-14b-animate-replace (Image-to-Video) * - alibaba/wan2.2-vace-fun-a14b-reframe (Image-to-Video - Reframe) * - alibaba/wan2.2-vace-fun-a14b-outpainting (Image-to-Video - Outpainting) * - alibaba/wan2.2-vace-fun-a14b-inpainting (Image-to-Video - Inpainting) * - alibaba/wan2.2-vace-fun-a14b-pose (Image-to-Video - Pose) * - alibaba/wan2.2-vace-fun-a14b-depth (Image-to-Video - Depth) * - bytedance/seedance-1-0-lite-t2v (Text-to-Video) * - bytedance/seedance-1-0-lite-i2v (Image-to-Video) * - bytedance/seedance-1-0-pro-fast (Text-to-Video/Image-to-Video) * - bytedance/omnihuman (Lip-Sync from Image + Audio) * - bytedance/omnihuman/v1.5 (Lip-Sync from Image + Audio - Enhanced) * - google/veo-3.1-t2v (Text-to-Video) * - google/veo-3.1-t2v-fast (Text-to-Video) * - google/veo-3.1-i2v-fast (Image-to-Video) * - klingai/avatar-standard (Lip-Sync from Image + Audio, 720p 24fps) * - klingai/avatar-pro (Lip-Sync from Image + Audio, 1080p 48fps) * - klingai/video-v2-6-pro-text-to-video (Text-to-Video with audio) * - klingai/video-v2-6-pro-image-to-video (Image-to-Video with audio) * - klingai/video-o1-image-to-video (Image-to-Video) * - klingai/video-o1-reference-to-video (Multi-image Reference-to-Video) * - klingai/video-o1-video-to-video-edit (Video-to-Video Edit) * - klingai/video-o1-video-to-video-reference (Video-to-Video Reference) * - klingai/video-v2-6-pro-motion-control (Motion Control) * - krea/krea-wan-14b/text-to-video (Text-to-Video) * - krea/krea-wan-14b/video-to-video (Video-to-Video) * - ltxv/ltxv-2 (Text-to-Video/Image-to-Video) * - ltxv/ltxv-2-fast (Text-to-Video/Image-to-Video - Fast) * - luma/ray-2 (Text-to-Video/Image-to-Video with Keyframes) * - magic/text-to-video (Text Embedding in Video Templates) * - magic/image-to-video (Image Embedding in Video Templates) * - magic/video-to-video (Video Embedding in Video Templates) * - video-01 (Text-to-Video/Image-to-Video by Hailuo AI) * - video-01-live2d (Animated Video by Hailuo AI) * - minimax/hailuo-02 (Text-to-Video/Image-to-Video - Enhanced Physics) * - minimax/hailuo-2.3 (Text-to-Video/Image-to-Video - Improved Motion) * - minimax/hailuo-2.3-fast (Text-to-Video/Image-to-Video - Fast) * - openai/sora-2-i2v (Image-to-Video by OpenAI with synced audio) * - openai/sora-2-pro-t2v (Text-to-Video by OpenAI - State-of-the-art) * - openai/sora-2-pro-i2v (Image-to-Video by OpenAI - State-of-the-art) * - openai/sora-2-t2v (Text-to-Video by OpenAI with synced audio) * - pixverse/v5/text-to-video (Fast T2V with synced audio) * - pixverse/v5/image-to-video (Fast I2V with synced audio) * - pixverse/v5/transition (Transition between two images) * - pixverse/v5-5/text-to-video (Enhanced T2V with multi-clip and audio) * - pixverse/v5-5/image-to-video (Enhanced I2V with multi-clip and audio) * - pixverse/lip-sync (Lip-sync from video + audio/text) * - gen3a_turbo (Runway I2V with smooth motion and textures) * - runway/gen4_turbo (Runway I2V with higher visual quality) * - runway/gen4_aleph (Runway V2V - modify/generate next shot) * - runway/act_two (Runway character animation from reference) * - sber-ai/kandinsky5-t2v (Text-to-Video diffusion model) * - sber-ai/kandinsky5-distill-t2v (Fast compact T2V variant) * - tencent/hunyuan-video-foley (Video-to-Video sound generation) * - veed/fabric-1.0 (Talking head from image + audio) * - veed/fabric-1.0-fast (Fast talking head variant) * * All video models use the universal endpoint: /v2/video/generations */ import { type AIMLAPIClient } from '../client'; /** * Common video generation response interface */ export interface WanVideoGenerationResponse { id: string; status: 'queued' | 'generating' | 'completed' | 'error'; video?: { url: string; } | null; error?: { name: string; message: string; } | null; meta?: { usage?: { credits_used: number; }; } | null; } /** * Common video generation result interface for completed videos */ export interface WanVideoGenerationResult extends WanVideoGenerationResponse { status: 'completed'; video: { url: string; }; } /** * Common video generation error interface for failed videos */ export interface WanVideoGenerationError extends WanVideoGenerationResponse { status: 'error'; error: { name: string; message: string; }; } /** * Parameters for Wan 2.1 Plus text-to-video generation */ export interface Wan21PlusParams { model: 'alibaba/wan2.1-t2v-plus'; prompt: string; resolution?: '720P'; aspect_ratio?: '16:9' | '9:16' | '1:1' | '4:3' | '3:4'; negative_prompt?: string; watermark?: boolean; seed?: number; enhance_prompt?: boolean; } /** * Parameters for Wan 2.1 Turbo text-to-video generation */ export interface Wan21TurboParams { model: 'alibaba/wan2.1-t2v-turbo'; prompt: string; resolution?: '480P' | '720P'; aspect_ratio?: '16:9' | '9:16' | '1:1' | '4:3' | '3:4'; negative_prompt?: string; watermark?: boolean; seed?: number; enhance_prompt?: boolean; } /** * Parameters for Wan 2.2 Animate Replace image-to-video generation */ export interface Wan22AnimateReplaceParams { model: 'alibaba/wan2.2-14b-animate-replace'; video_url: string; image_url: string; resolution?: '480p' | '580p' | '720p'; num_inference_steps?: number; enable_safety_checker?: boolean; shift?: number; video_quality?: 'low' | 'medium' | 'high' | 'maximum'; video_write_mode?: 'fast' | 'balanced' | 'small'; } /** * Parameters for Wan 2.2 VACE Fun Reframe image-to-video generation * Zooms the video by a specified factor while maintaining quality */ export interface Wan22VaceFunReframeParams { model: 'alibaba/wan2.2-vace-fun-a14b-reframe'; video_url: string; negative_prompt?: string; match_input_num_frames?: boolean; num_frames?: number; match_input_frames_per_second?: boolean; frames_per_second?: number; resolution?: '480p' | '580p' | '720p'; aspect_ratio?: 'auto' | '16:9' | '1:1' | '9:16'; num_inference_steps?: number; guidance_scale?: number; shift?: number; enable_safety_checker?: boolean; enable_prompt_expansion?: boolean; preprocess?: boolean; acceleration?: 'none' | 'regular'; video_quality?: 'low' | 'medium' | 'high' | 'maximum'; video_write_mode?: 'fast' | 'balanced' | 'small'; num_interpolated_frames?: number; temporal_downsample_factor?: number; enable_auto_downsample?: boolean; auto_downsample_min_fps?: number; interpolator_model?: 'rife' | 'film'; sync_mode?: boolean; zoom_factor?: number; trim_borders?: boolean; } /** * Parameters for Wan 2.2 VACE Fun Outpainting image-to-video generation * Expands the video canvas in specified directions */ export interface Wan22VaceFunOutpaintingParams { model: 'alibaba/wan2.2-vace-fun-a14b-outpainting'; prompt: string; video_url: string; negative_prompt?: string; match_input_num_frames?: boolean; num_frames?: number; match_input_frames_per_second?: boolean; frames_per_second?: number; resolution?: '480p' | '580p' | '720p'; aspect_ratio?: 'auto' | '16:9' | '1:1' | '9:16'; num_inference_steps?: number; guidance_scale?: number; shift?: number; enable_safety_checker?: boolean; enable_prompt_expansion?: boolean; preprocess?: boolean; acceleration?: 'none' | 'regular'; video_quality?: 'low' | 'medium' | 'high' | 'maximum'; video_write_mode?: 'fast' | 'balanced' | 'small'; num_interpolated_frames?: number; temporal_downsample_factor?: number; enable_auto_downsample?: boolean; auto_downsample_min_fps?: number; interpolator_model?: 'rife' | 'film'; sync_mode?: boolean; expand_left?: boolean; expand_right?: boolean; expand_top?: boolean; expand_bottom?: boolean; expand_ratio?: number; } /** * Parameters for Wan 2.2 VACE Fun Inpainting image-to-video generation * Modifies specified regions of the video using masks */ export interface Wan22VaceFunInpaintingParams { model: 'alibaba/wan2.2-vace-fun-a14b-inpainting'; prompt: string; video_url: string; negative_prompt?: string; match_input_num_frames?: boolean; num_frames?: number; match_input_frames_per_second?: boolean; frames_per_second?: number; resolution?: '480p' | '580p' | '720p'; aspect_ratio?: 'auto' | '16:9' | '1:1' | '9:16'; num_inference_steps?: number; guidance_scale?: number; shift?: number; enable_safety_checker?: boolean; enable_prompt_expansion?: boolean; preprocess?: boolean; acceleration?: 'none' | 'regular'; video_quality?: 'low' | 'medium' | 'high' | 'maximum'; video_write_mode?: 'fast' | 'balanced' | 'small'; num_interpolated_frames?: number; temporal_downsample_factor?: number; enable_auto_downsample?: boolean; auto_downsample_min_fps?: number; interpolator_model?: 'rife' | 'film'; sync_mode?: boolean; image_list?: string[]; mask_video_url?: string; } /** * Parameters for Wan 2.2 VACE Fun Pose image-to-video generation * Transfers pose from source video to generated video */ export interface Wan22VaceFunPoseParams { model: 'alibaba/wan2.2-vace-fun-a14b-pose'; prompt: string; video_url: string; negative_prompt?: string; match_input_num_frames?: boolean; num_frames?: number; match_input_frames_per_second?: boolean; frames_per_second?: number; resolution?: '480p' | '580p' | '720p'; aspect_ratio?: 'auto' | '16:9' | '1:1' | '9:16'; num_inference_steps?: number; guidance_scale?: number; shift?: number; enable_safety_checker?: boolean; enable_prompt_expansion?: boolean; preprocess?: boolean; acceleration?: 'none' | 'regular'; video_quality?: 'low' | 'medium' | 'high' | 'maximum'; video_write_mode?: 'fast' | 'balanced' | 'small'; num_interpolated_frames?: number; temporal_downsample_factor?: number; enable_auto_downsample?: boolean; auto_downsample_min_fps?: number; interpolator_model?: 'rife' | 'film'; sync_mode?: boolean; } /** * Parameters for Wan 2.2 VACE Fun Depth image-to-video generation * Uses depth information for video generation control */ export interface Wan22VaceFunDepthParams { model: 'alibaba/wan2.2-vace-fun-a14b-depth'; prompt: string; video_url: string; negative_prompt?: string; match_input_num_frames?: boolean; num_frames?: number; match_input_frames_per_second?: boolean; frames_per_second?: number; resolution?: '480p' | '580p' | '720p'; aspect_ratio?: 'auto' | '16:9' | '1:1' | '9:16'; num_inference_steps?: number; guidance_scale?: number; shift?: number; enable_safety_checker?: boolean; enable_prompt_expansion?: boolean; preprocess?: boolean; acceleration?: 'none' | 'regular'; video_quality?: 'low' | 'medium' | 'high' | 'maximum'; video_write_mode?: 'fast' | 'balanced' | 'small'; num_interpolated_frames?: number; temporal_downsample_factor?: number; enable_auto_downsample?: boolean; auto_downsample_min_fps?: number; interpolator_model?: 'rife' | 'film'; sync_mode?: boolean; } /** * Parameters for Seedance 1.0 Lite text-to-video generation * ByteDance's fast and efficient video generation model */ export interface Seedance1LiteT2VParams { model: 'bytedance/seedance-1-0-lite-t2v'; prompt: string; resolution?: '480p' | '720p' | '1080p'; duration?: 5 | 10; watermark?: boolean; seed?: number; camerafixed?: boolean; aspect_ratio?: '16:9' | '4:3' | '1:1' | '3:4' | '9:16' | '21:9' | '9:21'; } /** * Parameters for Seedance 1.0 Lite image-to-video generation * ByteDance's fast and efficient image-to-video generation model */ export interface Seedance1LiteI2VParams { model: 'bytedance/seedance-1-0-lite-i2v'; image_url: string; prompt: string; resolution?: '480p' | '720p' | '1080p'; duration?: 5 | 10; watermark?: boolean; seed?: number; camerafixed?: boolean; } /** * Parameters for Seedance 1.0 Pro Fast generation * ByteDance's professional fast video generation model supporting T2V and I2V */ export interface Seedance1ProFastParams { model: 'bytedance/seedance-1-0-pro-fast'; prompt: string; image_url?: string; last_image_url?: string; resolution?: '480p' | '720p' | '1080p'; duration?: 5 | 10; watermark?: boolean; seed?: number; camerafixed?: boolean; } /** * Parameters for OmniHuman lip-sync video generation * ByteDance's advanced AI framework for realistic lip-sync videos from image + audio */ export interface OmniHumanParams { model: 'bytedance/omnihuman'; image_url: string; audio_url: string; } /** * Parameters for OmniHuman 1.5 lip-sync video generation * Enhanced version with more expressive character animations */ export interface OmniHuman15Params { model: 'bytedance/omnihuman/v1.5'; image_url: string; audio_url: string; } /** * Parameters for Google Veo 3.1 text-to-video generation * Google's state-of-the-art video generation model with high-quality output */ export interface Veo31T2VParams { model: 'google/veo-3.1-t2v'; prompt: string; aspect_ratio?: '16:9' | '9:16'; duration?: 4 | 6 | 8; resolution?: '720p' | '1080p'; generate_audio?: boolean; seed?: number; negative_prompt?: string; enhance_prompt?: boolean; auto_fix?: boolean; } /** * Parameters for Google Veo 3.1 Fast text-to-video generation * Faster version of Veo 3.1 with slightly reduced quality */ export interface Veo31T2VFastParams { model: 'google/veo-3.1-t2v-fast'; prompt: string; aspect_ratio?: '16:9' | '9:16'; duration?: 4 | 6 | 8; resolution?: '720p' | '1080p'; generate_audio?: boolean; seed?: number; negative_prompt?: string; enhance_prompt?: boolean; auto_fix?: boolean; } /** * Parameters for Google Veo 3.1 Fast image-to-video generation * Fast image-to-video conversion with motion generation */ export interface Veo31I2VFastParams { model: 'google/veo-3.1-i2v-fast'; prompt: string; image_url: string; aspect_ratio?: '16:9' | '9:16'; duration?: 4 | 6 | 8; resolution?: '720p' | '1080p'; generate_audio?: boolean; seed?: number; negative_prompt?: string; enhance_prompt?: boolean; auto_fix?: boolean; } /** * Parameters for Kling AI Avatar Standard lip-sync video generation * Outputs 720p video at 24 fps */ export interface KlingAvatarStandardParams { model: 'klingai/avatar-standard'; image_url: string; audio_url: string; prompt?: string; } /** * Parameters for Kling AI Avatar Pro lip-sync video generation * Outputs 1080p video at 48 fps */ export interface KlingAvatarProParams { model: 'klingai/avatar-pro'; image_url: string; audio_url: string; prompt?: string; } /** * Parameters for Kling AI V2.6 Pro text-to-video generation * Cinematic high-fidelity videos with native audio generation */ export interface KlingV26ProT2VParams { model: 'klingai/video-v2-6-pro-text-to-video'; prompt: string; aspect_ratio?: '16:9' | '9:16' | '1:1'; duration?: 5 | 10; negative_prompt?: string; cfg_scale?: number; generate_audio?: boolean; } /** * Parameters for Kling AI V2.6 Pro image-to-video generation * Cinematic high-fidelity videos from reference images with native audio */ export interface KlingV26ProI2VParams { model: 'klingai/video-v2-6-pro-image-to-video'; prompt: string; image_url: string; duration?: 5 | 10; negative_prompt?: string; generate_audio?: boolean; } /** * Parameters for Kling AI O1 image-to-video generation * Takes a reference image with instructional prompt */ export interface KlingO1I2VParams { model: 'klingai/video-o1-image-to-video'; prompt: string; image_url: string; last_image_url?: string; duration?: 5 | 10; } /** * Parameters for Kling AI O1 reference-to-video generation * Takes multiple reference images with instructional prompt */ export interface KlingO1ReferenceToVideoParams { model: 'klingai/video-o1-reference-to-video'; prompt: string; image_list: string[]; elements?: Array<{ reference_image_urls: string[]; frontal_image_url: string; }>; aspect_ratio?: '16:9' | '9:16' | '1:1'; duration?: 5 | 10; } /** * Parameters for Kling AI O1 video-to-video edit * Transforms input video according to text prompt while preserving motion */ export interface KlingO1V2VEditParams { model: 'klingai/video-o1-video-to-video-edit'; prompt: string; video_url: string; image_list?: string[]; elements?: Array<{ reference_image_urls: string[]; frontal_image_url: string; }>; keep_audio?: boolean; } /** * Parameters for Kling AI O1 video-to-video reference * Applies reference style/identity to source footage */ export interface KlingO1V2VReferenceParams { model: 'klingai/video-o1-video-to-video-reference'; prompt: string; video_url: string; image_list?: string[]; aspect_ratio?: '16:9' | '9:16' | '1:1'; duration?: 5 | 10; elements?: Array<{ reference_image_urls: string[]; frontal_image_url: string; }>; keep_audio?: boolean; } /** * Parameters for Kling AI V2.6 Pro motion control * Transfers motion from reference video to character image */ export interface KlingV26ProMotionControlParams { model: 'klingai/video-v2-6-pro-motion-control'; prompt?: string; image_url: string; video_url: string; character_orientation?: 'image' | 'video'; keep_audio?: boolean; } /** * Parameters for Krea Wan 14B text-to-video generation * A 14-billion parameter model for text-to-video generation */ export interface KreaWan14BT2VParams { model: 'krea/krea-wan-14b/text-to-video'; prompt: string; num_frames?: number; enable_prompt_expansion?: boolean; seed?: number; } /** * Parameters for Krea Wan 14B video-to-video generation * A 14-billion parameter model for video editing */ export interface KreaWan14BV2VParams { model: 'krea/krea-wan-14b/video-to-video'; prompt: string; video_url: string; strength?: number; enable_prompt_expansion?: boolean; seed?: number; } /** * Parameters for LTXV 2 text-to-video/image-to-video generation * Generates realistic 6-, 8-, and 10-second videos up to 4K resolution with audio */ export interface Ltxv2Params { model: 'ltxv/ltxv-2'; prompt: string; image_url?: string; duration?: 6 | 8 | 10; resolution?: '1080p' | '1440p' | '2160p'; aspect_ratio?: '16:9'; fps?: 25 | 50; generate_audio?: boolean; } /** * Parameters for LTXV 2 Fast text-to-video/image-to-video generation * Faster variant delivering video of somewhat lower quality */ export interface Ltxv2FastParams { model: 'ltxv/ltxv-2-fast'; prompt: string; image_url?: string; duration?: 6 | 8 | 10; resolution?: '1080p' | '1440p' | '2160p'; aspect_ratio?: '16:9'; fps?: 25 | 50; generate_audio?: boolean; } /** * Keyframe definition for Luma Ray 2 */ export type LumaRay2Keyframe = { type: 'image'; url: string; } | { type: 'generation'; id: string; } | null; /** * Parameters for Luma Ray 2 video generation * Generates up to 9-second clips at 4K with keyframe support */ export interface LumaRay2Params { model: 'luma/ray-2'; prompt: string; resolution?: '540p' | '720p' | '1080p' | '4k'; aspect_ratio?: '1:1' | '16:9' | '9:16' | '4:3' | '3:4' | '21:9' | '9:21'; duration?: 5 | 9; keyframes?: { frame0?: LumaRay2Keyframe; frame1?: LumaRay2Keyframe; }; loop?: boolean; } /** * Parameters for Magic text-to-video generation * Embeds custom text into video templates */ export interface MagicTextToVideoParams { model: 'magic/text-to-video'; prompt: string; template?: 'Shanghai Drone Show'; } /** * Template options for Magic Image-to-Video */ export type MagicImageToVideoTemplate = 'Art Gallery' | 'Cappadocia Balloons' | 'Desktop Reveal' | 'Digital Float' | 'Dubai Museum' | 'Egypt Pyramid' | 'Las Vegas LED' | 'New York Times Square (66)' | 'New York Times Square (77)' | 'Paris Eiffel Tower' | 'Phone App' | 'Phone Social' | 'Rotating Cards' | 'San Francisco Skyscrapers' | 'Stockholm Metro' | 'Thailand Street' | 'Times Square Billboard' | 'Times Square Round Screen' | 'Tokyo Billboard'; /** * Parameters for Magic image-to-video generation * Embeds custom images into video templates */ export interface MagicImageToVideoParams { model: 'magic/image-to-video'; image_url: string; template?: MagicImageToVideoTemplate; } /** * Template options for Magic Video-to-Video */ export type MagicVideoToVideoTemplate = 'Art Gallery' | 'Cappadocia Balloons' | 'Desktop Reveal' | 'Dubai Museum' | 'Egypt Pyramid' | 'Las Vegas LED' | 'New York Times Square (67)' | 'New York Times Square (78)' | 'Paris Eiffel Tower' | 'Phone App' | 'Phone Social' | 'Rotating Cards' | 'San Francisco Skyscrapers' | 'Stockholm Metro' | 'Thailand Street' | 'Times Square Billboard' | 'Times Square Round Screen' | 'Tokyo Billboard'; /** * Parameters for Magic video-to-video generation * Embeds custom videos into video templates */ export interface MagicVideoToVideoParams { model: 'magic/video-to-video'; video_url: string; template?: MagicVideoToVideoTemplate; } /** * Parameters for Video-01 text-to-video/image-to-video generation * High-quality video generation model by Hailou AI */ export interface Video01Params { model: 'video-01'; prompt: string; image_url?: string; enhance_prompt?: boolean; } /** * Parameters for Video-01 Live2D image-to-video generation * Animated video generation model by Hailou AI */ export interface Video01Live2DParams { model: 'video-01-live2d'; prompt: string; image_url: string; enhance_prompt?: boolean; } /** * Parameters for Hailuo-02 text-to-video/image-to-video generation * Enhanced physics, natural camera movement, better prompt alignment */ export interface Hailuo02Params { model: 'minimax/hailuo-02'; prompt: string; image_url?: string; last_image_url?: string; resolution?: '768P' | '1080P'; duration?: 6 | 10; enhance_prompt?: boolean; } /** * Parameters for Hailuo-2.3 text-to-video/image-to-video generation * More expressive motion, realistic visuals, improved physics */ export interface Hailuo23Params { model: 'minimax/hailuo-2.3'; prompt: string; image_url?: string; resolution?: '768P' | '1080P'; duration?: 6 | 10; enhance_prompt?: boolean; } /** * Parameters for Hailuo-2.3-fast image-to-video generation * Fast version with same quality improvements as hailuo-2.3 */ export interface Hailuo23FastParams { model: 'minimax/hailuo-2.3-fast'; prompt: string; image_url: string; resolution?: '768P' | '1080P'; duration?: 6 | 10; enhance_prompt?: boolean; } /** * Parameters for Sora 2 image-to-video generation * Media generation model by OpenAI with synced audio */ export interface Sora2I2VParams { model: 'openai/sora-2-i2v'; prompt: string; image_url: string; resolution?: '720p'; aspect_ratio?: '16:9' | '9:16'; duration?: 4 | 8 | 12; } /** * Parameters for Sora 2 Pro text-to-video generation * State-of-the-art media generation model by OpenAI with synced audio */ export interface Sora2ProT2VParams { model: 'openai/sora-2-pro-t2v'; prompt: string; resolution?: '720p' | '1080p'; aspect_ratio?: '16:9' | '9:16'; duration?: 4 | 8 | 12; } /** * Parameters for Sora 2 Pro image-to-video generation * State-of-the-art media generation model by OpenAI with synced audio */ export interface Sora2ProI2VParams { model: 'openai/sora-2-pro-i2v'; prompt: string; image_url: string; resolution?: '720p' | '1080p'; aspect_ratio?: '16:9' | '9:16'; duration?: 4 | 8 | 12; } /** * Parameters for Sora 2 text-to-video generation * Powerful media generation model by OpenAI with synced audio */ export interface Sora2T2VParams { model: 'openai/sora-2-t2v'; prompt: string; resolution?: '720p'; aspect_ratio?: '16:9' | '9:16'; duration?: 4 | 8 | 12; } /** * Style options for Pixverse V5 video generation */ export type PixverseV5Style = 'anime' | '3d_animation' | 'clay' | 'comic' | 'cyberpunk'; /** * Style options for Pixverse V5.5 video generation */ export type PixverseV55Style = PixverseV5Style; /** * TTS speaker options for Pixverse lip-sync */ export type PixverseTtsSpeaker = 'Harper' | 'Ava' | 'Isabella' | 'Sophia' | 'Emily' | 'Chloe' | 'Julia' | 'Mason' | 'Jack' | 'Liam' | 'James' | 'Oliver' | 'Adrian' | 'Ethan' | 'Auto'; /** * Parameters for Pixverse V5 text-to-video generation * Faster T2V rendering with sharp, realistic, cinematic results with synced audio */ export interface PixverseV5T2VParams { model: 'pixverse/v5/text-to-video'; prompt: string; aspect_ratio?: '16:9' | '4:3' | '1:1' | '3:4' | '9:16'; resolution?: '360p' | '540p' | '720p' | '1080p'; duration?: 5 | 8; negative_prompt?: string; style?: PixverseV5Style; seed?: number; lip_sync_tts_content?: string; lip_sync_tts_speaker?: PixverseTtsSpeaker; } /** * Parameters for Pixverse V5 image-to-video generation * Faster I2V rendering with sharp, realistic, cinematic results with synced audio */ export interface PixverseV5I2VParams { model: 'pixverse/v5/image-to-video'; prompt: string; image_url: string; resolution?: '360p' | '540p' | '720p' | '1080p'; duration?: 5 | 8; negative_prompt?: string; style?: PixverseV5Style; seed?: number; lip_sync_tts_content?: string; lip_sync_tts_speaker?: PixverseTtsSpeaker; } /** * Parameters for Pixverse V5 transition generation * Generates video between first and last frame, ideal for seamless editing */ export interface PixverseV5TransitionParams { model: 'pixverse/v5/transition'; prompt: string; image_url: string; tail_image_url: string; resolution?: '360p' | '540p' | '720p' | '1080p'; duration?: 5 | 8; negative_prompt?: string; style?: PixverseV5Style; seed?: number; lip_sync_tts_content?: string; lip_sync_tts_speaker?: PixverseTtsSpeaker; } /** * Parameters for Pixverse V5.5 text-to-video generation * Faster T2V rendering with sharp, realistic, cinematic results */ export interface PixverseV55T2VParams { model: 'pixverse/v5-5-text-to-video'; prompt: string; aspect_ratio?: '16:9' | '4:3' | '1:1' | '3:4' | '9:16'; resolution?: '360p' | '540p' | '720p' | '1080p'; duration?: 5 | 8 | 10; negative_prompt?: string; style?: PixverseV55Style; seed?: number; generate_audio_switch?: boolean; generate_multi_clip_switch?: boolean; thinking_type?: 'enabled' | 'disabled' | 'auto'; } /** * Parameters for Pixverse V5.5 image-to-video generation * High-quality video from text combined with image */ export interface PixverseV55I2VParams { model: 'pixverse/v5-5-image-to-video'; prompt: string; image_url: string; resolution?: '360p' | '540p' | '720p' | '1080p'; duration?: 5 | 8 | 10; negative_prompt?: string; style?: PixverseV55Style; seed?: number; generate_audio_switch?: boolean; generate_multi_clip_switch?: boolean; thinking_type?: 'enabled' | 'disabled' | 'auto'; } /** * Parameters for Pixverse lip-sync generation * Generates videos with synchronized audio from video + audio/text */ export interface PixverseLipSyncParams { model: 'pixverse/lip-sync'; video_url: string; audio_url?: string; lip_sync_tts_content?: string; lip_sync_tts_speaker?: PixverseTtsSpeaker; } /** * Parameters for Runway Gen3A Turbo image-to-video generation * Fast I2V model with smooth motion and detailed textures */ export interface Gen3ATurboParams { model: 'gen3a_turbo'; prompt?: string; image_url: string; tail_image_url?: string; aspect_ratio?: '16:9' | '9:16'; duration?: 5 | 10; seed?: number; } /** * Parameters for Runway Gen4 Turbo image-to-video generation * Faster, scalable AI video generation with higher visual quality */ export interface Gen4TurboParams { model: 'runway/gen4_turbo'; prompt?: string; image_url: string; tail_image_url?: string; aspect_ratio?: '16:9' | '9:16' | '4:3' | '3:4' | '1:1' | '21:9'; duration?: 5 | 10; seed?: number; } /** * Reference type for Gen4 Aleph */ export type RunwayAlephReference = { type: 'image'; url: string; }; /** * Frame size options for Runway Gen4 Aleph */ export type RunwayAlephFrameSize = '1280:720' | '720:1280' | '1104:832' | '832:1104' | '960:960' | '1584:672' | '848:480' | '640:480'; /** * Parameters for Runway Gen4 Aleph video-to-video generation * Modifies input video or generates next shot based on prompt */ export interface Gen4AlephParams { model: 'runway/gen4_aleph'; prompt: string; video_url: string; references?: RunwayAlephReference[]; frame_size?: RunwayAlephFrameSize; duration?: 5; seed?: number; } /** * Character type for Act-Two */ export type RunwayActTwoCharacter = { type: 'image'; url: string; } | { type: 'video'; url: string; }; /** * Reference type for Act-Two */ export type RunwayActTwoReference = { type: 'video'; url: string; }; /** * Frame size options for Runway Act-Two */ export type RunwayActTwoFrameSize = RunwayAlephFrameSize; /** * Parameters for Runway Act-Two character animation * Transfers performance from reference video to character */ export interface ActTwoParams { model: 'runway/act_two'; character: RunwayActTwoCharacter; reference: RunwayActTwoReference; frame_size?: RunwayActTwoFrameSize; body_control?: boolean; expression_intensity?: number; seed?: number; } /** * Aspect ratio options for Kandinsky 5 */ export type Kandinsky5AspectRatio = '3:2' | '1:1' | '2:3'; /** * Parameters for Kandinsky 5 text-to-video generation * Advanced diffusion model for high-quality video generation */ export interface Kandinsky5T2VParams { model: 'sber-ai/kandinsky5-t2v'; prompt: string; aspect_ratio?: Kandinsky5AspectRatio; duration?: 5 | 10; num_inference_steps?: number; } /** * Parameters for Kandinsky 5 Distill text-to-video generation * Fast and compact variant of Kandinsky 5 */ export interface Kandinsky5DistillT2VParams { model: 'sber-ai/kandinsky5-distill-t2v'; prompt: string; aspect_ratio?: Kandinsky5AspectRatio; duration?: 5 | 10; num_inference_steps?: number; } /** * Parameters for Hunyuan Video Foley generation * Generates sound from video movement with optional prompt guidance */ export interface HunyuanVideoFoleyParams { model: 'tencent/hunyuan-video-foley'; video_url: string; prompt: string; negative_prompt?: string; guidance_scale?: number; num_inference_steps?: number; seed?: number; } /** * Resolution options for Fabric 1.0 */ export type FabricResolution = '480p' | '720p'; /** * Parameters for VEED Fabric 1.0 talking head generation * Creates video from static image and audio input */ export interface Fabric10Params { model: 'veed/fabric-1.0'; image_url: string; audio_url: string; resolution?: FabricResolution; } /** * Parameters for VEED Fabric 1.0 Fast talking head generation * Faster variant of Fabric 1.0 with required resolution */ export interface Fabric10FastParams { model: 'veed/fabric-1.0-fast'; image_url: string; audio_url: string; resolution: FabricResolution; } /** * Union type for all video generation parameters */ export type VideoGenerationParams = Wan21PlusParams | Wan21TurboParams | Wan22AnimateReplaceParams | Wan22VaceFunReframeParams | Wan22VaceFunOutpaintingParams | Wan22VaceFunInpaintingParams | Wan22VaceFunPoseParams | Wan22VaceFunDepthParams | Seedance1LiteT2VParams | Seedance1LiteI2VParams | Seedance1ProFastParams | OmniHumanParams | OmniHuman15Params | Veo31T2VParams | Veo31T2VFastParams | Veo31I2VFastParams | KlingAvatarStandardParams | KlingAvatarProParams | KlingV26ProT2VParams | KlingV26ProI2VParams | KlingO1I2VParams | KlingO1ReferenceToVideoParams | KlingO1V2VEditParams | KlingO1V2VReferenceParams | KlingV26ProMotionControlParams | KreaWan14BT2VParams | KreaWan14BV2VParams | Ltxv2Params | Ltxv2FastParams | LumaRay2Params | MagicTextToVideoParams | MagicImageToVideoParams | MagicVideoToVideoParams | Video01Params | Video01Live2DParams | Hailuo02Params | Hailuo23Params | Hailuo23FastParams | Sora2I2VParams | Sora2ProT2VParams | Sora2ProI2VParams | Sora2T2VParams | PixverseV5T2VParams | PixverseV5I2VParams | PixverseV5TransitionParams | PixverseV55T2VParams | PixverseV55I2VParams | PixverseLipSyncParams | Gen3ATurboParams | Gen4TurboParams | Gen4AlephParams | ActTwoParams | Kandinsky5T2VParams | Kandinsky5DistillT2VParams | HunyuanVideoFoleyParams | Fabric10Params | Fabric10FastParams; /** * Video generation resource class */ export declare class Video { private readonly _client; constructor(_client: AIMLAPIClient); /** * Generic video generation method that accepts any video generation parameters * * @example * ```typescript * const result = await client.video.generate({ * model: 'alibaba/wan2.1-t2v-plus', * prompt: 'A beautiful sunset over the ocean' * }); * ``` */ generate(params: VideoGenerationParams): Promise; /** * Generic video generation with automatic polling * * @param params Video generation parameters * @param maxAttempts Maximum number of polling attempts (default: 60) * @param intervalMs Interval between attempts in milliseconds (default: 10000) * * @example * ```typescript * const result = await client.video.createWithPolling({ * model: 'alibaba/wan2.1-t2v-plus', * prompt: 'A beautiful sunset over the ocean' * }, 5, 300); * ``` */ createWithPolling(params: VideoGenerationParams, maxAttempts?: number, intervalMs?: number): Promise; /** * Poll for video generation status using generation ID * * @param generationId The ID of the video generation task to poll * @param maxAttempts Maximum number of polling attempts (default: 60) * @param intervalMs Interval between attempts in milliseconds (default: 10000) * * @example * ```typescript * const result = await client.video.polling('generation-id-123', 5, 300); * ``` */ polling(generationId: string, maxAttempts?: number, intervalMs?: number): Promise; /** * Get the status of a video generation task * * @param generationId The ID of the video generation task * @example * ```typescript * const status = await client.video.getStatus('generation-id-123'); * ``` */ getStatus(generationId: string): Promise; } //# sourceMappingURL=video.d.ts.map