runapi-kling 0.3.5 → 0.4.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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2a748b5cc9170e92d4df37d437bf1a710be9cf5365fad3feff5ff6e33864b431
|
|
4
|
+
data.tar.gz: 13111124fda673639366a861a8cc462f33b87d109290e0f9a72c6c83d51a136c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4eab84e87121ff70aba5816b318f13da73191e25c1098fc0d03ad51bbe59646c08681fb694734d813a9110ecd71ed914cb454ab1fe2882e07e152981ed5688ba
|
|
7
|
+
data.tar.gz: 9c6ead94e0d1918904c6b2bd0aa5f75dfa37ccea1839a944c560f2ca50a63cb69b12ef8489f9af51587b6770d0f60635a6c86fc9e7e9ac988e43d4be5a6ca141
|
|
@@ -119,17 +119,6 @@ module RunApi
|
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
"rules" => [{
|
|
122
|
-
"when" => {
|
|
123
|
-
"model" => "kling-v3-omni-edit",
|
|
124
|
-
"source_task_id" => {
|
|
125
|
-
"present" => false
|
|
126
|
-
},
|
|
127
|
-
"source_video_url" => {
|
|
128
|
-
"present" => false
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
"required_any" => ["source_video_url", "source_task_id"]
|
|
132
|
-
}, {
|
|
133
122
|
"when" => {
|
|
134
123
|
"model" => "kling-v3-omni-edit",
|
|
135
124
|
"source_video_url" => {
|
|
@@ -203,6 +192,32 @@ module RunApi
|
|
|
203
192
|
}
|
|
204
193
|
},
|
|
205
194
|
"required" => ["aspect_ratio"]
|
|
195
|
+
}, {
|
|
196
|
+
"when" => {
|
|
197
|
+
"model" => "kling-v3-omni-edit",
|
|
198
|
+
"source_task_id" => {
|
|
199
|
+
"present" => false
|
|
200
|
+
},
|
|
201
|
+
"source_video_url" => {
|
|
202
|
+
"present" => false
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"required_any" => ["source_video_url", "source_task_id"]
|
|
206
|
+
}, {
|
|
207
|
+
"enum" => {
|
|
208
|
+
"aspect_ratio" => ["16:9", "9:16", "1:1"],
|
|
209
|
+
"enable_sound" => [false]
|
|
210
|
+
},
|
|
211
|
+
"when" => {
|
|
212
|
+
"model" => "kling-v3-omni-reference",
|
|
213
|
+
"source_task_id" => {
|
|
214
|
+
"present" => true
|
|
215
|
+
},
|
|
216
|
+
"reference_image_urls" => {
|
|
217
|
+
"present" => true
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"required" => ["aspect_ratio"]
|
|
206
221
|
}, {
|
|
207
222
|
"when" => {
|
|
208
223
|
"model" => "kling-v3-omni-reference",
|
|
@@ -277,21 +292,6 @@ module RunApi
|
|
|
277
292
|
}
|
|
278
293
|
},
|
|
279
294
|
"required" => ["aspect_ratio"]
|
|
280
|
-
}, {
|
|
281
|
-
"enum" => {
|
|
282
|
-
"aspect_ratio" => ["16:9", "9:16", "1:1"],
|
|
283
|
-
"enable_sound" => [false]
|
|
284
|
-
},
|
|
285
|
-
"when" => {
|
|
286
|
-
"model" => "kling-v3-omni-reference",
|
|
287
|
-
"source_task_id" => {
|
|
288
|
-
"present" => true
|
|
289
|
-
},
|
|
290
|
-
"reference_image_urls" => {
|
|
291
|
-
"present" => true
|
|
292
|
-
}
|
|
293
|
-
},
|
|
294
|
-
"required" => ["aspect_ratio"]
|
|
295
295
|
}]
|
|
296
296
|
},
|
|
297
297
|
"extend-video" => {
|
|
@@ -504,11 +504,29 @@ module RunApi
|
|
|
504
504
|
"model" => "kling-v2.5-turbo-image-to-video-pro"
|
|
505
505
|
},
|
|
506
506
|
"forbidden" => ["output_resolution", "enable_sound", "reference_image_urls", "reference_video_url", "reference_video_type", "preserve_reference_video_audio"]
|
|
507
|
+
}, {
|
|
508
|
+
"enum" => {
|
|
509
|
+
"enable_sound" => [false]
|
|
510
|
+
},
|
|
511
|
+
"when" => {
|
|
512
|
+
"mode" => "std",
|
|
513
|
+
"model" => "kling-v2.6"
|
|
514
|
+
}
|
|
507
515
|
}, {
|
|
508
516
|
"when" => {
|
|
509
517
|
"model" => "kling-v2.6"
|
|
510
518
|
},
|
|
511
519
|
"forbidden" => ["output_resolution", "negative_prompt", "cfg_scale", "reference_image_urls", "reference_video_url", "reference_video_type", "preserve_reference_video_audio"]
|
|
520
|
+
}, {
|
|
521
|
+
"enum" => {
|
|
522
|
+
"enable_sound" => [false]
|
|
523
|
+
},
|
|
524
|
+
"when" => {
|
|
525
|
+
"mode" => {
|
|
526
|
+
"present" => false
|
|
527
|
+
},
|
|
528
|
+
"model" => "kling-v2.6"
|
|
529
|
+
}
|
|
512
530
|
}, {
|
|
513
531
|
"when" => {
|
|
514
532
|
"model" => "kling-v3-omni"
|
|
@@ -535,7 +553,8 @@ module RunApi
|
|
|
535
553
|
"required" => true
|
|
536
554
|
},
|
|
537
555
|
"output_resolution" => {
|
|
538
|
-
"enum" => ["720p", "1080p"]
|
|
556
|
+
"enum" => ["720p", "1080p"],
|
|
557
|
+
"required" => true
|
|
539
558
|
},
|
|
540
559
|
"reference_video_url" => {
|
|
541
560
|
"required" => true
|
|
@@ -761,6 +780,24 @@ module RunApi
|
|
|
761
780
|
"model" => "kling-v2.6"
|
|
762
781
|
},
|
|
763
782
|
"forbidden" => ["output_resolution", "negative_prompt", "cfg_scale", "multi_shots", "multi_prompt", "first_frame_image_url", "last_frame_image_url", "kling_elements", "reference_image_urls", "reference_video_url", "reference_video_type", "preserve_reference_video_audio"]
|
|
783
|
+
}, {
|
|
784
|
+
"enum" => {
|
|
785
|
+
"enable_sound" => [false]
|
|
786
|
+
},
|
|
787
|
+
"when" => {
|
|
788
|
+
"mode" => "std",
|
|
789
|
+
"model" => "kling-v2.6"
|
|
790
|
+
}
|
|
791
|
+
}, {
|
|
792
|
+
"enum" => {
|
|
793
|
+
"enable_sound" => [false]
|
|
794
|
+
},
|
|
795
|
+
"when" => {
|
|
796
|
+
"mode" => {
|
|
797
|
+
"present" => false
|
|
798
|
+
},
|
|
799
|
+
"model" => "kling-v2.6"
|
|
800
|
+
}
|
|
764
801
|
}, {
|
|
765
802
|
"when" => {
|
|
766
803
|
"model" => "kling-v3-omni"
|
|
@@ -77,12 +77,10 @@ module RunApi
|
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
def validate_v26_params!(params, last_frame_image_url)
|
|
80
|
-
mode = param(params, :mode) || "std"
|
|
81
|
-
if param(params, :enable_sound) == true && mode != "pro"
|
|
82
|
-
raise Core::ValidationError, "enable_sound requires mode pro for #{V26_MODEL}"
|
|
83
|
-
end
|
|
84
80
|
return unless last_frame_image_url
|
|
85
81
|
|
|
82
|
+
mode = param(params, :mode) || "std"
|
|
83
|
+
|
|
86
84
|
raise Core::ValidationError, "last_frame_image_url requires mode pro for #{V26_MODEL}" unless mode == "pro"
|
|
87
85
|
|
|
88
86
|
duration_seconds = param(params, :duration_seconds) || 5
|
|
@@ -13,7 +13,6 @@ module RunApi
|
|
|
13
13
|
|
|
14
14
|
RESPONSE_CLASS = Types::TextToVideoResponse
|
|
15
15
|
COMPLETED_RESPONSE_CLASS = Types::CompletedTextToVideoResponse
|
|
16
|
-
V26_MODEL = "kling-v2.6"
|
|
17
16
|
V3_TURBO_MODEL = "kling-v3-turbo-text-to-video"
|
|
18
17
|
V3_TURBO_UNSUPPORTED_FIELDS = %i[
|
|
19
18
|
enable_sound
|
|
@@ -62,7 +61,6 @@ module RunApi
|
|
|
62
61
|
def validate_params!(params)
|
|
63
62
|
reject_unsupported_v3_turbo_fields!(params)
|
|
64
63
|
validate_contract!(CONTRACT["text-to-video"], params)
|
|
65
|
-
validate_v26_params!(params)
|
|
66
64
|
validate_kling_o1_references!(params)
|
|
67
65
|
|
|
68
66
|
# Bespoke cross-field rules the contract cannot express.
|
|
@@ -79,13 +77,6 @@ module RunApi
|
|
|
79
77
|
end
|
|
80
78
|
end
|
|
81
79
|
|
|
82
|
-
def validate_v26_params!(params)
|
|
83
|
-
return unless param(params, :model) == V26_MODEL
|
|
84
|
-
return unless param(params, :enable_sound) == true && param(params, :mode) != "pro"
|
|
85
|
-
|
|
86
|
-
raise Core::ValidationError, "enable_sound requires mode pro for #{V26_MODEL}"
|
|
87
|
-
end
|
|
88
|
-
|
|
89
80
|
def reject_unsupported_v3_turbo_fields!(params)
|
|
90
81
|
return unless param(params, :model) == V3_TURBO_MODEL
|
|
91
82
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: runapi-kling
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- RunAPI
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.5.
|
|
18
|
+
version: 0.5.2
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.5.
|
|
25
|
+
version: 0.5.2
|
|
26
26
|
description: The Kling Ruby SDK is the language-specific package for Kling on RunAPI.
|
|
27
27
|
Use this package for video generation, animation, and video editing workflows when
|
|
28
28
|
your application needs request bodies, task status lookup, and consistent RunAPI
|