@runapi.ai/kling 0.3.5 → 0.5.0
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 +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +26 -1637
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -1619
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2,1529 +2,9 @@
|
|
|
2
2
|
import { BaseClient } from "@runapi.ai/core";
|
|
3
3
|
|
|
4
4
|
// src/resources/text-to-video.ts
|
|
5
|
-
import {
|
|
5
|
+
import { compactParams } from "@runapi.ai/core";
|
|
6
6
|
import { pollUntilComplete } from "@runapi.ai/core/internal";
|
|
7
|
-
|
|
8
|
-
// src/contract_gen.ts
|
|
9
|
-
var contract = {
|
|
10
|
-
"avatar": {
|
|
11
|
-
"models": [
|
|
12
|
-
"kling-ai-avatar-pro",
|
|
13
|
-
"kling-ai-avatar-standard",
|
|
14
|
-
"kling-ai-avatar-v1-pro",
|
|
15
|
-
"kling-v1-avatar-standard"
|
|
16
|
-
],
|
|
17
|
-
"fields_by_model": {
|
|
18
|
-
"kling-ai-avatar-pro": {
|
|
19
|
-
"model": {
|
|
20
|
-
"required": true
|
|
21
|
-
},
|
|
22
|
-
"prompt": {
|
|
23
|
-
"required": true
|
|
24
|
-
},
|
|
25
|
-
"source_audio_url": {
|
|
26
|
-
"required": true
|
|
27
|
-
},
|
|
28
|
-
"source_image_url": {
|
|
29
|
-
"required": true
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"kling-ai-avatar-standard": {
|
|
33
|
-
"model": {
|
|
34
|
-
"required": true
|
|
35
|
-
},
|
|
36
|
-
"prompt": {
|
|
37
|
-
"required": true
|
|
38
|
-
},
|
|
39
|
-
"source_audio_url": {
|
|
40
|
-
"required": true
|
|
41
|
-
},
|
|
42
|
-
"source_image_url": {
|
|
43
|
-
"required": true
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
"kling-ai-avatar-v1-pro": {
|
|
47
|
-
"model": {
|
|
48
|
-
"required": true
|
|
49
|
-
},
|
|
50
|
-
"prompt": {
|
|
51
|
-
"required": true
|
|
52
|
-
},
|
|
53
|
-
"source_audio_url": {
|
|
54
|
-
"required": true
|
|
55
|
-
},
|
|
56
|
-
"source_image_url": {
|
|
57
|
-
"required": true
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
"kling-v1-avatar-standard": {
|
|
61
|
-
"model": {
|
|
62
|
-
"required": true
|
|
63
|
-
},
|
|
64
|
-
"prompt": {
|
|
65
|
-
"required": true
|
|
66
|
-
},
|
|
67
|
-
"source_audio_url": {
|
|
68
|
-
"required": true
|
|
69
|
-
},
|
|
70
|
-
"source_image_url": {
|
|
71
|
-
"required": true
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
"edit-video": {
|
|
77
|
-
"models": [
|
|
78
|
-
"kling-v3-omni-edit",
|
|
79
|
-
"kling-v3-omni-reference"
|
|
80
|
-
],
|
|
81
|
-
"fields_by_model": {
|
|
82
|
-
"kling-v3-omni-edit": {
|
|
83
|
-
"aspect_ratio": {
|
|
84
|
-
"enum": [
|
|
85
|
-
"auto",
|
|
86
|
-
"16:9",
|
|
87
|
-
"9:16",
|
|
88
|
-
"1:1"
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
"duration_seconds": {
|
|
92
|
-
"enum": [
|
|
93
|
-
3,
|
|
94
|
-
4,
|
|
95
|
-
5,
|
|
96
|
-
6,
|
|
97
|
-
7,
|
|
98
|
-
8,
|
|
99
|
-
9,
|
|
100
|
-
10,
|
|
101
|
-
11,
|
|
102
|
-
12,
|
|
103
|
-
13,
|
|
104
|
-
14,
|
|
105
|
-
15
|
|
106
|
-
],
|
|
107
|
-
"type": "integer"
|
|
108
|
-
},
|
|
109
|
-
"model": {
|
|
110
|
-
"required": true
|
|
111
|
-
},
|
|
112
|
-
"output_resolution": {
|
|
113
|
-
"enum": [
|
|
114
|
-
"720p",
|
|
115
|
-
"1080p",
|
|
116
|
-
"4k"
|
|
117
|
-
]
|
|
118
|
-
},
|
|
119
|
-
"prompt": {
|
|
120
|
-
"required": true,
|
|
121
|
-
"min": 1,
|
|
122
|
-
"max": 2500,
|
|
123
|
-
"length": true
|
|
124
|
-
},
|
|
125
|
-
"reference_image_urls": {
|
|
126
|
-
"min_items": 1,
|
|
127
|
-
"max_items": 4
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
"kling-v3-omni-reference": {
|
|
131
|
-
"aspect_ratio": {
|
|
132
|
-
"enum": [
|
|
133
|
-
"auto",
|
|
134
|
-
"16:9",
|
|
135
|
-
"9:16",
|
|
136
|
-
"1:1"
|
|
137
|
-
]
|
|
138
|
-
},
|
|
139
|
-
"duration_seconds": {
|
|
140
|
-
"enum": [
|
|
141
|
-
3,
|
|
142
|
-
4,
|
|
143
|
-
5,
|
|
144
|
-
6,
|
|
145
|
-
7,
|
|
146
|
-
8,
|
|
147
|
-
9,
|
|
148
|
-
10,
|
|
149
|
-
11,
|
|
150
|
-
12,
|
|
151
|
-
13,
|
|
152
|
-
14,
|
|
153
|
-
15
|
|
154
|
-
],
|
|
155
|
-
"type": "integer"
|
|
156
|
-
},
|
|
157
|
-
"model": {
|
|
158
|
-
"required": true
|
|
159
|
-
},
|
|
160
|
-
"output_resolution": {
|
|
161
|
-
"enum": [
|
|
162
|
-
"720p",
|
|
163
|
-
"1080p",
|
|
164
|
-
"4k"
|
|
165
|
-
]
|
|
166
|
-
},
|
|
167
|
-
"prompt": {
|
|
168
|
-
"required": true,
|
|
169
|
-
"min": 1,
|
|
170
|
-
"max": 2500,
|
|
171
|
-
"length": true
|
|
172
|
-
},
|
|
173
|
-
"reference_image_urls": {
|
|
174
|
-
"min_items": 1,
|
|
175
|
-
"max_items": 4
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
"rules": [
|
|
180
|
-
{
|
|
181
|
-
"when": {
|
|
182
|
-
"model": "kling-v3-omni-edit",
|
|
183
|
-
"source_task_id": {
|
|
184
|
-
"present": false
|
|
185
|
-
},
|
|
186
|
-
"source_video_url": {
|
|
187
|
-
"present": false
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
"required_any": [
|
|
191
|
-
"source_video_url",
|
|
192
|
-
"source_task_id"
|
|
193
|
-
]
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
"when": {
|
|
197
|
-
"model": "kling-v3-omni-edit",
|
|
198
|
-
"source_video_url": {
|
|
199
|
-
"present": true
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
"forbidden": [
|
|
203
|
-
"source_task_id"
|
|
204
|
-
]
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
"when": {
|
|
208
|
-
"model": "kling-v3-omni-edit",
|
|
209
|
-
"source_task_id": {
|
|
210
|
-
"present": true
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
"forbidden": [
|
|
214
|
-
"source_video_url"
|
|
215
|
-
]
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
"enum": {
|
|
219
|
-
"aspect_ratio": [
|
|
220
|
-
"auto"
|
|
221
|
-
],
|
|
222
|
-
"duration_seconds": [
|
|
223
|
-
5
|
|
224
|
-
]
|
|
225
|
-
},
|
|
226
|
-
"when": {
|
|
227
|
-
"model": "kling-v3-omni-edit",
|
|
228
|
-
"source_video_url": {
|
|
229
|
-
"present": true
|
|
230
|
-
},
|
|
231
|
-
"reference_image_urls": {
|
|
232
|
-
"present": false
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
"required": [
|
|
236
|
-
"aspect_ratio"
|
|
237
|
-
]
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"enum": {
|
|
241
|
-
"aspect_ratio": [
|
|
242
|
-
"auto"
|
|
243
|
-
],
|
|
244
|
-
"duration_seconds": [
|
|
245
|
-
5
|
|
246
|
-
]
|
|
247
|
-
},
|
|
248
|
-
"when": {
|
|
249
|
-
"model": "kling-v3-omni-edit",
|
|
250
|
-
"source_task_id": {
|
|
251
|
-
"present": true
|
|
252
|
-
},
|
|
253
|
-
"reference_image_urls": {
|
|
254
|
-
"present": false
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
"required": [
|
|
258
|
-
"aspect_ratio"
|
|
259
|
-
]
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
"enum": {
|
|
263
|
-
"aspect_ratio": [
|
|
264
|
-
"16:9",
|
|
265
|
-
"9:16",
|
|
266
|
-
"1:1"
|
|
267
|
-
]
|
|
268
|
-
},
|
|
269
|
-
"when": {
|
|
270
|
-
"model": "kling-v3-omni-edit",
|
|
271
|
-
"source_video_url": {
|
|
272
|
-
"present": true
|
|
273
|
-
},
|
|
274
|
-
"reference_image_urls": {
|
|
275
|
-
"present": true
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
|
-
"required": [
|
|
279
|
-
"aspect_ratio"
|
|
280
|
-
]
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
"enum": {
|
|
284
|
-
"aspect_ratio": [
|
|
285
|
-
"16:9",
|
|
286
|
-
"9:16",
|
|
287
|
-
"1:1"
|
|
288
|
-
]
|
|
289
|
-
},
|
|
290
|
-
"when": {
|
|
291
|
-
"model": "kling-v3-omni-edit",
|
|
292
|
-
"source_task_id": {
|
|
293
|
-
"present": true
|
|
294
|
-
},
|
|
295
|
-
"reference_image_urls": {
|
|
296
|
-
"present": true
|
|
297
|
-
}
|
|
298
|
-
},
|
|
299
|
-
"required": [
|
|
300
|
-
"aspect_ratio"
|
|
301
|
-
]
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
"when": {
|
|
305
|
-
"model": "kling-v3-omni-reference",
|
|
306
|
-
"source_task_id": {
|
|
307
|
-
"present": false
|
|
308
|
-
},
|
|
309
|
-
"source_video_url": {
|
|
310
|
-
"present": false
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
"required_any": [
|
|
314
|
-
"source_video_url",
|
|
315
|
-
"source_task_id"
|
|
316
|
-
]
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
"when": {
|
|
320
|
-
"model": "kling-v3-omni-reference",
|
|
321
|
-
"source_video_url": {
|
|
322
|
-
"present": true
|
|
323
|
-
}
|
|
324
|
-
},
|
|
325
|
-
"forbidden": [
|
|
326
|
-
"source_task_id"
|
|
327
|
-
]
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
"when": {
|
|
331
|
-
"model": "kling-v3-omni-reference",
|
|
332
|
-
"source_task_id": {
|
|
333
|
-
"present": true
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
"forbidden": [
|
|
337
|
-
"source_video_url"
|
|
338
|
-
]
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
"enum": {
|
|
342
|
-
"aspect_ratio": [
|
|
343
|
-
"auto"
|
|
344
|
-
],
|
|
345
|
-
"enable_sound": [
|
|
346
|
-
false
|
|
347
|
-
],
|
|
348
|
-
"duration_seconds": [
|
|
349
|
-
5
|
|
350
|
-
]
|
|
351
|
-
},
|
|
352
|
-
"when": {
|
|
353
|
-
"model": "kling-v3-omni-reference",
|
|
354
|
-
"source_video_url": {
|
|
355
|
-
"present": true
|
|
356
|
-
},
|
|
357
|
-
"reference_image_urls": {
|
|
358
|
-
"present": false
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
|
-
"required": [
|
|
362
|
-
"aspect_ratio"
|
|
363
|
-
]
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
"enum": {
|
|
367
|
-
"aspect_ratio": [
|
|
368
|
-
"auto"
|
|
369
|
-
],
|
|
370
|
-
"enable_sound": [
|
|
371
|
-
false
|
|
372
|
-
],
|
|
373
|
-
"duration_seconds": [
|
|
374
|
-
5
|
|
375
|
-
]
|
|
376
|
-
},
|
|
377
|
-
"when": {
|
|
378
|
-
"model": "kling-v3-omni-reference",
|
|
379
|
-
"source_task_id": {
|
|
380
|
-
"present": true
|
|
381
|
-
},
|
|
382
|
-
"reference_image_urls": {
|
|
383
|
-
"present": false
|
|
384
|
-
}
|
|
385
|
-
},
|
|
386
|
-
"required": [
|
|
387
|
-
"aspect_ratio"
|
|
388
|
-
]
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
"enum": {
|
|
392
|
-
"aspect_ratio": [
|
|
393
|
-
"16:9",
|
|
394
|
-
"9:16",
|
|
395
|
-
"1:1"
|
|
396
|
-
],
|
|
397
|
-
"enable_sound": [
|
|
398
|
-
false
|
|
399
|
-
]
|
|
400
|
-
},
|
|
401
|
-
"when": {
|
|
402
|
-
"model": "kling-v3-omni-reference",
|
|
403
|
-
"source_video_url": {
|
|
404
|
-
"present": true
|
|
405
|
-
},
|
|
406
|
-
"reference_image_urls": {
|
|
407
|
-
"present": true
|
|
408
|
-
}
|
|
409
|
-
},
|
|
410
|
-
"required": [
|
|
411
|
-
"aspect_ratio"
|
|
412
|
-
]
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
"enum": {
|
|
416
|
-
"aspect_ratio": [
|
|
417
|
-
"16:9",
|
|
418
|
-
"9:16",
|
|
419
|
-
"1:1"
|
|
420
|
-
],
|
|
421
|
-
"enable_sound": [
|
|
422
|
-
false
|
|
423
|
-
]
|
|
424
|
-
},
|
|
425
|
-
"when": {
|
|
426
|
-
"model": "kling-v3-omni-reference",
|
|
427
|
-
"source_task_id": {
|
|
428
|
-
"present": true
|
|
429
|
-
},
|
|
430
|
-
"reference_image_urls": {
|
|
431
|
-
"present": true
|
|
432
|
-
}
|
|
433
|
-
},
|
|
434
|
-
"required": [
|
|
435
|
-
"aspect_ratio"
|
|
436
|
-
]
|
|
437
|
-
}
|
|
438
|
-
]
|
|
439
|
-
},
|
|
440
|
-
"extend-video": {
|
|
441
|
-
"models": [
|
|
442
|
-
"kling-v2.5-turbo-image-to-video-pro",
|
|
443
|
-
"kling-v2.5-turbo-text-to-video-pro"
|
|
444
|
-
],
|
|
445
|
-
"fields_by_model": {
|
|
446
|
-
"kling-v2.5-turbo-image-to-video-pro": {
|
|
447
|
-
"mode": {
|
|
448
|
-
"enum": [
|
|
449
|
-
"std",
|
|
450
|
-
"pro"
|
|
451
|
-
]
|
|
452
|
-
},
|
|
453
|
-
"source_task_id": {
|
|
454
|
-
"required": true
|
|
455
|
-
}
|
|
456
|
-
},
|
|
457
|
-
"kling-v2.5-turbo-text-to-video-pro": {
|
|
458
|
-
"mode": {
|
|
459
|
-
"enum": [
|
|
460
|
-
"std",
|
|
461
|
-
"pro"
|
|
462
|
-
]
|
|
463
|
-
},
|
|
464
|
-
"source_task_id": {
|
|
465
|
-
"required": true
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
},
|
|
470
|
-
"image-to-video": {
|
|
471
|
-
"models": [
|
|
472
|
-
"kling-o1",
|
|
473
|
-
"kling-v2.1-master-image-to-video",
|
|
474
|
-
"kling-v2.1-pro",
|
|
475
|
-
"kling-v2.1-standard",
|
|
476
|
-
"kling-v2.5-turbo-image-to-video-pro",
|
|
477
|
-
"kling-v2.6",
|
|
478
|
-
"kling-v3-omni",
|
|
479
|
-
"kling-v3-turbo-image-to-video"
|
|
480
|
-
],
|
|
481
|
-
"fields_by_model": {
|
|
482
|
-
"kling-o1": {
|
|
483
|
-
"aspect_ratio": {
|
|
484
|
-
"enum": [
|
|
485
|
-
"16:9",
|
|
486
|
-
"9:16",
|
|
487
|
-
"1:1"
|
|
488
|
-
]
|
|
489
|
-
},
|
|
490
|
-
"duration_seconds": {
|
|
491
|
-
"enum": [
|
|
492
|
-
5
|
|
493
|
-
],
|
|
494
|
-
"type": "integer"
|
|
495
|
-
},
|
|
496
|
-
"first_frame_image_url": {
|
|
497
|
-
"required": true
|
|
498
|
-
},
|
|
499
|
-
"mode": {
|
|
500
|
-
"enum": [
|
|
501
|
-
"std",
|
|
502
|
-
"pro"
|
|
503
|
-
]
|
|
504
|
-
},
|
|
505
|
-
"model": {
|
|
506
|
-
"required": true
|
|
507
|
-
},
|
|
508
|
-
"prompt": {
|
|
509
|
-
"required": true,
|
|
510
|
-
"min": 1,
|
|
511
|
-
"max": 2500,
|
|
512
|
-
"length": true
|
|
513
|
-
},
|
|
514
|
-
"reference_image_urls": {
|
|
515
|
-
"min_items": 1,
|
|
516
|
-
"max_items": 7
|
|
517
|
-
},
|
|
518
|
-
"reference_video_type": {
|
|
519
|
-
"enum": [
|
|
520
|
-
"base",
|
|
521
|
-
"feature"
|
|
522
|
-
]
|
|
523
|
-
}
|
|
524
|
-
},
|
|
525
|
-
"kling-v2.1-master-image-to-video": {
|
|
526
|
-
"duration_seconds": {
|
|
527
|
-
"enum": [
|
|
528
|
-
5,
|
|
529
|
-
10
|
|
530
|
-
],
|
|
531
|
-
"type": "integer"
|
|
532
|
-
},
|
|
533
|
-
"first_frame_image_url": {
|
|
534
|
-
"required": true
|
|
535
|
-
},
|
|
536
|
-
"model": {
|
|
537
|
-
"required": true
|
|
538
|
-
},
|
|
539
|
-
"prompt": {
|
|
540
|
-
"required": true
|
|
541
|
-
}
|
|
542
|
-
},
|
|
543
|
-
"kling-v2.1-pro": {
|
|
544
|
-
"duration_seconds": {
|
|
545
|
-
"enum": [
|
|
546
|
-
5,
|
|
547
|
-
10
|
|
548
|
-
],
|
|
549
|
-
"type": "integer"
|
|
550
|
-
},
|
|
551
|
-
"first_frame_image_url": {
|
|
552
|
-
"required": true
|
|
553
|
-
},
|
|
554
|
-
"model": {
|
|
555
|
-
"required": true
|
|
556
|
-
},
|
|
557
|
-
"prompt": {
|
|
558
|
-
"required": true
|
|
559
|
-
}
|
|
560
|
-
},
|
|
561
|
-
"kling-v2.1-standard": {
|
|
562
|
-
"duration_seconds": {
|
|
563
|
-
"enum": [
|
|
564
|
-
5,
|
|
565
|
-
10
|
|
566
|
-
],
|
|
567
|
-
"type": "integer"
|
|
568
|
-
},
|
|
569
|
-
"first_frame_image_url": {
|
|
570
|
-
"required": true
|
|
571
|
-
},
|
|
572
|
-
"model": {
|
|
573
|
-
"required": true
|
|
574
|
-
},
|
|
575
|
-
"prompt": {
|
|
576
|
-
"required": true
|
|
577
|
-
}
|
|
578
|
-
},
|
|
579
|
-
"kling-v2.5-turbo-image-to-video-pro": {
|
|
580
|
-
"duration_seconds": {
|
|
581
|
-
"enum": [
|
|
582
|
-
5,
|
|
583
|
-
10
|
|
584
|
-
],
|
|
585
|
-
"type": "integer"
|
|
586
|
-
},
|
|
587
|
-
"first_frame_image_url": {
|
|
588
|
-
"required": true
|
|
589
|
-
},
|
|
590
|
-
"model": {
|
|
591
|
-
"required": true
|
|
592
|
-
},
|
|
593
|
-
"prompt": {
|
|
594
|
-
"required": true
|
|
595
|
-
}
|
|
596
|
-
},
|
|
597
|
-
"kling-v2.6": {
|
|
598
|
-
"aspect_ratio": {
|
|
599
|
-
"enum": [
|
|
600
|
-
"16:9",
|
|
601
|
-
"9:16",
|
|
602
|
-
"1:1"
|
|
603
|
-
]
|
|
604
|
-
},
|
|
605
|
-
"duration_seconds": {
|
|
606
|
-
"enum": [
|
|
607
|
-
5,
|
|
608
|
-
10
|
|
609
|
-
],
|
|
610
|
-
"type": "integer"
|
|
611
|
-
},
|
|
612
|
-
"first_frame_image_url": {
|
|
613
|
-
"required": true
|
|
614
|
-
},
|
|
615
|
-
"mode": {
|
|
616
|
-
"enum": [
|
|
617
|
-
"std",
|
|
618
|
-
"pro"
|
|
619
|
-
]
|
|
620
|
-
},
|
|
621
|
-
"model": {
|
|
622
|
-
"required": true
|
|
623
|
-
},
|
|
624
|
-
"prompt": {
|
|
625
|
-
"required": true,
|
|
626
|
-
"min": 1,
|
|
627
|
-
"max": 2500,
|
|
628
|
-
"length": true
|
|
629
|
-
}
|
|
630
|
-
},
|
|
631
|
-
"kling-v3-omni": {
|
|
632
|
-
"aspect_ratio": {
|
|
633
|
-
"enum": [
|
|
634
|
-
"16:9",
|
|
635
|
-
"9:16",
|
|
636
|
-
"1:1"
|
|
637
|
-
]
|
|
638
|
-
},
|
|
639
|
-
"duration_seconds": {
|
|
640
|
-
"enum": [
|
|
641
|
-
3,
|
|
642
|
-
4,
|
|
643
|
-
5,
|
|
644
|
-
6,
|
|
645
|
-
7,
|
|
646
|
-
8,
|
|
647
|
-
9,
|
|
648
|
-
10,
|
|
649
|
-
11,
|
|
650
|
-
12,
|
|
651
|
-
13,
|
|
652
|
-
14,
|
|
653
|
-
15
|
|
654
|
-
],
|
|
655
|
-
"type": "integer"
|
|
656
|
-
},
|
|
657
|
-
"first_frame_image_url": {
|
|
658
|
-
"required": true
|
|
659
|
-
},
|
|
660
|
-
"model": {
|
|
661
|
-
"required": true
|
|
662
|
-
},
|
|
663
|
-
"output_resolution": {
|
|
664
|
-
"enum": [
|
|
665
|
-
"720p",
|
|
666
|
-
"1080p",
|
|
667
|
-
"4k"
|
|
668
|
-
]
|
|
669
|
-
},
|
|
670
|
-
"prompt": {
|
|
671
|
-
"required": true,
|
|
672
|
-
"min": 1,
|
|
673
|
-
"max": 2500,
|
|
674
|
-
"length": true
|
|
675
|
-
}
|
|
676
|
-
},
|
|
677
|
-
"kling-v3-turbo-image-to-video": {
|
|
678
|
-
"duration_seconds": {
|
|
679
|
-
"enum": [
|
|
680
|
-
3,
|
|
681
|
-
4,
|
|
682
|
-
5,
|
|
683
|
-
6,
|
|
684
|
-
7,
|
|
685
|
-
8,
|
|
686
|
-
9,
|
|
687
|
-
10,
|
|
688
|
-
11,
|
|
689
|
-
12,
|
|
690
|
-
13,
|
|
691
|
-
14,
|
|
692
|
-
15
|
|
693
|
-
],
|
|
694
|
-
"type": "integer"
|
|
695
|
-
},
|
|
696
|
-
"first_frame_image_url": {
|
|
697
|
-
"required": true
|
|
698
|
-
},
|
|
699
|
-
"model": {
|
|
700
|
-
"required": true
|
|
701
|
-
},
|
|
702
|
-
"output_resolution": {
|
|
703
|
-
"enum": [
|
|
704
|
-
"720p",
|
|
705
|
-
"1080p"
|
|
706
|
-
]
|
|
707
|
-
},
|
|
708
|
-
"prompt": {
|
|
709
|
-
"required": true,
|
|
710
|
-
"min": 1,
|
|
711
|
-
"max": 2500,
|
|
712
|
-
"length": true
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
},
|
|
716
|
-
"rules": [
|
|
717
|
-
{
|
|
718
|
-
"when": {
|
|
719
|
-
"model": "kling-o1"
|
|
720
|
-
},
|
|
721
|
-
"forbidden": [
|
|
722
|
-
"output_resolution",
|
|
723
|
-
"negative_prompt",
|
|
724
|
-
"cfg_scale"
|
|
725
|
-
]
|
|
726
|
-
},
|
|
727
|
-
{
|
|
728
|
-
"when": {
|
|
729
|
-
"model": "kling-v2.1-master-image-to-video"
|
|
730
|
-
},
|
|
731
|
-
"forbidden": [
|
|
732
|
-
"output_resolution",
|
|
733
|
-
"enable_sound",
|
|
734
|
-
"reference_image_urls",
|
|
735
|
-
"reference_video_url",
|
|
736
|
-
"reference_video_type",
|
|
737
|
-
"preserve_reference_video_audio"
|
|
738
|
-
]
|
|
739
|
-
},
|
|
740
|
-
{
|
|
741
|
-
"when": {
|
|
742
|
-
"model": "kling-v2.1-pro"
|
|
743
|
-
},
|
|
744
|
-
"forbidden": [
|
|
745
|
-
"output_resolution",
|
|
746
|
-
"enable_sound",
|
|
747
|
-
"reference_image_urls",
|
|
748
|
-
"reference_video_url",
|
|
749
|
-
"reference_video_type",
|
|
750
|
-
"preserve_reference_video_audio"
|
|
751
|
-
]
|
|
752
|
-
},
|
|
753
|
-
{
|
|
754
|
-
"when": {
|
|
755
|
-
"model": "kling-v2.1-standard"
|
|
756
|
-
},
|
|
757
|
-
"forbidden": [
|
|
758
|
-
"output_resolution",
|
|
759
|
-
"enable_sound",
|
|
760
|
-
"reference_image_urls",
|
|
761
|
-
"reference_video_url",
|
|
762
|
-
"reference_video_type",
|
|
763
|
-
"preserve_reference_video_audio"
|
|
764
|
-
]
|
|
765
|
-
},
|
|
766
|
-
{
|
|
767
|
-
"when": {
|
|
768
|
-
"model": "kling-v2.5-turbo-image-to-video-pro"
|
|
769
|
-
},
|
|
770
|
-
"forbidden": [
|
|
771
|
-
"output_resolution",
|
|
772
|
-
"enable_sound",
|
|
773
|
-
"reference_image_urls",
|
|
774
|
-
"reference_video_url",
|
|
775
|
-
"reference_video_type",
|
|
776
|
-
"preserve_reference_video_audio"
|
|
777
|
-
]
|
|
778
|
-
},
|
|
779
|
-
{
|
|
780
|
-
"when": {
|
|
781
|
-
"model": "kling-v2.6"
|
|
782
|
-
},
|
|
783
|
-
"forbidden": [
|
|
784
|
-
"output_resolution",
|
|
785
|
-
"negative_prompt",
|
|
786
|
-
"cfg_scale",
|
|
787
|
-
"reference_image_urls",
|
|
788
|
-
"reference_video_url",
|
|
789
|
-
"reference_video_type",
|
|
790
|
-
"preserve_reference_video_audio"
|
|
791
|
-
]
|
|
792
|
-
},
|
|
793
|
-
{
|
|
794
|
-
"when": {
|
|
795
|
-
"model": "kling-v3-omni"
|
|
796
|
-
},
|
|
797
|
-
"forbidden": [
|
|
798
|
-
"negative_prompt",
|
|
799
|
-
"cfg_scale",
|
|
800
|
-
"reference_image_urls",
|
|
801
|
-
"reference_video_url",
|
|
802
|
-
"reference_video_type",
|
|
803
|
-
"preserve_reference_video_audio"
|
|
804
|
-
]
|
|
805
|
-
},
|
|
806
|
-
{
|
|
807
|
-
"when": {
|
|
808
|
-
"model": "kling-v3-turbo-image-to-video"
|
|
809
|
-
},
|
|
810
|
-
"forbidden": [
|
|
811
|
-
"enable_sound",
|
|
812
|
-
"aspect_ratio",
|
|
813
|
-
"negative_prompt",
|
|
814
|
-
"cfg_scale",
|
|
815
|
-
"last_frame_image_url",
|
|
816
|
-
"reference_image_urls",
|
|
817
|
-
"reference_video_url",
|
|
818
|
-
"reference_video_type",
|
|
819
|
-
"preserve_reference_video_audio"
|
|
820
|
-
]
|
|
821
|
-
}
|
|
822
|
-
]
|
|
823
|
-
},
|
|
824
|
-
"motion-control": {
|
|
825
|
-
"models": [
|
|
826
|
-
"kling-3.0",
|
|
827
|
-
"kling-v2.6"
|
|
828
|
-
],
|
|
829
|
-
"fields_by_model": {
|
|
830
|
-
"kling-3.0": {
|
|
831
|
-
"background_source": {
|
|
832
|
-
"enum": [
|
|
833
|
-
"video",
|
|
834
|
-
"image"
|
|
835
|
-
]
|
|
836
|
-
},
|
|
837
|
-
"character_orientation": {
|
|
838
|
-
"enum": [
|
|
839
|
-
"video",
|
|
840
|
-
"image"
|
|
841
|
-
]
|
|
842
|
-
},
|
|
843
|
-
"model": {
|
|
844
|
-
"required": true
|
|
845
|
-
},
|
|
846
|
-
"output_resolution": {
|
|
847
|
-
"enum": [
|
|
848
|
-
"720p",
|
|
849
|
-
"1080p"
|
|
850
|
-
]
|
|
851
|
-
},
|
|
852
|
-
"reference_video_url": {
|
|
853
|
-
"required": true
|
|
854
|
-
},
|
|
855
|
-
"source_image_url": {
|
|
856
|
-
"required": true
|
|
857
|
-
}
|
|
858
|
-
},
|
|
859
|
-
"kling-v2.6": {
|
|
860
|
-
"character_orientation": {
|
|
861
|
-
"enum": [
|
|
862
|
-
"video",
|
|
863
|
-
"image"
|
|
864
|
-
],
|
|
865
|
-
"required": true
|
|
866
|
-
},
|
|
867
|
-
"model": {
|
|
868
|
-
"required": true
|
|
869
|
-
},
|
|
870
|
-
"output_resolution": {
|
|
871
|
-
"enum": [
|
|
872
|
-
"720p",
|
|
873
|
-
"1080p"
|
|
874
|
-
],
|
|
875
|
-
"required": true
|
|
876
|
-
},
|
|
877
|
-
"prompt": {
|
|
878
|
-
"max": 2500,
|
|
879
|
-
"length": true
|
|
880
|
-
},
|
|
881
|
-
"reference_video_url": {
|
|
882
|
-
"required": true
|
|
883
|
-
},
|
|
884
|
-
"source_image_url": {
|
|
885
|
-
"required": true
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
},
|
|
889
|
-
"rules": [
|
|
890
|
-
{
|
|
891
|
-
"when": {
|
|
892
|
-
"model": "kling-v2.6"
|
|
893
|
-
},
|
|
894
|
-
"forbidden": [
|
|
895
|
-
"background_source"
|
|
896
|
-
]
|
|
897
|
-
}
|
|
898
|
-
]
|
|
899
|
-
},
|
|
900
|
-
"text-to-video": {
|
|
901
|
-
"models": [
|
|
902
|
-
"kling-3.0",
|
|
903
|
-
"kling-o1",
|
|
904
|
-
"kling-v2.1-master-text-to-video",
|
|
905
|
-
"kling-v2.5-turbo-text-to-video-pro",
|
|
906
|
-
"kling-v2.6",
|
|
907
|
-
"kling-v3-omni",
|
|
908
|
-
"kling-v3-omni-reference",
|
|
909
|
-
"kling-v3-turbo-text-to-video"
|
|
910
|
-
],
|
|
911
|
-
"fields_by_model": {
|
|
912
|
-
"kling-3.0": {
|
|
913
|
-
"aspect_ratio": {
|
|
914
|
-
"enum": [
|
|
915
|
-
"16:9",
|
|
916
|
-
"9:16",
|
|
917
|
-
"1:1"
|
|
918
|
-
]
|
|
919
|
-
},
|
|
920
|
-
"duration_seconds": {
|
|
921
|
-
"enum": [
|
|
922
|
-
3,
|
|
923
|
-
4,
|
|
924
|
-
5,
|
|
925
|
-
6,
|
|
926
|
-
7,
|
|
927
|
-
8,
|
|
928
|
-
9,
|
|
929
|
-
10,
|
|
930
|
-
11,
|
|
931
|
-
12,
|
|
932
|
-
13,
|
|
933
|
-
14,
|
|
934
|
-
15
|
|
935
|
-
],
|
|
936
|
-
"type": "integer"
|
|
937
|
-
},
|
|
938
|
-
"model": {
|
|
939
|
-
"required": true
|
|
940
|
-
},
|
|
941
|
-
"output_resolution": {
|
|
942
|
-
"enum": [
|
|
943
|
-
"720p",
|
|
944
|
-
"1080p",
|
|
945
|
-
"4k"
|
|
946
|
-
]
|
|
947
|
-
}
|
|
948
|
-
},
|
|
949
|
-
"kling-o1": {
|
|
950
|
-
"aspect_ratio": {
|
|
951
|
-
"enum": [
|
|
952
|
-
"16:9",
|
|
953
|
-
"9:16",
|
|
954
|
-
"1:1"
|
|
955
|
-
]
|
|
956
|
-
},
|
|
957
|
-
"duration_seconds": {
|
|
958
|
-
"enum": [
|
|
959
|
-
5
|
|
960
|
-
],
|
|
961
|
-
"type": "integer"
|
|
962
|
-
},
|
|
963
|
-
"mode": {
|
|
964
|
-
"enum": [
|
|
965
|
-
"std",
|
|
966
|
-
"pro"
|
|
967
|
-
]
|
|
968
|
-
},
|
|
969
|
-
"model": {
|
|
970
|
-
"required": true
|
|
971
|
-
},
|
|
972
|
-
"prompt": {
|
|
973
|
-
"required": true,
|
|
974
|
-
"min": 1,
|
|
975
|
-
"max": 2500,
|
|
976
|
-
"length": true
|
|
977
|
-
},
|
|
978
|
-
"reference_image_urls": {
|
|
979
|
-
"min_items": 1,
|
|
980
|
-
"max_items": 7
|
|
981
|
-
},
|
|
982
|
-
"reference_video_type": {
|
|
983
|
-
"enum": [
|
|
984
|
-
"base",
|
|
985
|
-
"feature"
|
|
986
|
-
]
|
|
987
|
-
}
|
|
988
|
-
},
|
|
989
|
-
"kling-v2.1-master-text-to-video": {
|
|
990
|
-
"aspect_ratio": {
|
|
991
|
-
"enum": [
|
|
992
|
-
"16:9",
|
|
993
|
-
"9:16",
|
|
994
|
-
"1:1"
|
|
995
|
-
]
|
|
996
|
-
},
|
|
997
|
-
"duration_seconds": {
|
|
998
|
-
"enum": [
|
|
999
|
-
5,
|
|
1000
|
-
10
|
|
1001
|
-
],
|
|
1002
|
-
"type": "integer"
|
|
1003
|
-
},
|
|
1004
|
-
"model": {
|
|
1005
|
-
"required": true
|
|
1006
|
-
}
|
|
1007
|
-
},
|
|
1008
|
-
"kling-v2.5-turbo-text-to-video-pro": {
|
|
1009
|
-
"aspect_ratio": {
|
|
1010
|
-
"enum": [
|
|
1011
|
-
"16:9",
|
|
1012
|
-
"9:16",
|
|
1013
|
-
"1:1"
|
|
1014
|
-
]
|
|
1015
|
-
},
|
|
1016
|
-
"duration_seconds": {
|
|
1017
|
-
"enum": [
|
|
1018
|
-
5,
|
|
1019
|
-
10
|
|
1020
|
-
],
|
|
1021
|
-
"type": "integer"
|
|
1022
|
-
},
|
|
1023
|
-
"model": {
|
|
1024
|
-
"required": true
|
|
1025
|
-
}
|
|
1026
|
-
},
|
|
1027
|
-
"kling-v2.6": {
|
|
1028
|
-
"aspect_ratio": {
|
|
1029
|
-
"enum": [
|
|
1030
|
-
"16:9",
|
|
1031
|
-
"9:16",
|
|
1032
|
-
"1:1"
|
|
1033
|
-
]
|
|
1034
|
-
},
|
|
1035
|
-
"duration_seconds": {
|
|
1036
|
-
"enum": [
|
|
1037
|
-
5,
|
|
1038
|
-
10
|
|
1039
|
-
],
|
|
1040
|
-
"type": "integer"
|
|
1041
|
-
},
|
|
1042
|
-
"mode": {
|
|
1043
|
-
"enum": [
|
|
1044
|
-
"std",
|
|
1045
|
-
"pro"
|
|
1046
|
-
]
|
|
1047
|
-
},
|
|
1048
|
-
"model": {
|
|
1049
|
-
"required": true
|
|
1050
|
-
},
|
|
1051
|
-
"prompt": {
|
|
1052
|
-
"required": true,
|
|
1053
|
-
"min": 1,
|
|
1054
|
-
"max": 2500,
|
|
1055
|
-
"length": true
|
|
1056
|
-
}
|
|
1057
|
-
},
|
|
1058
|
-
"kling-v3-omni": {
|
|
1059
|
-
"aspect_ratio": {
|
|
1060
|
-
"enum": [
|
|
1061
|
-
"16:9",
|
|
1062
|
-
"9:16",
|
|
1063
|
-
"1:1"
|
|
1064
|
-
]
|
|
1065
|
-
},
|
|
1066
|
-
"duration_seconds": {
|
|
1067
|
-
"enum": [
|
|
1068
|
-
3,
|
|
1069
|
-
4,
|
|
1070
|
-
5,
|
|
1071
|
-
6,
|
|
1072
|
-
7,
|
|
1073
|
-
8,
|
|
1074
|
-
9,
|
|
1075
|
-
10,
|
|
1076
|
-
11,
|
|
1077
|
-
12,
|
|
1078
|
-
13,
|
|
1079
|
-
14,
|
|
1080
|
-
15
|
|
1081
|
-
],
|
|
1082
|
-
"type": "integer"
|
|
1083
|
-
},
|
|
1084
|
-
"model": {
|
|
1085
|
-
"required": true
|
|
1086
|
-
},
|
|
1087
|
-
"output_resolution": {
|
|
1088
|
-
"enum": [
|
|
1089
|
-
"720p",
|
|
1090
|
-
"1080p",
|
|
1091
|
-
"4k"
|
|
1092
|
-
]
|
|
1093
|
-
},
|
|
1094
|
-
"prompt": {
|
|
1095
|
-
"required": true,
|
|
1096
|
-
"min": 1,
|
|
1097
|
-
"max": 2500,
|
|
1098
|
-
"length": true
|
|
1099
|
-
}
|
|
1100
|
-
},
|
|
1101
|
-
"kling-v3-omni-reference": {
|
|
1102
|
-
"aspect_ratio": {
|
|
1103
|
-
"enum": [
|
|
1104
|
-
"16:9",
|
|
1105
|
-
"9:16",
|
|
1106
|
-
"1:1"
|
|
1107
|
-
],
|
|
1108
|
-
"required": true
|
|
1109
|
-
},
|
|
1110
|
-
"duration_seconds": {
|
|
1111
|
-
"enum": [
|
|
1112
|
-
3,
|
|
1113
|
-
4,
|
|
1114
|
-
5,
|
|
1115
|
-
6,
|
|
1116
|
-
7,
|
|
1117
|
-
8,
|
|
1118
|
-
9,
|
|
1119
|
-
10,
|
|
1120
|
-
11,
|
|
1121
|
-
12,
|
|
1122
|
-
13,
|
|
1123
|
-
14,
|
|
1124
|
-
15
|
|
1125
|
-
],
|
|
1126
|
-
"type": "integer"
|
|
1127
|
-
},
|
|
1128
|
-
"model": {
|
|
1129
|
-
"required": true
|
|
1130
|
-
},
|
|
1131
|
-
"output_resolution": {
|
|
1132
|
-
"enum": [
|
|
1133
|
-
"720p",
|
|
1134
|
-
"1080p",
|
|
1135
|
-
"4k"
|
|
1136
|
-
]
|
|
1137
|
-
},
|
|
1138
|
-
"prompt": {
|
|
1139
|
-
"required": true,
|
|
1140
|
-
"min": 1,
|
|
1141
|
-
"max": 2500,
|
|
1142
|
-
"length": true
|
|
1143
|
-
},
|
|
1144
|
-
"reference_image_urls": {
|
|
1145
|
-
"required": true,
|
|
1146
|
-
"min_items": 1,
|
|
1147
|
-
"max_items": 7
|
|
1148
|
-
}
|
|
1149
|
-
},
|
|
1150
|
-
"kling-v3-turbo-text-to-video": {
|
|
1151
|
-
"aspect_ratio": {
|
|
1152
|
-
"enum": [
|
|
1153
|
-
"16:9",
|
|
1154
|
-
"9:16",
|
|
1155
|
-
"1:1"
|
|
1156
|
-
]
|
|
1157
|
-
},
|
|
1158
|
-
"duration_seconds": {
|
|
1159
|
-
"enum": [
|
|
1160
|
-
3,
|
|
1161
|
-
4,
|
|
1162
|
-
5,
|
|
1163
|
-
6,
|
|
1164
|
-
7,
|
|
1165
|
-
8,
|
|
1166
|
-
9,
|
|
1167
|
-
10,
|
|
1168
|
-
11,
|
|
1169
|
-
12,
|
|
1170
|
-
13,
|
|
1171
|
-
14,
|
|
1172
|
-
15
|
|
1173
|
-
],
|
|
1174
|
-
"type": "integer"
|
|
1175
|
-
},
|
|
1176
|
-
"model": {
|
|
1177
|
-
"required": true
|
|
1178
|
-
},
|
|
1179
|
-
"output_resolution": {
|
|
1180
|
-
"enum": [
|
|
1181
|
-
"720p",
|
|
1182
|
-
"1080p"
|
|
1183
|
-
]
|
|
1184
|
-
},
|
|
1185
|
-
"prompt": {
|
|
1186
|
-
"required": true,
|
|
1187
|
-
"min": 1,
|
|
1188
|
-
"max": 2500,
|
|
1189
|
-
"length": true
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
},
|
|
1193
|
-
"rules": [
|
|
1194
|
-
{
|
|
1195
|
-
"when": {
|
|
1196
|
-
"model": "kling-3.0"
|
|
1197
|
-
},
|
|
1198
|
-
"forbidden": [
|
|
1199
|
-
"reference_image_urls",
|
|
1200
|
-
"reference_video_url",
|
|
1201
|
-
"reference_video_type",
|
|
1202
|
-
"preserve_reference_video_audio"
|
|
1203
|
-
]
|
|
1204
|
-
},
|
|
1205
|
-
{
|
|
1206
|
-
"when": {
|
|
1207
|
-
"model": "kling-o1"
|
|
1208
|
-
},
|
|
1209
|
-
"forbidden": [
|
|
1210
|
-
"output_resolution",
|
|
1211
|
-
"negative_prompt",
|
|
1212
|
-
"cfg_scale",
|
|
1213
|
-
"multi_shots",
|
|
1214
|
-
"multi_prompt",
|
|
1215
|
-
"first_frame_image_url",
|
|
1216
|
-
"last_frame_image_url",
|
|
1217
|
-
"kling_elements"
|
|
1218
|
-
]
|
|
1219
|
-
},
|
|
1220
|
-
{
|
|
1221
|
-
"when": {
|
|
1222
|
-
"model": "kling-v2.1-master-text-to-video"
|
|
1223
|
-
},
|
|
1224
|
-
"forbidden": [
|
|
1225
|
-
"mode",
|
|
1226
|
-
"reference_image_urls",
|
|
1227
|
-
"reference_video_url",
|
|
1228
|
-
"reference_video_type",
|
|
1229
|
-
"preserve_reference_video_audio"
|
|
1230
|
-
]
|
|
1231
|
-
},
|
|
1232
|
-
{
|
|
1233
|
-
"when": {
|
|
1234
|
-
"model": "kling-v2.5-turbo-text-to-video-pro"
|
|
1235
|
-
},
|
|
1236
|
-
"forbidden": [
|
|
1237
|
-
"mode",
|
|
1238
|
-
"reference_image_urls",
|
|
1239
|
-
"reference_video_url",
|
|
1240
|
-
"reference_video_type",
|
|
1241
|
-
"preserve_reference_video_audio"
|
|
1242
|
-
]
|
|
1243
|
-
},
|
|
1244
|
-
{
|
|
1245
|
-
"when": {
|
|
1246
|
-
"model": "kling-v2.6"
|
|
1247
|
-
},
|
|
1248
|
-
"forbidden": [
|
|
1249
|
-
"output_resolution",
|
|
1250
|
-
"negative_prompt",
|
|
1251
|
-
"cfg_scale",
|
|
1252
|
-
"multi_shots",
|
|
1253
|
-
"multi_prompt",
|
|
1254
|
-
"first_frame_image_url",
|
|
1255
|
-
"last_frame_image_url",
|
|
1256
|
-
"kling_elements",
|
|
1257
|
-
"reference_image_urls",
|
|
1258
|
-
"reference_video_url",
|
|
1259
|
-
"reference_video_type",
|
|
1260
|
-
"preserve_reference_video_audio"
|
|
1261
|
-
]
|
|
1262
|
-
},
|
|
1263
|
-
{
|
|
1264
|
-
"when": {
|
|
1265
|
-
"model": "kling-v3-omni"
|
|
1266
|
-
},
|
|
1267
|
-
"forbidden": [
|
|
1268
|
-
"negative_prompt",
|
|
1269
|
-
"cfg_scale",
|
|
1270
|
-
"multi_shots",
|
|
1271
|
-
"multi_prompt",
|
|
1272
|
-
"first_frame_image_url",
|
|
1273
|
-
"last_frame_image_url",
|
|
1274
|
-
"kling_elements",
|
|
1275
|
-
"reference_image_urls",
|
|
1276
|
-
"reference_video_url",
|
|
1277
|
-
"reference_video_type",
|
|
1278
|
-
"preserve_reference_video_audio"
|
|
1279
|
-
]
|
|
1280
|
-
},
|
|
1281
|
-
{
|
|
1282
|
-
"when": {
|
|
1283
|
-
"model": "kling-v3-turbo-text-to-video"
|
|
1284
|
-
},
|
|
1285
|
-
"forbidden": [
|
|
1286
|
-
"enable_sound",
|
|
1287
|
-
"negative_prompt",
|
|
1288
|
-
"cfg_scale",
|
|
1289
|
-
"multi_shots",
|
|
1290
|
-
"multi_prompt",
|
|
1291
|
-
"first_frame_image_url",
|
|
1292
|
-
"last_frame_image_url",
|
|
1293
|
-
"kling_elements",
|
|
1294
|
-
"reference_image_urls",
|
|
1295
|
-
"reference_video_url",
|
|
1296
|
-
"reference_video_type",
|
|
1297
|
-
"preserve_reference_video_audio"
|
|
1298
|
-
]
|
|
1299
|
-
}
|
|
1300
|
-
]
|
|
1301
|
-
}
|
|
1302
|
-
};
|
|
1303
|
-
|
|
1304
|
-
// src/resources/o1-reference-validation.ts
|
|
1305
|
-
import { ValidationError } from "@runapi.ai/core";
|
|
1306
|
-
var O1_MODEL = "kling-o1";
|
|
1307
|
-
var IMAGE_EXTENSIONS = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png"]);
|
|
1308
|
-
var VIDEO_EXTENSIONS = /* @__PURE__ */ new Set([".mp4", ".mov"]);
|
|
1309
|
-
var BLOCKED_IP_CIDRS = [
|
|
1310
|
-
"0.0.0.0/8",
|
|
1311
|
-
"10.0.0.0/8",
|
|
1312
|
-
"100.64.0.0/10",
|
|
1313
|
-
"127.0.0.0/8",
|
|
1314
|
-
"169.254.0.0/16",
|
|
1315
|
-
"172.16.0.0/12",
|
|
1316
|
-
"192.0.0.0/24",
|
|
1317
|
-
"192.0.2.0/24",
|
|
1318
|
-
"192.88.99.0/24",
|
|
1319
|
-
"192.168.0.0/16",
|
|
1320
|
-
"198.18.0.0/15",
|
|
1321
|
-
"198.51.100.0/24",
|
|
1322
|
-
"203.0.113.0/24",
|
|
1323
|
-
"224.0.0.0/4",
|
|
1324
|
-
"240.0.0.0/4",
|
|
1325
|
-
"255.255.255.255/32",
|
|
1326
|
-
"::/128",
|
|
1327
|
-
"::1/128",
|
|
1328
|
-
"64:ff9b::/96",
|
|
1329
|
-
"64:ff9b:1::/48",
|
|
1330
|
-
"100::/64",
|
|
1331
|
-
"2001::/32",
|
|
1332
|
-
"2001:2::/48",
|
|
1333
|
-
"2001:db8::/32",
|
|
1334
|
-
"2002::/16",
|
|
1335
|
-
"3fff::/20",
|
|
1336
|
-
"fc00::/7",
|
|
1337
|
-
"fe80::/10",
|
|
1338
|
-
"ff00::/8"
|
|
1339
|
-
];
|
|
1340
|
-
var BLOCKED_IP_NETWORKS = BLOCKED_IP_CIDRS.map((cidr) => {
|
|
1341
|
-
const [address, prefixText] = cidr.split("/");
|
|
1342
|
-
const parsed = parseIpLiteral(address);
|
|
1343
|
-
if (!parsed) throw new Error("Invalid blocked IP range: " + cidr);
|
|
1344
|
-
return { ...parsed, prefix: Number(prefixText) };
|
|
1345
|
-
});
|
|
1346
|
-
function validateKlingO1References(body) {
|
|
1347
|
-
if (body.model !== O1_MODEL) return;
|
|
1348
|
-
if (body.enable_sound === true) {
|
|
1349
|
-
throw new ValidationError(`enable_sound is not supported by ${O1_MODEL}`);
|
|
1350
|
-
}
|
|
1351
|
-
validateFrameUrls(body);
|
|
1352
|
-
if (typeof body.prompt !== "string") {
|
|
1353
|
-
throw new ValidationError("prompt must be a string");
|
|
1354
|
-
}
|
|
1355
|
-
const prompt = body.prompt;
|
|
1356
|
-
const referenceImages = Array.isArray(body.reference_image_urls) ? body.reference_image_urls : [];
|
|
1357
|
-
if ("reference_video_url" in body && typeof body.reference_video_url !== "string") {
|
|
1358
|
-
throw new ValidationError("reference_video_url must be a string");
|
|
1359
|
-
}
|
|
1360
|
-
const referenceVideoUrl = body.reference_video_url;
|
|
1361
|
-
if (present(body.last_frame_image_url) && (referenceImages.length > 0 || present(referenceVideoUrl))) {
|
|
1362
|
-
throw new ValidationError(
|
|
1363
|
-
"last_frame_image_url cannot be combined with reference_image_urls or reference_video_url"
|
|
1364
|
-
);
|
|
1365
|
-
}
|
|
1366
|
-
if (referenceVideoUrl && referenceImages.length > 4) {
|
|
1367
|
-
throw new ValidationError(
|
|
1368
|
-
"reference_image_urls must contain at most 4 items when reference_video_url is present"
|
|
1369
|
-
);
|
|
1370
|
-
}
|
|
1371
|
-
validateReferenceImages(prompt, referenceImages);
|
|
1372
|
-
validateReferenceVideo(body, prompt, referenceVideoUrl);
|
|
1373
|
-
}
|
|
1374
|
-
function validateFrameUrls(body) {
|
|
1375
|
-
for (const field of ["first_frame_image_url", "last_frame_image_url"]) {
|
|
1376
|
-
const value = body[field];
|
|
1377
|
-
if (typeof value !== "string" || value.length === 0) continue;
|
|
1378
|
-
if (!isPublicHttpUrl(value)) {
|
|
1379
|
-
throw new ValidationError(`${field} must be a public HTTP or HTTPS URL`);
|
|
1380
|
-
}
|
|
1381
|
-
if (!IMAGE_EXTENSIONS.has(urlExtension(value))) {
|
|
1382
|
-
throw new ValidationError(`${field} must use a JPG, JPEG, or PNG URL`);
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1386
|
-
function validateReferenceImages(prompt, urls) {
|
|
1387
|
-
urls.forEach((url, index) => {
|
|
1388
|
-
if (typeof url !== "string") {
|
|
1389
|
-
throw new ValidationError(`reference_image_urls[${index}] must be a string`);
|
|
1390
|
-
}
|
|
1391
|
-
if (!isPublicHttpUrl(url)) {
|
|
1392
|
-
throw new ValidationError(
|
|
1393
|
-
`reference_image_urls[${index}] must be a public HTTP or HTTPS URL`
|
|
1394
|
-
);
|
|
1395
|
-
}
|
|
1396
|
-
if (!IMAGE_EXTENSIONS.has(urlExtension(url))) {
|
|
1397
|
-
throw new ValidationError(
|
|
1398
|
-
`reference_image_urls[${index}] must use a JPG, JPEG, or PNG URL`
|
|
1399
|
-
);
|
|
1400
|
-
}
|
|
1401
|
-
const marker = `<<<image_${index + 1}>>>`;
|
|
1402
|
-
if (!prompt.includes(marker)) {
|
|
1403
|
-
throw new ValidationError(
|
|
1404
|
-
`prompt must reference reference_image_urls[${index}] as ${marker}`
|
|
1405
|
-
);
|
|
1406
|
-
}
|
|
1407
|
-
});
|
|
1408
|
-
for (const match of prompt.matchAll(/<<<image_(\d+)>>>/g)) {
|
|
1409
|
-
const index = Number(match[1]);
|
|
1410
|
-
if (index < 1 || index > urls.length) {
|
|
1411
|
-
throw new ValidationError(`prompt references missing image_${index}`);
|
|
1412
|
-
}
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
function validateReferenceVideo(body, prompt, referenceVideoUrl) {
|
|
1416
|
-
if (!referenceVideoUrl) {
|
|
1417
|
-
if ("reference_video_type" in body) {
|
|
1418
|
-
throw new ValidationError("reference_video_type requires reference_video_url");
|
|
1419
|
-
}
|
|
1420
|
-
if ("preserve_reference_video_audio" in body) {
|
|
1421
|
-
throw new ValidationError("preserve_reference_video_audio requires reference_video_url");
|
|
1422
|
-
}
|
|
1423
|
-
const missingMarker = prompt.match(/<<<video_([^>]+)>>>/);
|
|
1424
|
-
if (missingMarker) {
|
|
1425
|
-
throw new ValidationError(`prompt references missing video_${missingMarker[1]}`);
|
|
1426
|
-
}
|
|
1427
|
-
return;
|
|
1428
|
-
}
|
|
1429
|
-
if (!isPublicHttpUrl(referenceVideoUrl)) {
|
|
1430
|
-
throw new ValidationError("reference_video_url must be a public HTTP or HTTPS URL");
|
|
1431
|
-
}
|
|
1432
|
-
if (!VIDEO_EXTENSIONS.has(urlExtension(referenceVideoUrl))) {
|
|
1433
|
-
throw new ValidationError("reference_video_url must use an MP4 or MOV URL");
|
|
1434
|
-
}
|
|
1435
|
-
if (!prompt.includes("<<<video_1>>>")) {
|
|
1436
|
-
throw new ValidationError("prompt must reference reference_video_url as <<<video_1>>>");
|
|
1437
|
-
}
|
|
1438
|
-
for (const match of prompt.matchAll(/<<<video_([^>]+)>>>/g)) {
|
|
1439
|
-
if (match[1] !== "1") {
|
|
1440
|
-
throw new ValidationError("prompt may only reference video_1");
|
|
1441
|
-
}
|
|
1442
|
-
}
|
|
1443
|
-
const referenceVideoType = body.reference_video_type ?? "base";
|
|
1444
|
-
if (referenceVideoType === "base" && (present(body.first_frame_image_url) || present(body.last_frame_image_url))) {
|
|
1445
|
-
throw new ValidationError(
|
|
1446
|
-
"reference_video_type base cannot be combined with first_frame_image_url or last_frame_image_url"
|
|
1447
|
-
);
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
function present(value) {
|
|
1451
|
-
return typeof value === "string" ? value.trim().length > 0 : value !== void 0 && value !== null;
|
|
1452
|
-
}
|
|
1453
|
-
function urlExtension(value) {
|
|
1454
|
-
try {
|
|
1455
|
-
const path = new URL(value).pathname;
|
|
1456
|
-
const dot = path.lastIndexOf(".");
|
|
1457
|
-
return dot >= 0 ? path.slice(dot).toLowerCase() : "";
|
|
1458
|
-
} catch {
|
|
1459
|
-
return "";
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
function isPublicHttpUrl(value) {
|
|
1463
|
-
try {
|
|
1464
|
-
const url = new URL(value);
|
|
1465
|
-
return (url.protocol === "http:" || url.protocol === "https:") && url.hostname.length > 0 && url.username.length === 0 && url.password.length === 0 && !isBlockedHost(url.hostname);
|
|
1466
|
-
} catch {
|
|
1467
|
-
return false;
|
|
1468
|
-
}
|
|
1469
|
-
}
|
|
1470
|
-
function isBlockedHost(hostname) {
|
|
1471
|
-
const host = hostname.toLowerCase().replace(/^\[|\]$/g, "").replace(/\.$/, "");
|
|
1472
|
-
if (host === "localhost" || host.endsWith(".localhost")) return true;
|
|
1473
|
-
const parsed = parseIpLiteral(host);
|
|
1474
|
-
if (!parsed) return false;
|
|
1475
|
-
return BLOCKED_IP_NETWORKS.some((network) => {
|
|
1476
|
-
if (network.bits !== parsed.bits) return false;
|
|
1477
|
-
const shift = BigInt(parsed.bits - network.prefix);
|
|
1478
|
-
return parsed.value >> shift === network.value >> shift;
|
|
1479
|
-
});
|
|
1480
|
-
}
|
|
1481
|
-
function parseIpLiteral(value) {
|
|
1482
|
-
const ipv4 = parseIpv4(value);
|
|
1483
|
-
if (ipv4 !== void 0) return { bits: 32, value: ipv4 };
|
|
1484
|
-
if (!value.includes(":")) return void 0;
|
|
1485
|
-
const halves = value.toLowerCase().split("::");
|
|
1486
|
-
if (halves.length > 2) return void 0;
|
|
1487
|
-
const head = parseIpv6Half(halves[0]);
|
|
1488
|
-
const tail = parseIpv6Half(halves[1] ?? "");
|
|
1489
|
-
if (!head || !tail) return void 0;
|
|
1490
|
-
const compressed = halves.length === 2;
|
|
1491
|
-
const missing = 8 - head.length - tail.length;
|
|
1492
|
-
if (!compressed && missing !== 0 || compressed && missing < 1) return void 0;
|
|
1493
|
-
const segments = [...head, ...Array(missing).fill(0), ...tail];
|
|
1494
|
-
const address = segments.reduce((result, segment) => result << 16n | BigInt(segment), 0n);
|
|
1495
|
-
if (address >> 32n === 0xffffn) {
|
|
1496
|
-
return { bits: 32, value: address & 0xffffffffn };
|
|
1497
|
-
}
|
|
1498
|
-
return { bits: 128, value: address };
|
|
1499
|
-
}
|
|
1500
|
-
function parseIpv4(value) {
|
|
1501
|
-
const parts = value.split(".");
|
|
1502
|
-
if (parts.length !== 4 || parts.some((part) => !/^\d+$/.test(part))) return void 0;
|
|
1503
|
-
const octets = parts.map(Number);
|
|
1504
|
-
if (octets.some((octet) => octet < 0 || octet > 255)) return void 0;
|
|
1505
|
-
return octets.reduce((result, octet) => result << 8n | BigInt(octet), 0n);
|
|
1506
|
-
}
|
|
1507
|
-
function parseIpv6Half(value) {
|
|
1508
|
-
if (value === "") return [];
|
|
1509
|
-
const parts = value.split(":");
|
|
1510
|
-
if (parts.some((part) => !/^[0-9a-f]{1,4}$/.test(part))) return void 0;
|
|
1511
|
-
return parts.map((part) => Number.parseInt(part, 16));
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
// src/resources/text-to-video.ts
|
|
1515
7
|
var ENDPOINT = "/api/v1/kling/text_to_video";
|
|
1516
|
-
var V26_MODEL = "kling-v2.6";
|
|
1517
|
-
var V3_TURBO_MODEL = "kling-v3-turbo-text-to-video";
|
|
1518
|
-
var V3_TURBO_UNSUPPORTED_FIELDS = [
|
|
1519
|
-
"enable_sound",
|
|
1520
|
-
"negative_prompt",
|
|
1521
|
-
"cfg_scale",
|
|
1522
|
-
"multi_shots",
|
|
1523
|
-
"multi_prompt",
|
|
1524
|
-
"first_frame_image_url",
|
|
1525
|
-
"last_frame_image_url",
|
|
1526
|
-
"kling_elements"
|
|
1527
|
-
];
|
|
1528
8
|
var TextToVideo = class {
|
|
1529
9
|
constructor(http) {
|
|
1530
10
|
this.http = http;
|
|
@@ -1552,10 +32,6 @@ var TextToVideo = class {
|
|
|
1552
32
|
*/
|
|
1553
33
|
async create(params, options) {
|
|
1554
34
|
const body = compactParams(params);
|
|
1555
|
-
rejectUnsupportedV3TurboFields(body);
|
|
1556
|
-
validateParams(contract["text-to-video"], body);
|
|
1557
|
-
validateV26Params(body);
|
|
1558
|
-
validateKlingO1References(body);
|
|
1559
35
|
return this.http.request("POST", ENDPOINT, {
|
|
1560
36
|
body,
|
|
1561
37
|
...options
|
|
@@ -1573,48 +49,11 @@ var TextToVideo = class {
|
|
|
1573
49
|
});
|
|
1574
50
|
}
|
|
1575
51
|
};
|
|
1576
|
-
function validateV26Params(body) {
|
|
1577
|
-
if (body.model !== V26_MODEL) return;
|
|
1578
|
-
if (body.enable_sound === true && body.mode !== "pro") {
|
|
1579
|
-
throw new ValidationError2(`enable_sound requires mode pro for ${V26_MODEL}`);
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
function rejectUnsupportedV3TurboFields(body) {
|
|
1583
|
-
if (body.model !== V3_TURBO_MODEL) return;
|
|
1584
|
-
const field = V3_TURBO_UNSUPPORTED_FIELDS.find((candidate) => fieldPresent(body, candidate));
|
|
1585
|
-
if (field) {
|
|
1586
|
-
throw new ValidationError2(`${field} is not supported by ${V3_TURBO_MODEL}`);
|
|
1587
|
-
}
|
|
1588
|
-
}
|
|
1589
|
-
function fieldPresent(params, field) {
|
|
1590
|
-
if (!(field in params)) return false;
|
|
1591
|
-
const value = params[field];
|
|
1592
|
-
if (value === false) return true;
|
|
1593
|
-
if (Array.isArray(value)) return value.some((item) => presentValue(item));
|
|
1594
|
-
return presentValue(value);
|
|
1595
|
-
}
|
|
1596
|
-
function presentValue(value) {
|
|
1597
|
-
if (value === null || value === void 0 || value === false) return false;
|
|
1598
|
-
if (value === true) return true;
|
|
1599
|
-
if (typeof value === "string") return value.trim() !== "";
|
|
1600
|
-
if (Array.isArray(value)) return value.length > 0;
|
|
1601
|
-
if (typeof value === "object") return Object.keys(value).length > 0;
|
|
1602
|
-
return true;
|
|
1603
|
-
}
|
|
1604
52
|
|
|
1605
53
|
// src/resources/image-to-video.ts
|
|
1606
|
-
import {
|
|
54
|
+
import { compactParams as compactParams2 } from "@runapi.ai/core";
|
|
1607
55
|
import { pollUntilComplete as pollUntilComplete2 } from "@runapi.ai/core/internal";
|
|
1608
56
|
var ENDPOINT2 = "/api/v1/kling/image_to_video";
|
|
1609
|
-
var V26_MODEL2 = "kling-v2.6";
|
|
1610
|
-
var V3_OMNI_MODEL = "kling-v3-omni";
|
|
1611
|
-
var V3_TURBO_MODEL2 = "kling-v3-turbo-image-to-video";
|
|
1612
|
-
var V3_TURBO_UNSUPPORTED_FIELDS2 = [
|
|
1613
|
-
"aspect_ratio",
|
|
1614
|
-
"negative_prompt",
|
|
1615
|
-
"cfg_scale",
|
|
1616
|
-
"last_frame_image_url"
|
|
1617
|
-
];
|
|
1618
57
|
var ImageToVideo = class {
|
|
1619
58
|
constructor(http) {
|
|
1620
59
|
this.http = http;
|
|
@@ -1642,11 +81,6 @@ var ImageToVideo = class {
|
|
|
1642
81
|
*/
|
|
1643
82
|
async create(params, options) {
|
|
1644
83
|
const body = compactParams2(params);
|
|
1645
|
-
rejectUnsupportedV3TurboFields2(body);
|
|
1646
|
-
validateParams2(contract["image-to-video"], body);
|
|
1647
|
-
validateV26Params2(body);
|
|
1648
|
-
validateV3OmniFields(body);
|
|
1649
|
-
validateKlingO1References(body);
|
|
1650
84
|
return this.http.request("POST", ENDPOINT2, {
|
|
1651
85
|
body,
|
|
1652
86
|
...options
|
|
@@ -1664,50 +98,9 @@ var ImageToVideo = class {
|
|
|
1664
98
|
});
|
|
1665
99
|
}
|
|
1666
100
|
};
|
|
1667
|
-
function validateV26Params2(body) {
|
|
1668
|
-
if (body.model !== V26_MODEL2) return;
|
|
1669
|
-
if (body.enable_sound === true && body.mode !== "pro") {
|
|
1670
|
-
throw new ValidationError3(`enable_sound requires mode pro for ${V26_MODEL2}`);
|
|
1671
|
-
}
|
|
1672
|
-
if (!fieldPresent2(body, "last_frame_image_url")) return;
|
|
1673
|
-
if (body.mode !== "pro") {
|
|
1674
|
-
throw new ValidationError3(`last_frame_image_url requires mode pro for ${V26_MODEL2}`);
|
|
1675
|
-
}
|
|
1676
|
-
if (body.duration_seconds !== void 0 && body.duration_seconds !== 5) {
|
|
1677
|
-
throw new ValidationError3(`last_frame_image_url requires duration_seconds 5 for ${V26_MODEL2}`);
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
function validateV3OmniFields(body) {
|
|
1681
|
-
if (body.model !== V3_OMNI_MODEL || !fieldPresent2(body, "last_frame_image_url")) return;
|
|
1682
|
-
if ((body.duration_seconds ?? 5) !== 5) {
|
|
1683
|
-
throw new ValidationError3(`last_frame_image_url requires duration_seconds 5 for ${V3_OMNI_MODEL}`);
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
function rejectUnsupportedV3TurboFields2(body) {
|
|
1687
|
-
if (body.model !== V3_TURBO_MODEL2) return;
|
|
1688
|
-
const field = V3_TURBO_UNSUPPORTED_FIELDS2.find((candidate) => fieldPresent2(body, candidate));
|
|
1689
|
-
if (field) {
|
|
1690
|
-
throw new ValidationError3(`${field} is not supported by ${V3_TURBO_MODEL2}`);
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
function fieldPresent2(params, field) {
|
|
1694
|
-
if (!(field in params)) return false;
|
|
1695
|
-
const value = params[field];
|
|
1696
|
-
if (value === false) return true;
|
|
1697
|
-
if (Array.isArray(value)) return value.some((item) => presentValue2(item));
|
|
1698
|
-
return presentValue2(value);
|
|
1699
|
-
}
|
|
1700
|
-
function presentValue2(value) {
|
|
1701
|
-
if (value === null || value === void 0 || value === false) return false;
|
|
1702
|
-
if (value === true) return true;
|
|
1703
|
-
if (typeof value === "string") return value.trim() !== "";
|
|
1704
|
-
if (Array.isArray(value)) return value.length > 0;
|
|
1705
|
-
if (typeof value === "object") return Object.keys(value).length > 0;
|
|
1706
|
-
return true;
|
|
1707
|
-
}
|
|
1708
101
|
|
|
1709
102
|
// src/resources/ai-avatar.ts
|
|
1710
|
-
import { compactParams as compactParams3
|
|
103
|
+
import { compactParams as compactParams3 } from "@runapi.ai/core";
|
|
1711
104
|
import { pollUntilComplete as pollUntilComplete3 } from "@runapi.ai/core/internal";
|
|
1712
105
|
var ENDPOINT3 = "/api/v1/kling/ai_avatar";
|
|
1713
106
|
var AiAvatar = class {
|
|
@@ -1737,7 +130,6 @@ var AiAvatar = class {
|
|
|
1737
130
|
*/
|
|
1738
131
|
async create(params, options) {
|
|
1739
132
|
const body = compactParams3(params);
|
|
1740
|
-
validateParams3(contract["avatar"], body);
|
|
1741
133
|
return this.http.request("POST", ENDPOINT3, {
|
|
1742
134
|
body,
|
|
1743
135
|
...options
|
|
@@ -1757,7 +149,7 @@ var AiAvatar = class {
|
|
|
1757
149
|
};
|
|
1758
150
|
|
|
1759
151
|
// src/resources/motion-control.ts
|
|
1760
|
-
import { compactParams as compactParams4
|
|
152
|
+
import { compactParams as compactParams4 } from "@runapi.ai/core";
|
|
1761
153
|
import { pollUntilComplete as pollUntilComplete4 } from "@runapi.ai/core/internal";
|
|
1762
154
|
var ENDPOINT4 = "/api/v1/kling/motion_control";
|
|
1763
155
|
var MotionControl = class {
|
|
@@ -1787,7 +179,6 @@ var MotionControl = class {
|
|
|
1787
179
|
*/
|
|
1788
180
|
async create(params, options) {
|
|
1789
181
|
const body = compactParams4(params);
|
|
1790
|
-
validateParams4(contract["motion-control"], body);
|
|
1791
182
|
return this.http.request("POST", ENDPOINT4, {
|
|
1792
183
|
body,
|
|
1793
184
|
...options
|
|
@@ -1807,7 +198,7 @@ var MotionControl = class {
|
|
|
1807
198
|
};
|
|
1808
199
|
|
|
1809
200
|
// src/resources/extend-video.ts
|
|
1810
|
-
import { compactParams as compactParams5
|
|
201
|
+
import { compactParams as compactParams5 } from "@runapi.ai/core";
|
|
1811
202
|
import { pollUntilComplete as pollUntilComplete5 } from "@runapi.ai/core/internal";
|
|
1812
203
|
var ENDPOINT5 = "/api/v1/kling/extend_video";
|
|
1813
204
|
var ExtendVideo = class {
|
|
@@ -1824,7 +215,6 @@ var ExtendVideo = class {
|
|
|
1824
215
|
}
|
|
1825
216
|
async create(params, options) {
|
|
1826
217
|
const body = compactParams5(params);
|
|
1827
|
-
validateParams5(contract["extend-video"], body);
|
|
1828
218
|
return this.http.request("POST", ENDPOINT5, { body, ...options });
|
|
1829
219
|
}
|
|
1830
220
|
async get(id, options) {
|
|
@@ -1833,7 +223,7 @@ var ExtendVideo = class {
|
|
|
1833
223
|
};
|
|
1834
224
|
|
|
1835
225
|
// src/resources/edit-video.ts
|
|
1836
|
-
import { compactParams as compactParams6
|
|
226
|
+
import { compactParams as compactParams6 } from "@runapi.ai/core";
|
|
1837
227
|
import { pollUntilComplete as pollUntilComplete6 } from "@runapi.ai/core/internal";
|
|
1838
228
|
var ENDPOINT6 = "/api/v1/kling/edit_video";
|
|
1839
229
|
var EditVideo = class {
|
|
@@ -1850,7 +240,6 @@ var EditVideo = class {
|
|
|
1850
240
|
}
|
|
1851
241
|
async create(params, options) {
|
|
1852
242
|
const body = compactParams6(params);
|
|
1853
|
-
validateParams6(contract["edit-video"], body);
|
|
1854
243
|
return this.http.request("POST", ENDPOINT6, { body, ...options });
|
|
1855
244
|
}
|
|
1856
245
|
async get(id, options) {
|
|
@@ -1888,7 +277,7 @@ import {
|
|
|
1888
277
|
AuthenticationError,
|
|
1889
278
|
InsufficientCreditsError,
|
|
1890
279
|
NotFoundError,
|
|
1891
|
-
ValidationError
|
|
280
|
+
ValidationError,
|
|
1892
281
|
RateLimitError,
|
|
1893
282
|
ServiceUnavailableError,
|
|
1894
283
|
NetworkError,
|
|
@@ -1908,6 +297,6 @@ export {
|
|
|
1908
297
|
TaskFailedError,
|
|
1909
298
|
TaskTimeoutError,
|
|
1910
299
|
TimeoutError,
|
|
1911
|
-
|
|
300
|
+
ValidationError
|
|
1912
301
|
};
|
|
1913
302
|
//# sourceMappingURL=index.mjs.map
|