@runapi.ai/kling 0.2.11 → 0.2.13
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/README.md +17 -0
- package/dist/index.d.mts +62 -14
- package/dist/index.d.ts +62 -14
- package/dist/index.js +478 -49
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +453 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/skills/kling/README.md +3 -1
- package/skills/kling/SKILL.md +3 -1
package/README.md
CHANGED
|
@@ -22,6 +22,23 @@ const task = await client.textToVideo.create({
|
|
|
22
22
|
const status = await client.textToVideo.get(task.id);
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
## Kling O1 reference media
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
const result = await client.textToVideo.run({
|
|
29
|
+
model: 'kling-o1',
|
|
30
|
+
prompt: 'Keep <<<image_1>>> beside the performer from <<<video_1>>>',
|
|
31
|
+
reference_image_urls: ['https://cdn.runapi.ai/public/samples/portrait.jpg'],
|
|
32
|
+
reference_video_url: 'https://cdn.runapi.ai/public/samples/video.mp4',
|
|
33
|
+
reference_video_type: 'feature',
|
|
34
|
+
preserve_reference_video_audio: true,
|
|
35
|
+
mode: 'pro',
|
|
36
|
+
duration_seconds: 5,
|
|
37
|
+
});
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Number reference images in prompt order as `<<<image_1>>>`, `<<<image_2>>>`, and so on; the optional video is `<<<video_1>>>`. With a video, send at most four images. Do not combine `last_frame_image_url` with reference images or a reference video. A `feature` reference video may be used with the required first frame; `base` cannot be combined with frame inputs. O1 requests are five seconds and keep sound disabled. Pricing and limits: https://runapi.ai/models/kling/o1.
|
|
41
|
+
|
|
25
42
|
Use `create` when you want to submit a task and return quickly, `get` when you need the latest task state, and `run` when a script should create and poll until completion. In web request handlers, prefer `create` plus webhook or later `get` polling so a worker is not held open.
|
|
26
43
|
|
|
27
44
|
RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient, ClientOptions } from '@runapi.ai/core';
|
|
1
|
+
import { TaskResponse, AsyncTaskStatus, TaskBillingResponse, 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
4
|
declare const modelValues: {
|
|
5
5
|
readonly textToVideo: {
|
|
6
6
|
readonly KLING_3_0: "kling-3.0";
|
|
7
|
+
readonly KLING_O1: "kling-o1";
|
|
7
8
|
readonly KLING_V2_1_MASTER_TEXT_TO_VIDEO: "kling-v2.1-master-text-to-video";
|
|
8
9
|
readonly KLING_V2_5_TURBO_TEXT_TO_VIDEO_PRO: "kling-v2.5-turbo-text-to-video-pro";
|
|
9
10
|
readonly KLING_V2_6: "kling-v2.6";
|
|
@@ -11,6 +12,7 @@ declare const modelValues: {
|
|
|
11
12
|
readonly KLING_V3_TURBO_TEXT_TO_VIDEO: "kling-v3-turbo-text-to-video";
|
|
12
13
|
};
|
|
13
14
|
readonly imageToVideo: {
|
|
15
|
+
readonly KLING_O1: "kling-o1";
|
|
14
16
|
readonly KLING_V2_1_MASTER_IMAGE_TO_VIDEO: "kling-v2.1-master-image-to-video";
|
|
15
17
|
readonly KLING_V2_1_PRO: "kling-v2.1-pro";
|
|
16
18
|
readonly KLING_V2_1_STANDARD: "kling-v2.1-standard";
|
|
@@ -25,6 +27,10 @@ declare const modelValues: {
|
|
|
25
27
|
readonly KLING_AI_AVATAR_V1_PRO: "kling-ai-avatar-v1-pro";
|
|
26
28
|
readonly KLING_V1_AVATAR_STANDARD: "kling-v1-avatar-standard";
|
|
27
29
|
};
|
|
30
|
+
readonly motionControl: {
|
|
31
|
+
readonly KLING_3_0: "kling-3.0";
|
|
32
|
+
readonly KLING_V2_6: "kling-v2.6";
|
|
33
|
+
};
|
|
28
34
|
};
|
|
29
35
|
|
|
30
36
|
/**
|
|
@@ -42,6 +48,7 @@ type KlingAspectRatio = '16:9' | '9:16' | '1:1';
|
|
|
42
48
|
/** Duration in seconds. Range varies by model: 3-15 for kling-3.0, 5 or 10 for V2.x. */
|
|
43
49
|
type KlingDuration = number;
|
|
44
50
|
type KlingV26Mode = 'std' | 'pro';
|
|
51
|
+
type KlingO1ReferenceVideoType = 'base' | 'feature';
|
|
45
52
|
/** A single shot in a multi-shot text-to-video sequence. */
|
|
46
53
|
interface MultiPromptItem {
|
|
47
54
|
prompt: string;
|
|
@@ -141,6 +148,26 @@ interface KlingV26TextToVideoParams {
|
|
|
141
148
|
aspect_ratio?: KlingAspectRatio;
|
|
142
149
|
callback_url?: string;
|
|
143
150
|
}
|
|
151
|
+
interface KlingO1ReferenceParams {
|
|
152
|
+
/** Ordered public HTTP(S) image references; use matching `<<<image_N>>>` markers in prompt. */
|
|
153
|
+
reference_image_urls?: string[];
|
|
154
|
+
/** Public HTTP(S) MP4 or MOV reference video; use `<<<video_1>>>` in prompt. */
|
|
155
|
+
reference_video_url?: string;
|
|
156
|
+
/** Base edit or feature reference; defaults to base. */
|
|
157
|
+
reference_video_type?: KlingO1ReferenceVideoType;
|
|
158
|
+
/** Preserve audio from the reference video. */
|
|
159
|
+
preserve_reference_video_audio?: boolean;
|
|
160
|
+
}
|
|
161
|
+
/** Kling O1 text-to-video with image and video references. */
|
|
162
|
+
interface KlingO1TextToVideoParams extends KlingO1ReferenceParams {
|
|
163
|
+
model: (typeof modelValues.textToVideo.KLING_O1);
|
|
164
|
+
prompt: string;
|
|
165
|
+
mode?: KlingV26Mode;
|
|
166
|
+
duration_seconds?: 5;
|
|
167
|
+
enable_sound?: false;
|
|
168
|
+
aspect_ratio?: KlingAspectRatio;
|
|
169
|
+
callback_url?: string;
|
|
170
|
+
}
|
|
144
171
|
/** Kling v3 Omni text-to-video with native 4K, synchronized sound, and flexible duration. */
|
|
145
172
|
interface V3OmniTextToVideoParams {
|
|
146
173
|
model: (typeof modelValues.textToVideo.KLING_V3_OMNI);
|
|
@@ -192,6 +219,19 @@ interface KlingV26ImageToVideoParams {
|
|
|
192
219
|
aspect_ratio?: KlingAspectRatio;
|
|
193
220
|
callback_url?: string;
|
|
194
221
|
}
|
|
222
|
+
/** Kling O1 image-to-video with a first frame plus either a final frame or reference media. */
|
|
223
|
+
interface KlingO1ImageToVideoParams extends KlingO1ReferenceParams {
|
|
224
|
+
model: (typeof modelValues.imageToVideo.KLING_O1);
|
|
225
|
+
prompt: string;
|
|
226
|
+
first_frame_image_url: string;
|
|
227
|
+
/** Final frame URL; cannot be combined with reference_image_urls or reference_video_url. */
|
|
228
|
+
last_frame_image_url?: string;
|
|
229
|
+
mode?: KlingV26Mode;
|
|
230
|
+
duration_seconds?: 5;
|
|
231
|
+
enable_sound?: false;
|
|
232
|
+
aspect_ratio?: KlingAspectRatio;
|
|
233
|
+
callback_url?: string;
|
|
234
|
+
}
|
|
195
235
|
/** Kling v3 Omni image-to-video from caller-owned first and optional final frames. */
|
|
196
236
|
interface V3OmniImageToVideoParams {
|
|
197
237
|
model: (typeof modelValues.imageToVideo.KLING_V3_OMNI);
|
|
@@ -205,8 +245,8 @@ interface V3OmniImageToVideoParams {
|
|
|
205
245
|
aspect_ratio?: KlingAspectRatio;
|
|
206
246
|
callback_url?: string;
|
|
207
247
|
}
|
|
208
|
-
type TextToVideoParams = Kling3TextToVideoSingleShotParams | Kling3TextToVideoMultiShotParams | KlingV26TextToVideoParams | V25TurboTextToVideoParams | V21MasterTextToVideoParams | V3TurboTextToVideoParams | V3OmniTextToVideoParams;
|
|
209
|
-
type ImageToVideoParams = V2ImageToVideoParams | KlingV26ImageToVideoParams | V3TurboImageToVideoParams | V3OmniImageToVideoParams;
|
|
248
|
+
type TextToVideoParams = Kling3TextToVideoSingleShotParams | Kling3TextToVideoMultiShotParams | KlingV26TextToVideoParams | KlingO1TextToVideoParams | V25TurboTextToVideoParams | V21MasterTextToVideoParams | V3TurboTextToVideoParams | V3OmniTextToVideoParams;
|
|
249
|
+
type ImageToVideoParams = V2ImageToVideoParams | KlingV26ImageToVideoParams | KlingO1ImageToVideoParams | V3TurboImageToVideoParams | V3OmniImageToVideoParams;
|
|
210
250
|
/** Continue a completed Kling V2.5 Turbo video task. */
|
|
211
251
|
interface KlingExtendVideoParams {
|
|
212
252
|
source_task_id: string;
|
|
@@ -214,11 +254,11 @@ interface KlingExtendVideoParams {
|
|
|
214
254
|
prompt?: string;
|
|
215
255
|
callback_url?: string;
|
|
216
256
|
}
|
|
217
|
-
interface AsyncTaskResponse {
|
|
257
|
+
interface AsyncTaskResponse extends TaskResponse {
|
|
218
258
|
id: string;
|
|
219
259
|
status: AsyncTaskStatus;
|
|
220
260
|
}
|
|
221
|
-
interface TaskCreateResponse {
|
|
261
|
+
interface TaskCreateResponse extends TaskBillingResponse {
|
|
222
262
|
id: string;
|
|
223
263
|
}
|
|
224
264
|
interface VideoMetadata {
|
|
@@ -255,25 +295,33 @@ interface AiAvatarResponse extends AsyncTaskResponse {
|
|
|
255
295
|
error?: string;
|
|
256
296
|
[key: string]: unknown;
|
|
257
297
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
* the movement patterns from the reference while preserving its own appearance.
|
|
261
|
-
*/
|
|
262
|
-
interface MotionControlParams {
|
|
263
|
-
model: (typeof modelValues.textToVideo.KLING_3_0);
|
|
298
|
+
type MotionControlModel = (typeof modelValues.motionControl)[keyof typeof modelValues.motionControl];
|
|
299
|
+
interface MotionControlCommonParams {
|
|
264
300
|
/** Subject image URL whose appearance is preserved. */
|
|
265
301
|
source_image_url: string;
|
|
266
|
-
/** Reference video URL whose motion patterns are transferred. */
|
|
302
|
+
/** Reference video URL whose motion patterns are transferred (Kling 2.6: 3-10 seconds with image orientation or 3-30 seconds with video orientation). */
|
|
267
303
|
reference_video_url: string;
|
|
268
304
|
/** Optional description prompt. */
|
|
269
305
|
prompt?: string;
|
|
306
|
+
callback_url?: string;
|
|
307
|
+
}
|
|
308
|
+
/** Kling 3.0 motion transfer with optional orientation and background controls. */
|
|
309
|
+
interface Kling3MotionControlParams extends MotionControlCommonParams {
|
|
310
|
+
model: (typeof modelValues.motionControl.KLING_3_0);
|
|
270
311
|
output_resolution?: '720p' | '1080p';
|
|
271
312
|
/** Whether the character faces the direction from the video or the image. */
|
|
272
313
|
character_orientation?: 'video' | 'image';
|
|
273
314
|
/** Whether the background comes from the video or the image. */
|
|
274
315
|
background_source?: 'video' | 'image';
|
|
275
|
-
callback_url?: string;
|
|
276
316
|
}
|
|
317
|
+
/** Kling 2.6 motion transfer with explicit resolution and character orientation. */
|
|
318
|
+
interface KlingV26MotionControlParams extends MotionControlCommonParams {
|
|
319
|
+
model: (typeof modelValues.motionControl.KLING_V2_6);
|
|
320
|
+
output_resolution: '720p' | '1080p';
|
|
321
|
+
character_orientation: 'video' | 'image';
|
|
322
|
+
background_source?: never;
|
|
323
|
+
}
|
|
324
|
+
type MotionControlParams = Kling3MotionControlParams | KlingV26MotionControlParams;
|
|
277
325
|
interface MotionControlResponse extends AsyncTaskResponse {
|
|
278
326
|
videos?: VideoMetadata[];
|
|
279
327
|
error?: string;
|
|
@@ -438,4 +486,4 @@ declare class KlingClient extends BaseClient {
|
|
|
438
486
|
constructor(options?: ClientOptions);
|
|
439
487
|
}
|
|
440
488
|
|
|
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 };
|
|
489
|
+
export { type AiAvatarModel, type AiAvatarParams, type AiAvatarResponse, type AsyncTaskResponse, type CompletedAiAvatarResponse, type CompletedImageToVideoResponse, type CompletedMotionControlResponse, type CompletedTextToVideoResponse, type ImageToVideoParams, type ImageToVideoResponse, type Kling3MotionControlParams, type Kling3TextToVideoMultiShotParams, type Kling3TextToVideoSingleShotParams, type KlingAspectRatio, KlingClient, type KlingDuration, type KlingElement, type KlingExtendVideoParams, type KlingImageToVideoModel, type KlingO1ImageToVideoParams, type KlingO1ReferenceVideoType, type KlingO1TextToVideoParams, type KlingTextToVideoModel, type KlingTextToVideoOutputResolution, type KlingV26ImageToVideoParams, type KlingV26Mode, type KlingV26MotionControlParams, type KlingV26TextToVideoParams, type KlingV2ImageToVideoModel, type KlingV3TurboOutputResolution, type MotionControlModel, 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,9 +1,10 @@
|
|
|
1
|
-
import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient, ClientOptions } from '@runapi.ai/core';
|
|
1
|
+
import { TaskResponse, AsyncTaskStatus, TaskBillingResponse, 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
4
|
declare const modelValues: {
|
|
5
5
|
readonly textToVideo: {
|
|
6
6
|
readonly KLING_3_0: "kling-3.0";
|
|
7
|
+
readonly KLING_O1: "kling-o1";
|
|
7
8
|
readonly KLING_V2_1_MASTER_TEXT_TO_VIDEO: "kling-v2.1-master-text-to-video";
|
|
8
9
|
readonly KLING_V2_5_TURBO_TEXT_TO_VIDEO_PRO: "kling-v2.5-turbo-text-to-video-pro";
|
|
9
10
|
readonly KLING_V2_6: "kling-v2.6";
|
|
@@ -11,6 +12,7 @@ declare const modelValues: {
|
|
|
11
12
|
readonly KLING_V3_TURBO_TEXT_TO_VIDEO: "kling-v3-turbo-text-to-video";
|
|
12
13
|
};
|
|
13
14
|
readonly imageToVideo: {
|
|
15
|
+
readonly KLING_O1: "kling-o1";
|
|
14
16
|
readonly KLING_V2_1_MASTER_IMAGE_TO_VIDEO: "kling-v2.1-master-image-to-video";
|
|
15
17
|
readonly KLING_V2_1_PRO: "kling-v2.1-pro";
|
|
16
18
|
readonly KLING_V2_1_STANDARD: "kling-v2.1-standard";
|
|
@@ -25,6 +27,10 @@ declare const modelValues: {
|
|
|
25
27
|
readonly KLING_AI_AVATAR_V1_PRO: "kling-ai-avatar-v1-pro";
|
|
26
28
|
readonly KLING_V1_AVATAR_STANDARD: "kling-v1-avatar-standard";
|
|
27
29
|
};
|
|
30
|
+
readonly motionControl: {
|
|
31
|
+
readonly KLING_3_0: "kling-3.0";
|
|
32
|
+
readonly KLING_V2_6: "kling-v2.6";
|
|
33
|
+
};
|
|
28
34
|
};
|
|
29
35
|
|
|
30
36
|
/**
|
|
@@ -42,6 +48,7 @@ type KlingAspectRatio = '16:9' | '9:16' | '1:1';
|
|
|
42
48
|
/** Duration in seconds. Range varies by model: 3-15 for kling-3.0, 5 or 10 for V2.x. */
|
|
43
49
|
type KlingDuration = number;
|
|
44
50
|
type KlingV26Mode = 'std' | 'pro';
|
|
51
|
+
type KlingO1ReferenceVideoType = 'base' | 'feature';
|
|
45
52
|
/** A single shot in a multi-shot text-to-video sequence. */
|
|
46
53
|
interface MultiPromptItem {
|
|
47
54
|
prompt: string;
|
|
@@ -141,6 +148,26 @@ interface KlingV26TextToVideoParams {
|
|
|
141
148
|
aspect_ratio?: KlingAspectRatio;
|
|
142
149
|
callback_url?: string;
|
|
143
150
|
}
|
|
151
|
+
interface KlingO1ReferenceParams {
|
|
152
|
+
/** Ordered public HTTP(S) image references; use matching `<<<image_N>>>` markers in prompt. */
|
|
153
|
+
reference_image_urls?: string[];
|
|
154
|
+
/** Public HTTP(S) MP4 or MOV reference video; use `<<<video_1>>>` in prompt. */
|
|
155
|
+
reference_video_url?: string;
|
|
156
|
+
/** Base edit or feature reference; defaults to base. */
|
|
157
|
+
reference_video_type?: KlingO1ReferenceVideoType;
|
|
158
|
+
/** Preserve audio from the reference video. */
|
|
159
|
+
preserve_reference_video_audio?: boolean;
|
|
160
|
+
}
|
|
161
|
+
/** Kling O1 text-to-video with image and video references. */
|
|
162
|
+
interface KlingO1TextToVideoParams extends KlingO1ReferenceParams {
|
|
163
|
+
model: (typeof modelValues.textToVideo.KLING_O1);
|
|
164
|
+
prompt: string;
|
|
165
|
+
mode?: KlingV26Mode;
|
|
166
|
+
duration_seconds?: 5;
|
|
167
|
+
enable_sound?: false;
|
|
168
|
+
aspect_ratio?: KlingAspectRatio;
|
|
169
|
+
callback_url?: string;
|
|
170
|
+
}
|
|
144
171
|
/** Kling v3 Omni text-to-video with native 4K, synchronized sound, and flexible duration. */
|
|
145
172
|
interface V3OmniTextToVideoParams {
|
|
146
173
|
model: (typeof modelValues.textToVideo.KLING_V3_OMNI);
|
|
@@ -192,6 +219,19 @@ interface KlingV26ImageToVideoParams {
|
|
|
192
219
|
aspect_ratio?: KlingAspectRatio;
|
|
193
220
|
callback_url?: string;
|
|
194
221
|
}
|
|
222
|
+
/** Kling O1 image-to-video with a first frame plus either a final frame or reference media. */
|
|
223
|
+
interface KlingO1ImageToVideoParams extends KlingO1ReferenceParams {
|
|
224
|
+
model: (typeof modelValues.imageToVideo.KLING_O1);
|
|
225
|
+
prompt: string;
|
|
226
|
+
first_frame_image_url: string;
|
|
227
|
+
/** Final frame URL; cannot be combined with reference_image_urls or reference_video_url. */
|
|
228
|
+
last_frame_image_url?: string;
|
|
229
|
+
mode?: KlingV26Mode;
|
|
230
|
+
duration_seconds?: 5;
|
|
231
|
+
enable_sound?: false;
|
|
232
|
+
aspect_ratio?: KlingAspectRatio;
|
|
233
|
+
callback_url?: string;
|
|
234
|
+
}
|
|
195
235
|
/** Kling v3 Omni image-to-video from caller-owned first and optional final frames. */
|
|
196
236
|
interface V3OmniImageToVideoParams {
|
|
197
237
|
model: (typeof modelValues.imageToVideo.KLING_V3_OMNI);
|
|
@@ -205,8 +245,8 @@ interface V3OmniImageToVideoParams {
|
|
|
205
245
|
aspect_ratio?: KlingAspectRatio;
|
|
206
246
|
callback_url?: string;
|
|
207
247
|
}
|
|
208
|
-
type TextToVideoParams = Kling3TextToVideoSingleShotParams | Kling3TextToVideoMultiShotParams | KlingV26TextToVideoParams | V25TurboTextToVideoParams | V21MasterTextToVideoParams | V3TurboTextToVideoParams | V3OmniTextToVideoParams;
|
|
209
|
-
type ImageToVideoParams = V2ImageToVideoParams | KlingV26ImageToVideoParams | V3TurboImageToVideoParams | V3OmniImageToVideoParams;
|
|
248
|
+
type TextToVideoParams = Kling3TextToVideoSingleShotParams | Kling3TextToVideoMultiShotParams | KlingV26TextToVideoParams | KlingO1TextToVideoParams | V25TurboTextToVideoParams | V21MasterTextToVideoParams | V3TurboTextToVideoParams | V3OmniTextToVideoParams;
|
|
249
|
+
type ImageToVideoParams = V2ImageToVideoParams | KlingV26ImageToVideoParams | KlingO1ImageToVideoParams | V3TurboImageToVideoParams | V3OmniImageToVideoParams;
|
|
210
250
|
/** Continue a completed Kling V2.5 Turbo video task. */
|
|
211
251
|
interface KlingExtendVideoParams {
|
|
212
252
|
source_task_id: string;
|
|
@@ -214,11 +254,11 @@ interface KlingExtendVideoParams {
|
|
|
214
254
|
prompt?: string;
|
|
215
255
|
callback_url?: string;
|
|
216
256
|
}
|
|
217
|
-
interface AsyncTaskResponse {
|
|
257
|
+
interface AsyncTaskResponse extends TaskResponse {
|
|
218
258
|
id: string;
|
|
219
259
|
status: AsyncTaskStatus;
|
|
220
260
|
}
|
|
221
|
-
interface TaskCreateResponse {
|
|
261
|
+
interface TaskCreateResponse extends TaskBillingResponse {
|
|
222
262
|
id: string;
|
|
223
263
|
}
|
|
224
264
|
interface VideoMetadata {
|
|
@@ -255,25 +295,33 @@ interface AiAvatarResponse extends AsyncTaskResponse {
|
|
|
255
295
|
error?: string;
|
|
256
296
|
[key: string]: unknown;
|
|
257
297
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
* the movement patterns from the reference while preserving its own appearance.
|
|
261
|
-
*/
|
|
262
|
-
interface MotionControlParams {
|
|
263
|
-
model: (typeof modelValues.textToVideo.KLING_3_0);
|
|
298
|
+
type MotionControlModel = (typeof modelValues.motionControl)[keyof typeof modelValues.motionControl];
|
|
299
|
+
interface MotionControlCommonParams {
|
|
264
300
|
/** Subject image URL whose appearance is preserved. */
|
|
265
301
|
source_image_url: string;
|
|
266
|
-
/** Reference video URL whose motion patterns are transferred. */
|
|
302
|
+
/** Reference video URL whose motion patterns are transferred (Kling 2.6: 3-10 seconds with image orientation or 3-30 seconds with video orientation). */
|
|
267
303
|
reference_video_url: string;
|
|
268
304
|
/** Optional description prompt. */
|
|
269
305
|
prompt?: string;
|
|
306
|
+
callback_url?: string;
|
|
307
|
+
}
|
|
308
|
+
/** Kling 3.0 motion transfer with optional orientation and background controls. */
|
|
309
|
+
interface Kling3MotionControlParams extends MotionControlCommonParams {
|
|
310
|
+
model: (typeof modelValues.motionControl.KLING_3_0);
|
|
270
311
|
output_resolution?: '720p' | '1080p';
|
|
271
312
|
/** Whether the character faces the direction from the video or the image. */
|
|
272
313
|
character_orientation?: 'video' | 'image';
|
|
273
314
|
/** Whether the background comes from the video or the image. */
|
|
274
315
|
background_source?: 'video' | 'image';
|
|
275
|
-
callback_url?: string;
|
|
276
316
|
}
|
|
317
|
+
/** Kling 2.6 motion transfer with explicit resolution and character orientation. */
|
|
318
|
+
interface KlingV26MotionControlParams extends MotionControlCommonParams {
|
|
319
|
+
model: (typeof modelValues.motionControl.KLING_V2_6);
|
|
320
|
+
output_resolution: '720p' | '1080p';
|
|
321
|
+
character_orientation: 'video' | 'image';
|
|
322
|
+
background_source?: never;
|
|
323
|
+
}
|
|
324
|
+
type MotionControlParams = Kling3MotionControlParams | KlingV26MotionControlParams;
|
|
277
325
|
interface MotionControlResponse extends AsyncTaskResponse {
|
|
278
326
|
videos?: VideoMetadata[];
|
|
279
327
|
error?: string;
|
|
@@ -438,4 +486,4 @@ declare class KlingClient extends BaseClient {
|
|
|
438
486
|
constructor(options?: ClientOptions);
|
|
439
487
|
}
|
|
440
488
|
|
|
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 };
|
|
489
|
+
export { type AiAvatarModel, type AiAvatarParams, type AiAvatarResponse, type AsyncTaskResponse, type CompletedAiAvatarResponse, type CompletedImageToVideoResponse, type CompletedMotionControlResponse, type CompletedTextToVideoResponse, type ImageToVideoParams, type ImageToVideoResponse, type Kling3MotionControlParams, type Kling3TextToVideoMultiShotParams, type Kling3TextToVideoSingleShotParams, type KlingAspectRatio, KlingClient, type KlingDuration, type KlingElement, type KlingExtendVideoParams, type KlingImageToVideoModel, type KlingO1ImageToVideoParams, type KlingO1ReferenceVideoType, type KlingO1TextToVideoParams, type KlingTextToVideoModel, type KlingTextToVideoOutputResolution, type KlingV26ImageToVideoParams, type KlingV26Mode, type KlingV26MotionControlParams, type KlingV26TextToVideoParams, type KlingV2ImageToVideoModel, type KlingV3TurboOutputResolution, type MotionControlModel, 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 };
|