@runapi.ai/kling 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +78 -13
- package/dist/index.d.ts +78 -13
- package/dist/index.js +191 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +177 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/skills/kling/README.md +2 -0
- package/skills/kling/SKILL.md +2 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,40 @@
|
|
|
1
1
|
import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient, ClientOptions } from '@runapi.ai/core';
|
|
2
2
|
export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
|
|
3
3
|
|
|
4
|
+
declare const modelValues: {
|
|
5
|
+
readonly textToVideo: {
|
|
6
|
+
readonly KLING_3_0: "kling-3.0";
|
|
7
|
+
readonly KLING_V2_1_MASTER_TEXT_TO_VIDEO: "kling-v2.1-master-text-to-video";
|
|
8
|
+
readonly KLING_V2_5_TURBO_TEXT_TO_VIDEO_PRO: "kling-v2.5-turbo-text-to-video-pro";
|
|
9
|
+
readonly KLING_V2_6: "kling-v2.6";
|
|
10
|
+
readonly KLING_V3_OMNI: "kling-v3-omni";
|
|
11
|
+
readonly KLING_V3_TURBO_TEXT_TO_VIDEO: "kling-v3-turbo-text-to-video";
|
|
12
|
+
};
|
|
13
|
+
readonly imageToVideo: {
|
|
14
|
+
readonly KLING_V2_1_MASTER_IMAGE_TO_VIDEO: "kling-v2.1-master-image-to-video";
|
|
15
|
+
readonly KLING_V2_1_PRO: "kling-v2.1-pro";
|
|
16
|
+
readonly KLING_V2_1_STANDARD: "kling-v2.1-standard";
|
|
17
|
+
readonly KLING_V2_5_TURBO_IMAGE_TO_VIDEO_PRO: "kling-v2.5-turbo-image-to-video-pro";
|
|
18
|
+
readonly KLING_V2_6: "kling-v2.6";
|
|
19
|
+
readonly KLING_V3_OMNI: "kling-v3-omni";
|
|
20
|
+
readonly KLING_V3_TURBO_IMAGE_TO_VIDEO: "kling-v3-turbo-image-to-video";
|
|
21
|
+
};
|
|
22
|
+
readonly avatar: {
|
|
23
|
+
readonly KLING_AI_AVATAR_PRO: "kling-ai-avatar-pro";
|
|
24
|
+
readonly KLING_AI_AVATAR_STANDARD: "kling-ai-avatar-standard";
|
|
25
|
+
readonly KLING_AI_AVATAR_V1_PRO: "kling-ai-avatar-v1-pro";
|
|
26
|
+
readonly KLING_V1_AVATAR_STANDARD: "kling-v1-avatar-standard";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
4
30
|
/**
|
|
5
31
|
* Text-to-video model variants. kling-3.0 supports multi-shot, sound, first/last frame images,
|
|
6
32
|
* and Kling elements. V2.x models support negative prompts and cfg_scale instead.
|
|
7
33
|
*/
|
|
8
|
-
type KlingTextToVideoModel =
|
|
34
|
+
type KlingTextToVideoModel = (typeof modelValues.textToVideo)[keyof typeof modelValues.textToVideo];
|
|
9
35
|
/** Earlier V2 image-to-video variants. V2.5 turbo and V2.1 pro support last-frame image control. */
|
|
10
|
-
type KlingV2ImageToVideoModel =
|
|
11
|
-
type KlingImageToVideoModel =
|
|
36
|
+
type KlingV2ImageToVideoModel = (typeof modelValues.imageToVideo.KLING_V2_5_TURBO_IMAGE_TO_VIDEO_PRO) | (typeof modelValues.imageToVideo.KLING_V2_1_PRO) | (typeof modelValues.imageToVideo.KLING_V2_1_STANDARD) | (typeof modelValues.imageToVideo.KLING_V2_1_MASTER_IMAGE_TO_VIDEO);
|
|
37
|
+
type KlingImageToVideoModel = (typeof modelValues.imageToVideo)[keyof typeof modelValues.imageToVideo];
|
|
12
38
|
/** Output resolution for text-to-video. 4k is highest quality but slowest. */
|
|
13
39
|
type KlingTextToVideoOutputResolution = '720p' | '1080p' | '4k';
|
|
14
40
|
type KlingV3TurboOutputResolution = '720p' | '1080p';
|
|
@@ -39,7 +65,7 @@ interface KlingElement {
|
|
|
39
65
|
end_time?: number;
|
|
40
66
|
}
|
|
41
67
|
interface Kling3TextToVideoCommonParams {
|
|
42
|
-
model:
|
|
68
|
+
model: (typeof modelValues.textToVideo.KLING_3_0);
|
|
43
69
|
/** Duration in seconds (3-15). */
|
|
44
70
|
duration_seconds?: KlingDuration;
|
|
45
71
|
aspect_ratio?: KlingAspectRatio;
|
|
@@ -73,7 +99,7 @@ interface Kling3TextToVideoMultiShotParams extends Kling3TextToVideoCommonParams
|
|
|
73
99
|
}
|
|
74
100
|
/** V2.5 Turbo text-to-video: fast, high-quality generation with negative prompt and cfg_scale control. */
|
|
75
101
|
interface V25TurboTextToVideoParams {
|
|
76
|
-
model:
|
|
102
|
+
model: (typeof modelValues.textToVideo.KLING_V2_5_TURBO_TEXT_TO_VIDEO_PRO);
|
|
77
103
|
prompt: string;
|
|
78
104
|
/** Duration: 5 or 10 seconds. */
|
|
79
105
|
duration_seconds?: 5 | 10;
|
|
@@ -86,7 +112,7 @@ interface V25TurboTextToVideoParams {
|
|
|
86
112
|
}
|
|
87
113
|
/** V2.1 Master text-to-video: highest V2.1 quality with negative prompt and cfg_scale control. */
|
|
88
114
|
interface V21MasterTextToVideoParams {
|
|
89
|
-
model:
|
|
115
|
+
model: (typeof modelValues.textToVideo.KLING_V2_1_MASTER_TEXT_TO_VIDEO);
|
|
90
116
|
prompt: string;
|
|
91
117
|
duration_seconds?: 5 | 10;
|
|
92
118
|
aspect_ratio?: KlingAspectRatio;
|
|
@@ -96,7 +122,7 @@ interface V21MasterTextToVideoParams {
|
|
|
96
122
|
}
|
|
97
123
|
/** V3 Turbo text-to-video: prompt-driven 3-15 second clips at 720p or 1080p. */
|
|
98
124
|
interface V3TurboTextToVideoParams {
|
|
99
|
-
model:
|
|
125
|
+
model: (typeof modelValues.textToVideo.KLING_V3_TURBO_TEXT_TO_VIDEO);
|
|
100
126
|
prompt: string;
|
|
101
127
|
/** Duration in seconds (3-15). */
|
|
102
128
|
duration_seconds?: KlingDuration;
|
|
@@ -115,6 +141,16 @@ interface KlingV26TextToVideoParams {
|
|
|
115
141
|
aspect_ratio?: KlingAspectRatio;
|
|
116
142
|
callback_url?: string;
|
|
117
143
|
}
|
|
144
|
+
/** Kling v3 Omni text-to-video with native 4K, synchronized sound, and flexible duration. */
|
|
145
|
+
interface V3OmniTextToVideoParams {
|
|
146
|
+
model: (typeof modelValues.textToVideo.KLING_V3_OMNI);
|
|
147
|
+
prompt: string;
|
|
148
|
+
output_resolution?: KlingTextToVideoOutputResolution;
|
|
149
|
+
duration_seconds?: KlingDuration;
|
|
150
|
+
enable_sound?: boolean;
|
|
151
|
+
aspect_ratio?: KlingAspectRatio;
|
|
152
|
+
callback_url?: string;
|
|
153
|
+
}
|
|
118
154
|
/**
|
|
119
155
|
* Earlier V2 image-to-video parameters. A first-frame image is required; the model
|
|
120
156
|
* animates it into video guided by the text prompt. last_frame_image_url is supported
|
|
@@ -135,7 +171,7 @@ interface V2ImageToVideoParams {
|
|
|
135
171
|
}
|
|
136
172
|
/** V3 Turbo image-to-video: animate one first-frame image at 720p or 1080p. */
|
|
137
173
|
interface V3TurboImageToVideoParams {
|
|
138
|
-
model:
|
|
174
|
+
model: (typeof modelValues.imageToVideo.KLING_V3_TURBO_IMAGE_TO_VIDEO);
|
|
139
175
|
prompt: string;
|
|
140
176
|
first_frame_image_url: string;
|
|
141
177
|
duration_seconds?: KlingDuration;
|
|
@@ -156,8 +192,28 @@ interface KlingV26ImageToVideoParams {
|
|
|
156
192
|
aspect_ratio?: KlingAspectRatio;
|
|
157
193
|
callback_url?: string;
|
|
158
194
|
}
|
|
159
|
-
|
|
160
|
-
|
|
195
|
+
/** Kling v3 Omni image-to-video from caller-owned first and optional final frames. */
|
|
196
|
+
interface V3OmniImageToVideoParams {
|
|
197
|
+
model: (typeof modelValues.imageToVideo.KLING_V3_OMNI);
|
|
198
|
+
prompt: string;
|
|
199
|
+
first_frame_image_url: string;
|
|
200
|
+
/** Final frame image URL; requires duration_seconds 5. */
|
|
201
|
+
last_frame_image_url?: string;
|
|
202
|
+
output_resolution?: KlingTextToVideoOutputResolution;
|
|
203
|
+
duration_seconds?: KlingDuration;
|
|
204
|
+
enable_sound?: boolean;
|
|
205
|
+
aspect_ratio?: KlingAspectRatio;
|
|
206
|
+
callback_url?: string;
|
|
207
|
+
}
|
|
208
|
+
type TextToVideoParams = Kling3TextToVideoSingleShotParams | Kling3TextToVideoMultiShotParams | KlingV26TextToVideoParams | V25TurboTextToVideoParams | V21MasterTextToVideoParams | V3TurboTextToVideoParams | V3OmniTextToVideoParams;
|
|
209
|
+
type ImageToVideoParams = V2ImageToVideoParams | KlingV26ImageToVideoParams | V3TurboImageToVideoParams | V3OmniImageToVideoParams;
|
|
210
|
+
/** Continue a completed Kling V2.5 Turbo video task. */
|
|
211
|
+
interface KlingExtendVideoParams {
|
|
212
|
+
source_task_id: string;
|
|
213
|
+
mode?: 'std' | 'pro';
|
|
214
|
+
prompt?: string;
|
|
215
|
+
callback_url?: string;
|
|
216
|
+
}
|
|
161
217
|
interface AsyncTaskResponse {
|
|
162
218
|
id: string;
|
|
163
219
|
status: AsyncTaskStatus;
|
|
@@ -182,7 +238,7 @@ interface ImageToVideoResponse extends AsyncTaskResponse {
|
|
|
182
238
|
* AI avatar quality tier. Pro models produce the most natural lip movements;
|
|
183
239
|
* Standard models are faster with slightly less refined lip sync.
|
|
184
240
|
*/
|
|
185
|
-
type AiAvatarModel =
|
|
241
|
+
type AiAvatarModel = (typeof modelValues.avatar)[keyof typeof modelValues.avatar];
|
|
186
242
|
/** Lip-sync a face image to an audio track, producing a talking-head video. */
|
|
187
243
|
interface AiAvatarParams {
|
|
188
244
|
model: AiAvatarModel;
|
|
@@ -204,7 +260,7 @@ interface AiAvatarResponse extends AsyncTaskResponse {
|
|
|
204
260
|
* the movement patterns from the reference while preserving its own appearance.
|
|
205
261
|
*/
|
|
206
262
|
interface MotionControlParams {
|
|
207
|
-
model:
|
|
263
|
+
model: (typeof modelValues.textToVideo.KLING_3_0);
|
|
208
264
|
/** Subject image URL whose appearance is preserved. */
|
|
209
265
|
source_image_url: string;
|
|
210
266
|
/** Reference video URL whose motion patterns are transferred. */
|
|
@@ -348,6 +404,14 @@ declare class MotionControl {
|
|
|
348
404
|
get(id: string, options?: RequestOptions): Promise<MotionControlResponse>;
|
|
349
405
|
}
|
|
350
406
|
|
|
407
|
+
declare class ExtendVideo {
|
|
408
|
+
private readonly http;
|
|
409
|
+
constructor(http: HttpClient);
|
|
410
|
+
run(params: KlingExtendVideoParams, options?: RequestOptions & PollingOptions): Promise<TextToVideoResponse>;
|
|
411
|
+
create(params: KlingExtendVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
|
|
412
|
+
get(id: string, options?: RequestOptions): Promise<TextToVideoResponse>;
|
|
413
|
+
}
|
|
414
|
+
|
|
351
415
|
/**
|
|
352
416
|
* Kling video generation, AI avatar lip-sync, and motion control API client.
|
|
353
417
|
*
|
|
@@ -370,7 +434,8 @@ declare class KlingClient extends BaseClient {
|
|
|
370
434
|
readonly aiAvatar: AiAvatar;
|
|
371
435
|
/** Transfer motion from a reference video onto a subject image. */
|
|
372
436
|
readonly motionControl: MotionControl;
|
|
437
|
+
readonly extendVideo: ExtendVideo;
|
|
373
438
|
constructor(options?: ClientOptions);
|
|
374
439
|
}
|
|
375
440
|
|
|
376
|
-
export { type AiAvatarModel, type AiAvatarParams, type AiAvatarResponse, type AsyncTaskResponse, type CompletedAiAvatarResponse, type CompletedImageToVideoResponse, type CompletedMotionControlResponse, type CompletedTextToVideoResponse, type ImageToVideoParams, type ImageToVideoResponse, type Kling3TextToVideoMultiShotParams, type Kling3TextToVideoSingleShotParams, type KlingAspectRatio, KlingClient, type KlingDuration, type KlingElement, type KlingImageToVideoModel, type KlingTextToVideoModel, type KlingTextToVideoOutputResolution, type KlingV26ImageToVideoParams, type KlingV26Mode, type KlingV26TextToVideoParams, type KlingV2ImageToVideoModel, type KlingV3TurboOutputResolution, type MotionControlParams, type MotionControlResponse, type MultiPromptItem, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type V21MasterTextToVideoParams, type V25TurboTextToVideoParams, type V2ImageToVideoParams, type V3TurboImageToVideoParams, type V3TurboTextToVideoParams, type VideoMetadata };
|
|
441
|
+
export { type AiAvatarModel, type AiAvatarParams, type AiAvatarResponse, type AsyncTaskResponse, type CompletedAiAvatarResponse, type CompletedImageToVideoResponse, type CompletedMotionControlResponse, type CompletedTextToVideoResponse, type ImageToVideoParams, type ImageToVideoResponse, type Kling3TextToVideoMultiShotParams, type Kling3TextToVideoSingleShotParams, type KlingAspectRatio, KlingClient, type KlingDuration, type KlingElement, type KlingExtendVideoParams, type KlingImageToVideoModel, type KlingTextToVideoModel, type KlingTextToVideoOutputResolution, type KlingV26ImageToVideoParams, type KlingV26Mode, type KlingV26TextToVideoParams, type KlingV2ImageToVideoModel, type KlingV3TurboOutputResolution, type MotionControlParams, type MotionControlResponse, type MultiPromptItem, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type V21MasterTextToVideoParams, type V25TurboTextToVideoParams, type V2ImageToVideoParams, type V3OmniImageToVideoParams, type V3OmniTextToVideoParams, type V3TurboImageToVideoParams, type V3TurboTextToVideoParams, type VideoMetadata };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,40 @@
|
|
|
1
1
|
import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient, ClientOptions } from '@runapi.ai/core';
|
|
2
2
|
export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
|
|
3
3
|
|
|
4
|
+
declare const modelValues: {
|
|
5
|
+
readonly textToVideo: {
|
|
6
|
+
readonly KLING_3_0: "kling-3.0";
|
|
7
|
+
readonly KLING_V2_1_MASTER_TEXT_TO_VIDEO: "kling-v2.1-master-text-to-video";
|
|
8
|
+
readonly KLING_V2_5_TURBO_TEXT_TO_VIDEO_PRO: "kling-v2.5-turbo-text-to-video-pro";
|
|
9
|
+
readonly KLING_V2_6: "kling-v2.6";
|
|
10
|
+
readonly KLING_V3_OMNI: "kling-v3-omni";
|
|
11
|
+
readonly KLING_V3_TURBO_TEXT_TO_VIDEO: "kling-v3-turbo-text-to-video";
|
|
12
|
+
};
|
|
13
|
+
readonly imageToVideo: {
|
|
14
|
+
readonly KLING_V2_1_MASTER_IMAGE_TO_VIDEO: "kling-v2.1-master-image-to-video";
|
|
15
|
+
readonly KLING_V2_1_PRO: "kling-v2.1-pro";
|
|
16
|
+
readonly KLING_V2_1_STANDARD: "kling-v2.1-standard";
|
|
17
|
+
readonly KLING_V2_5_TURBO_IMAGE_TO_VIDEO_PRO: "kling-v2.5-turbo-image-to-video-pro";
|
|
18
|
+
readonly KLING_V2_6: "kling-v2.6";
|
|
19
|
+
readonly KLING_V3_OMNI: "kling-v3-omni";
|
|
20
|
+
readonly KLING_V3_TURBO_IMAGE_TO_VIDEO: "kling-v3-turbo-image-to-video";
|
|
21
|
+
};
|
|
22
|
+
readonly avatar: {
|
|
23
|
+
readonly KLING_AI_AVATAR_PRO: "kling-ai-avatar-pro";
|
|
24
|
+
readonly KLING_AI_AVATAR_STANDARD: "kling-ai-avatar-standard";
|
|
25
|
+
readonly KLING_AI_AVATAR_V1_PRO: "kling-ai-avatar-v1-pro";
|
|
26
|
+
readonly KLING_V1_AVATAR_STANDARD: "kling-v1-avatar-standard";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
4
30
|
/**
|
|
5
31
|
* Text-to-video model variants. kling-3.0 supports multi-shot, sound, first/last frame images,
|
|
6
32
|
* and Kling elements. V2.x models support negative prompts and cfg_scale instead.
|
|
7
33
|
*/
|
|
8
|
-
type KlingTextToVideoModel =
|
|
34
|
+
type KlingTextToVideoModel = (typeof modelValues.textToVideo)[keyof typeof modelValues.textToVideo];
|
|
9
35
|
/** Earlier V2 image-to-video variants. V2.5 turbo and V2.1 pro support last-frame image control. */
|
|
10
|
-
type KlingV2ImageToVideoModel =
|
|
11
|
-
type KlingImageToVideoModel =
|
|
36
|
+
type KlingV2ImageToVideoModel = (typeof modelValues.imageToVideo.KLING_V2_5_TURBO_IMAGE_TO_VIDEO_PRO) | (typeof modelValues.imageToVideo.KLING_V2_1_PRO) | (typeof modelValues.imageToVideo.KLING_V2_1_STANDARD) | (typeof modelValues.imageToVideo.KLING_V2_1_MASTER_IMAGE_TO_VIDEO);
|
|
37
|
+
type KlingImageToVideoModel = (typeof modelValues.imageToVideo)[keyof typeof modelValues.imageToVideo];
|
|
12
38
|
/** Output resolution for text-to-video. 4k is highest quality but slowest. */
|
|
13
39
|
type KlingTextToVideoOutputResolution = '720p' | '1080p' | '4k';
|
|
14
40
|
type KlingV3TurboOutputResolution = '720p' | '1080p';
|
|
@@ -39,7 +65,7 @@ interface KlingElement {
|
|
|
39
65
|
end_time?: number;
|
|
40
66
|
}
|
|
41
67
|
interface Kling3TextToVideoCommonParams {
|
|
42
|
-
model:
|
|
68
|
+
model: (typeof modelValues.textToVideo.KLING_3_0);
|
|
43
69
|
/** Duration in seconds (3-15). */
|
|
44
70
|
duration_seconds?: KlingDuration;
|
|
45
71
|
aspect_ratio?: KlingAspectRatio;
|
|
@@ -73,7 +99,7 @@ interface Kling3TextToVideoMultiShotParams extends Kling3TextToVideoCommonParams
|
|
|
73
99
|
}
|
|
74
100
|
/** V2.5 Turbo text-to-video: fast, high-quality generation with negative prompt and cfg_scale control. */
|
|
75
101
|
interface V25TurboTextToVideoParams {
|
|
76
|
-
model:
|
|
102
|
+
model: (typeof modelValues.textToVideo.KLING_V2_5_TURBO_TEXT_TO_VIDEO_PRO);
|
|
77
103
|
prompt: string;
|
|
78
104
|
/** Duration: 5 or 10 seconds. */
|
|
79
105
|
duration_seconds?: 5 | 10;
|
|
@@ -86,7 +112,7 @@ interface V25TurboTextToVideoParams {
|
|
|
86
112
|
}
|
|
87
113
|
/** V2.1 Master text-to-video: highest V2.1 quality with negative prompt and cfg_scale control. */
|
|
88
114
|
interface V21MasterTextToVideoParams {
|
|
89
|
-
model:
|
|
115
|
+
model: (typeof modelValues.textToVideo.KLING_V2_1_MASTER_TEXT_TO_VIDEO);
|
|
90
116
|
prompt: string;
|
|
91
117
|
duration_seconds?: 5 | 10;
|
|
92
118
|
aspect_ratio?: KlingAspectRatio;
|
|
@@ -96,7 +122,7 @@ interface V21MasterTextToVideoParams {
|
|
|
96
122
|
}
|
|
97
123
|
/** V3 Turbo text-to-video: prompt-driven 3-15 second clips at 720p or 1080p. */
|
|
98
124
|
interface V3TurboTextToVideoParams {
|
|
99
|
-
model:
|
|
125
|
+
model: (typeof modelValues.textToVideo.KLING_V3_TURBO_TEXT_TO_VIDEO);
|
|
100
126
|
prompt: string;
|
|
101
127
|
/** Duration in seconds (3-15). */
|
|
102
128
|
duration_seconds?: KlingDuration;
|
|
@@ -115,6 +141,16 @@ interface KlingV26TextToVideoParams {
|
|
|
115
141
|
aspect_ratio?: KlingAspectRatio;
|
|
116
142
|
callback_url?: string;
|
|
117
143
|
}
|
|
144
|
+
/** Kling v3 Omni text-to-video with native 4K, synchronized sound, and flexible duration. */
|
|
145
|
+
interface V3OmniTextToVideoParams {
|
|
146
|
+
model: (typeof modelValues.textToVideo.KLING_V3_OMNI);
|
|
147
|
+
prompt: string;
|
|
148
|
+
output_resolution?: KlingTextToVideoOutputResolution;
|
|
149
|
+
duration_seconds?: KlingDuration;
|
|
150
|
+
enable_sound?: boolean;
|
|
151
|
+
aspect_ratio?: KlingAspectRatio;
|
|
152
|
+
callback_url?: string;
|
|
153
|
+
}
|
|
118
154
|
/**
|
|
119
155
|
* Earlier V2 image-to-video parameters. A first-frame image is required; the model
|
|
120
156
|
* animates it into video guided by the text prompt. last_frame_image_url is supported
|
|
@@ -135,7 +171,7 @@ interface V2ImageToVideoParams {
|
|
|
135
171
|
}
|
|
136
172
|
/** V3 Turbo image-to-video: animate one first-frame image at 720p or 1080p. */
|
|
137
173
|
interface V3TurboImageToVideoParams {
|
|
138
|
-
model:
|
|
174
|
+
model: (typeof modelValues.imageToVideo.KLING_V3_TURBO_IMAGE_TO_VIDEO);
|
|
139
175
|
prompt: string;
|
|
140
176
|
first_frame_image_url: string;
|
|
141
177
|
duration_seconds?: KlingDuration;
|
|
@@ -156,8 +192,28 @@ interface KlingV26ImageToVideoParams {
|
|
|
156
192
|
aspect_ratio?: KlingAspectRatio;
|
|
157
193
|
callback_url?: string;
|
|
158
194
|
}
|
|
159
|
-
|
|
160
|
-
|
|
195
|
+
/** Kling v3 Omni image-to-video from caller-owned first and optional final frames. */
|
|
196
|
+
interface V3OmniImageToVideoParams {
|
|
197
|
+
model: (typeof modelValues.imageToVideo.KLING_V3_OMNI);
|
|
198
|
+
prompt: string;
|
|
199
|
+
first_frame_image_url: string;
|
|
200
|
+
/** Final frame image URL; requires duration_seconds 5. */
|
|
201
|
+
last_frame_image_url?: string;
|
|
202
|
+
output_resolution?: KlingTextToVideoOutputResolution;
|
|
203
|
+
duration_seconds?: KlingDuration;
|
|
204
|
+
enable_sound?: boolean;
|
|
205
|
+
aspect_ratio?: KlingAspectRatio;
|
|
206
|
+
callback_url?: string;
|
|
207
|
+
}
|
|
208
|
+
type TextToVideoParams = Kling3TextToVideoSingleShotParams | Kling3TextToVideoMultiShotParams | KlingV26TextToVideoParams | V25TurboTextToVideoParams | V21MasterTextToVideoParams | V3TurboTextToVideoParams | V3OmniTextToVideoParams;
|
|
209
|
+
type ImageToVideoParams = V2ImageToVideoParams | KlingV26ImageToVideoParams | V3TurboImageToVideoParams | V3OmniImageToVideoParams;
|
|
210
|
+
/** Continue a completed Kling V2.5 Turbo video task. */
|
|
211
|
+
interface KlingExtendVideoParams {
|
|
212
|
+
source_task_id: string;
|
|
213
|
+
mode?: 'std' | 'pro';
|
|
214
|
+
prompt?: string;
|
|
215
|
+
callback_url?: string;
|
|
216
|
+
}
|
|
161
217
|
interface AsyncTaskResponse {
|
|
162
218
|
id: string;
|
|
163
219
|
status: AsyncTaskStatus;
|
|
@@ -182,7 +238,7 @@ interface ImageToVideoResponse extends AsyncTaskResponse {
|
|
|
182
238
|
* AI avatar quality tier. Pro models produce the most natural lip movements;
|
|
183
239
|
* Standard models are faster with slightly less refined lip sync.
|
|
184
240
|
*/
|
|
185
|
-
type AiAvatarModel =
|
|
241
|
+
type AiAvatarModel = (typeof modelValues.avatar)[keyof typeof modelValues.avatar];
|
|
186
242
|
/** Lip-sync a face image to an audio track, producing a talking-head video. */
|
|
187
243
|
interface AiAvatarParams {
|
|
188
244
|
model: AiAvatarModel;
|
|
@@ -204,7 +260,7 @@ interface AiAvatarResponse extends AsyncTaskResponse {
|
|
|
204
260
|
* the movement patterns from the reference while preserving its own appearance.
|
|
205
261
|
*/
|
|
206
262
|
interface MotionControlParams {
|
|
207
|
-
model:
|
|
263
|
+
model: (typeof modelValues.textToVideo.KLING_3_0);
|
|
208
264
|
/** Subject image URL whose appearance is preserved. */
|
|
209
265
|
source_image_url: string;
|
|
210
266
|
/** Reference video URL whose motion patterns are transferred. */
|
|
@@ -348,6 +404,14 @@ declare class MotionControl {
|
|
|
348
404
|
get(id: string, options?: RequestOptions): Promise<MotionControlResponse>;
|
|
349
405
|
}
|
|
350
406
|
|
|
407
|
+
declare class ExtendVideo {
|
|
408
|
+
private readonly http;
|
|
409
|
+
constructor(http: HttpClient);
|
|
410
|
+
run(params: KlingExtendVideoParams, options?: RequestOptions & PollingOptions): Promise<TextToVideoResponse>;
|
|
411
|
+
create(params: KlingExtendVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
|
|
412
|
+
get(id: string, options?: RequestOptions): Promise<TextToVideoResponse>;
|
|
413
|
+
}
|
|
414
|
+
|
|
351
415
|
/**
|
|
352
416
|
* Kling video generation, AI avatar lip-sync, and motion control API client.
|
|
353
417
|
*
|
|
@@ -370,7 +434,8 @@ declare class KlingClient extends BaseClient {
|
|
|
370
434
|
readonly aiAvatar: AiAvatar;
|
|
371
435
|
/** Transfer motion from a reference video onto a subject image. */
|
|
372
436
|
readonly motionControl: MotionControl;
|
|
437
|
+
readonly extendVideo: ExtendVideo;
|
|
373
438
|
constructor(options?: ClientOptions);
|
|
374
439
|
}
|
|
375
440
|
|
|
376
|
-
export { type AiAvatarModel, type AiAvatarParams, type AiAvatarResponse, type AsyncTaskResponse, type CompletedAiAvatarResponse, type CompletedImageToVideoResponse, type CompletedMotionControlResponse, type CompletedTextToVideoResponse, type ImageToVideoParams, type ImageToVideoResponse, type Kling3TextToVideoMultiShotParams, type Kling3TextToVideoSingleShotParams, type KlingAspectRatio, KlingClient, type KlingDuration, type KlingElement, type KlingImageToVideoModel, type KlingTextToVideoModel, type KlingTextToVideoOutputResolution, type KlingV26ImageToVideoParams, type KlingV26Mode, type KlingV26TextToVideoParams, type KlingV2ImageToVideoModel, type KlingV3TurboOutputResolution, type MotionControlParams, type MotionControlResponse, type MultiPromptItem, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type V21MasterTextToVideoParams, type V25TurboTextToVideoParams, type V2ImageToVideoParams, type V3TurboImageToVideoParams, type V3TurboTextToVideoParams, type VideoMetadata };
|
|
441
|
+
export { type AiAvatarModel, type AiAvatarParams, type AiAvatarResponse, type AsyncTaskResponse, type CompletedAiAvatarResponse, type CompletedImageToVideoResponse, type CompletedMotionControlResponse, type CompletedTextToVideoResponse, type ImageToVideoParams, type ImageToVideoResponse, type Kling3TextToVideoMultiShotParams, type Kling3TextToVideoSingleShotParams, type KlingAspectRatio, KlingClient, type KlingDuration, type KlingElement, type KlingExtendVideoParams, type KlingImageToVideoModel, type KlingTextToVideoModel, type KlingTextToVideoOutputResolution, type KlingV26ImageToVideoParams, type KlingV26Mode, type KlingV26TextToVideoParams, type KlingV2ImageToVideoModel, type KlingV3TurboOutputResolution, type MotionControlParams, type MotionControlResponse, type MultiPromptItem, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type V21MasterTextToVideoParams, type V25TurboTextToVideoParams, type V2ImageToVideoParams, type V3OmniImageToVideoParams, type V3OmniTextToVideoParams, type V3TurboImageToVideoParams, type V3TurboTextToVideoParams, type VideoMetadata };
|