@shop-os/modelkit 0.16.0 → 0.17.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/CHANGELOG.md +8 -0
- package/dist/catalog.cjs +90 -1
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.js +90 -1
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +118 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +118 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,14 @@ header in the release PR.
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
+
## [0.17.0] - Unreleased
|
|
13
|
+
|
|
14
|
+
Kling 4.0 Flash on fal (ENG-3743).
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- `kling-4.0-flash` (`kling/v4/flash`, aliases `kling-4-flash`, `kling-v4-flash`): routed like `kling-4.0` to `kling/v4/flash/{text,image,reference}-to-video` by its inputs. 720p only, 3-20 s (presets 5, 10, 15, 20). image-to-video takes a start frame and no end frame: the row does not support `lastFrame`, so the resolver drops one with an `option_ignored` warning and the planner refuses it; its prompt is optional there. Reference-to-video takes up to 10 images (the start frame included) and 5 videos of 3-20.05 s each, 20 s combined. Prompts up to 26,000 characters. No sound field.
|
|
18
|
+
- `kling-4.0-flash-edit` (`kling/v4/flash/video-to-video`, aliases `kling-4-flash-edit`, `kling-v4-flash-edit`): a 3-20.05 s source at 720p with up to 10 reference images and 4 reference videos (`video_urls`, which the Kling 4.0 edit does not take); the source and reference videos total 20 s at most (`sourceVideoSeconds.inReferenceTotal`). No duration renders and bills the source's length; a set 3-20 s bills that.
|
|
19
|
+
|
|
12
20
|
## [0.16.0] - Unreleased
|
|
13
21
|
|
|
14
22
|
Customer provider keys per call (BYOK, ENG-3403).
|
package/dist/catalog.cjs
CHANGED
|
@@ -5149,6 +5149,7 @@ var KLING_PROMPT = { referenceSyntax: "numbered", maxChars: 2500 };
|
|
|
5149
5149
|
var H3_PROMPT = { referenceSyntax: "numbered", maxChars: 5e4 };
|
|
5150
5150
|
var KLING_V4_PROMPT = { referenceSyntax: "numbered", maxChars: 2500 };
|
|
5151
5151
|
var KLING_V4_AUDIO = "always";
|
|
5152
|
+
var KLING_V4_FLASH_PROMPT = { referenceSyntax: "numbered", maxChars: 26e3 };
|
|
5152
5153
|
var NO_REFERENCES = { images: 0, videos: 0, audios: 0 };
|
|
5153
5154
|
function klingMotionControl(tier) {
|
|
5154
5155
|
const label = tier === "pro" ? "Pro" : "Standard";
|
|
@@ -5326,6 +5327,85 @@ var VIDEO_FAMILY_MODELS = [
|
|
|
5326
5327
|
},
|
|
5327
5328
|
capabilities: { acceptsSourceVideo: true, videoEdit: true }
|
|
5328
5329
|
},
|
|
5330
|
+
{
|
|
5331
|
+
// https://fal.ai/models/kling/v4/flash/reference-to-video/api (+ /text-to-video,
|
|
5332
|
+
// /image-to-video): routed like kling-4.0, at 720p only and 3-20 s. image-to-video takes
|
|
5333
|
+
// a start frame (300 px min, ratio 0.40-2.50) and no end frame; its prompt is optional.
|
|
5334
|
+
// Reference images: 10, the start frame included. Reference videos: 5, 3-20.05 s each
|
|
5335
|
+
// and 20 s combined, 700 px min. Prompts up to 26,000 characters. No sound switch.
|
|
5336
|
+
id: "kling-4.0-flash",
|
|
5337
|
+
aliases: ["kling-4-flash", "kling-v4-flash"],
|
|
5338
|
+
label: "Kling 4.0 Flash",
|
|
5339
|
+
type: "video",
|
|
5340
|
+
adapter: "fal",
|
|
5341
|
+
providerModelId: "kling/v4/flash",
|
|
5342
|
+
lifecycle: "active",
|
|
5343
|
+
exposure: ["cowork", "space_builder"],
|
|
5344
|
+
constraints: {
|
|
5345
|
+
aspectRatios: ["adaptive", "16:9", "9:16", "1:1", "21:9"],
|
|
5346
|
+
resolutions: ["720p"],
|
|
5347
|
+
durations: { min: 3, max: 20 },
|
|
5348
|
+
durationPresets: [5, 10, 15, 20],
|
|
5349
|
+
references: {
|
|
5350
|
+
...NO_REFERENCES,
|
|
5351
|
+
images: 10,
|
|
5352
|
+
videos: 5,
|
|
5353
|
+
videoSeconds: { min: 3, max: 20.05, total: 20 },
|
|
5354
|
+
videoPixels: { minWidth: 700, minHeight: 700 }
|
|
5355
|
+
},
|
|
5356
|
+
supports: [],
|
|
5357
|
+
prompt: KLING_V4_FLASH_PROMPT,
|
|
5358
|
+
audio: KLING_V4_AUDIO
|
|
5359
|
+
},
|
|
5360
|
+
defaults: { durationSeconds: 5, resolution: "720p", aspectRatio: "16:9" },
|
|
5361
|
+
usage: { ...VIDEO_USAGE },
|
|
5362
|
+
pricingKind: "video_per_second",
|
|
5363
|
+
display: {
|
|
5364
|
+
provider: "kuaishou",
|
|
5365
|
+
logo: KLING_LOGO,
|
|
5366
|
+
description: "Kuaishou Kling 4.0 Flash: fast text-to-video, a start frame, or reference-to-video from up to 10 images and 5 videos (20 seconds combined), 3 to 20 seconds at 720p. Prompts name references @Image1, @Video1."
|
|
5367
|
+
}
|
|
5368
|
+
},
|
|
5369
|
+
{
|
|
5370
|
+
// https://fal.ai/models/kling/v4/flash/video-to-video/api: source 3-20.05 s (700 px
|
|
5371
|
+
// min, 23.9-60.05 fps), up to 10 reference images and 4 reference videos; the source
|
|
5372
|
+
// and reference videos total 20 s at most. duration 3-20, or left out for the source's
|
|
5373
|
+
// length. The prompt names the source @Video1, reference videos @Video2 on, images @Image1.
|
|
5374
|
+
id: "kling-4.0-flash-edit",
|
|
5375
|
+
aliases: ["kling-4-flash-edit", "kling-v4-flash-edit"],
|
|
5376
|
+
label: "Kling 4.0 Flash Edit",
|
|
5377
|
+
type: "video",
|
|
5378
|
+
adapter: "fal",
|
|
5379
|
+
providerModelId: "kling/v4/flash/video-to-video",
|
|
5380
|
+
lifecycle: "active",
|
|
5381
|
+
exposure: ["cowork", "space_builder"],
|
|
5382
|
+
constraints: {
|
|
5383
|
+
resolutions: ["720p"],
|
|
5384
|
+
durations: { min: 3, max: 20 },
|
|
5385
|
+
references: {
|
|
5386
|
+
...NO_REFERENCES,
|
|
5387
|
+
images: 10,
|
|
5388
|
+
videos: 4,
|
|
5389
|
+
videoSeconds: { min: 3, max: 20.05, total: 20 },
|
|
5390
|
+
videoPixels: { minWidth: 700, minHeight: 700 }
|
|
5391
|
+
},
|
|
5392
|
+
requires: ["sourceVideo"],
|
|
5393
|
+
sourceVideoSeconds: { min: 3, max: 20.05, inReferenceTotal: true },
|
|
5394
|
+
sourceVideoPixels: { minWidth: 700, minHeight: 700 },
|
|
5395
|
+
supports: [],
|
|
5396
|
+
prompt: KLING_V4_FLASH_PROMPT,
|
|
5397
|
+
audio: KLING_V4_AUDIO
|
|
5398
|
+
},
|
|
5399
|
+
defaults: { resolution: "720p" },
|
|
5400
|
+
usage: { ...VIDEO_USAGE },
|
|
5401
|
+
pricingKind: "video_per_second",
|
|
5402
|
+
display: {
|
|
5403
|
+
provider: "kuaishou",
|
|
5404
|
+
logo: KLING_LOGO,
|
|
5405
|
+
description: "Kuaishou Kling 4.0 Flash video edit: change a 3-20 second clip with a prompt, up to 10 reference images and 4 reference videos (20 seconds in all with the source), at 720p, as long as the source or a set 3-20 seconds. Prompts name the source @Video1."
|
|
5406
|
+
},
|
|
5407
|
+
capabilities: { acceptsSourceVideo: true, videoEdit: true }
|
|
5408
|
+
},
|
|
5329
5409
|
{
|
|
5330
5410
|
// https://fal.ai/models/minimax/h3-max-turbo/text-to-video/api (+ /image-to-video).
|
|
5331
5411
|
// image-to-video takes a start frame, an end frame, or both, and no aspect_ratio.
|
|
@@ -9085,6 +9165,8 @@ var O3_REFERENCE = "fal-ai/kling-video/o3/pro/reference-to-video";
|
|
|
9085
9165
|
var O3_EDIT = "fal-ai/kling-video/o3/pro/video-to-video/edit";
|
|
9086
9166
|
var KLING_V4 = "kling/v4";
|
|
9087
9167
|
var KLING_V4_EDIT = "kling/v4/video-to-video/edit";
|
|
9168
|
+
var KLING_V4_FLASH = "kling/v4/flash";
|
|
9169
|
+
var KLING_V4_FLASH_EDIT = "kling/v4/flash/video-to-video";
|
|
9088
9170
|
var H3_TURBO = "minimax/h3-max-turbo";
|
|
9089
9171
|
var H3_RECAST = "minimax/h3-max/recast";
|
|
9090
9172
|
var H3_RELIGHT = "minimax/h3-max/relight";
|
|
@@ -9166,6 +9248,11 @@ function klingV4(req) {
|
|
|
9166
9248
|
}
|
|
9167
9249
|
return needsPrompt(req);
|
|
9168
9250
|
}
|
|
9251
|
+
function klingV4Flash(req) {
|
|
9252
|
+
if (req.lastFrame !== void 0) return unsupported2("takes no end frame");
|
|
9253
|
+
if (!hasReferences(req) && req.firstFrame !== void 0) return void 0;
|
|
9254
|
+
return klingV4(req);
|
|
9255
|
+
}
|
|
9169
9256
|
function h3Turbo(req) {
|
|
9170
9257
|
if (count(req.referenceImages) + count(req.referenceVideos) > 0) {
|
|
9171
9258
|
return unsupported2("takes no reference images or videos");
|
|
@@ -9246,6 +9333,8 @@ var RULES = /* @__PURE__ */ new Map([
|
|
|
9246
9333
|
[O3_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
|
|
9247
9334
|
[KLING_V4, klingV4],
|
|
9248
9335
|
[KLING_V4_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
|
|
9336
|
+
[KLING_V4_FLASH, klingV4Flash],
|
|
9337
|
+
[KLING_V4_FLASH_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
|
|
9249
9338
|
[H3_TURBO, h3Turbo],
|
|
9250
9339
|
[MINIMAX_H3_INSERT, h3Insert],
|
|
9251
9340
|
[H3_RECAST, h3Recast],
|
|
@@ -9295,7 +9384,7 @@ function applyFalVideoRules(model, req, callerRatio, warnings) {
|
|
|
9295
9384
|
warnings.push(viduSilentWarning(model));
|
|
9296
9385
|
req.generateAudio = false;
|
|
9297
9386
|
}
|
|
9298
|
-
if (id === KLING_V4 && req.firstFrame !== void 0 && !hasReferences(req)) {
|
|
9387
|
+
if ((id === KLING_V4 || id === KLING_V4_FLASH) && req.firstFrame !== void 0 && !hasReferences(req)) {
|
|
9299
9388
|
if (req.aspectRatio !== void 0) {
|
|
9300
9389
|
if (callerRatio !== void 0) {
|
|
9301
9390
|
warnings.push({
|