@shop-os/modelkit 0.27.0 → 0.28.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 CHANGED
@@ -9,6 +9,22 @@ header in the release PR.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.28.0] - Unreleased
13
+
14
+ ### Added
15
+ - `kling-4.0` and `kling-4.0-edit` list `4k` in `constraints.resolutions` (fal `kling/v4`,
16
+ `resolution: "4k"` on text-, image- and reference-to-video and on the edit, 2026-11-19). The
17
+ default stays 1080p. 4K renders at most 15 s for now (the resolver refuses longer, and an
18
+ edit at 4K needs a measured source): a 3 s 4K clip took 138 s, so a 30 s one may outrun the
19
+ 15-minute result wait while fal still bills it. fal bills 4K at $0.549 per output second, or $0.329 per billable second
20
+ with a video input, so a consumer needs a `4k` price row for both rows before it takes this
21
+ version. The endpoints' new `hdr` flag is not sent: no request field or price shape carries
22
+ its per-output-second fee yet.
23
+
24
+ ### Changed
25
+ - The saved fal schemas for the four `kling/v4` endpoints are refreshed, so the row tests check
26
+ every body against the schema that lists `4k`.
27
+
12
28
  ## [0.27.0] - Unreleased
13
29
 
14
30
  ### Added
package/dist/catalog.cjs CHANGED
@@ -5753,7 +5753,9 @@ var VIDEO_FAMILY_MODELS = [
5753
5753
  // start frame included (fal: "counts toward the image reference limit"), 300 px min.
5754
5754
  // Reference videos: 5, 3-30.05 s each and 30 s combined, 700 px min, 23.9-60.05 fps.
5755
5755
  // The prompt names references as @Image1, @Video1 (no space; @Element1 for elements,
5756
- // which the kit does not send). No sound switch on any endpoint.
5756
+ // which the kit does not send). No sound switch on any endpoint. 4K since 2026-11-19;
5757
+ // the endpoints also take `hdr` (10-bit, 1080p and 4K, billed per output second on top),
5758
+ // which the kit does not send: no price row can carry that fee yet (ENG-4272).
5757
5759
  id: "kling-4.0",
5758
5760
  aliases: ["kling-4", "kling-v4"],
5759
5761
  label: "Kling 4.0",
@@ -5765,7 +5767,7 @@ var VIDEO_FAMILY_MODELS = [
5765
5767
  constraints: {
5766
5768
  inputBilling: "kling-v4",
5767
5769
  aspectRatios: ["adaptive", "16:9", "9:16", "1:1", "21:9"],
5768
- resolutions: ["720p", "1080p"],
5770
+ resolutions: ["720p", "1080p", "4k"],
5769
5771
  durations: { min: 3, max: 30 },
5770
5772
  durationPresets: [5, 10, 15, 30],
5771
5773
  references: {
@@ -5786,7 +5788,7 @@ var VIDEO_FAMILY_MODELS = [
5786
5788
  display: {
5787
5789
  provider: "kuaishou",
5788
5790
  logo: KLING_LOGO2,
5789
- description: "Kuaishou Kling 4.0: text-to-video, start/end frames, or reference-to-video from up to 10 images and 5 videos (30 seconds combined), up to 30 seconds at 720p or 1080p. Prompts name references @Image1, @Video1."
5791
+ description: "Kuaishou Kling 4.0: text-to-video, start/end frames, or reference-to-video from up to 10 images and 5 videos (30 seconds combined), up to 30 seconds at 720p or 1080p and up to 15 seconds at 4K. Prompts name references @Image1, @Video1."
5790
5792
  },
5791
5793
  capabilities: { lastFrameRequiresFirstFrame: true }
5792
5794
  },
@@ -5804,7 +5806,7 @@ var VIDEO_FAMILY_MODELS = [
5804
5806
  exposure: ["cowork", "space_builder"],
5805
5807
  constraints: {
5806
5808
  inputBilling: "kling-v4",
5807
- resolutions: ["720p", "1080p"],
5809
+ resolutions: ["720p", "1080p", "4k"],
5808
5810
  durations: { min: 3, max: 30 },
5809
5811
  references: { ...NO_REFERENCES, images: 10 },
5810
5812
  requires: ["sourceVideo"],
@@ -5820,7 +5822,7 @@ var VIDEO_FAMILY_MODELS = [
5820
5822
  display: {
5821
5823
  provider: "kuaishou",
5822
5824
  logo: KLING_LOGO2,
5823
- description: "Kuaishou Kling 4.0 video edit: change a 3-30 second clip with a prompt and up to 10 reference images, at 720p or 1080p, as long as the source or a set 3-30 seconds. Prompts name the source @Video1 and images @Image1."
5825
+ description: "Kuaishou Kling 4.0 video edit: change a 3-30 second clip with a prompt and up to 10 reference images, at 720p, 1080p or 4K (up to 15 seconds at 4K), as long as the source or a set 3-30 seconds. Prompts name the source @Video1 and images @Image1."
5824
5826
  },
5825
5827
  capabilities: { acceptsSourceVideo: true, videoEdit: true }
5826
5828
  },
@@ -10152,7 +10154,17 @@ function o3Reference(req) {
10152
10154
  function hasReferences(req) {
10153
10155
  return count(req.referenceImages) + count(req.referenceVideos) > 0;
10154
10156
  }
10157
+ var KLING_V4_4K_MAX_SECONDS = 15;
10158
+ function klingV4FourK(seconds3, req) {
10159
+ if (req.resolution !== "4k") return void 0;
10160
+ if (seconds3 === void 0) {
10161
+ return missing(`needs a measured source video of up to ${KLING_V4_4K_MAX_SECONDS} s at 4K`);
10162
+ }
10163
+ return seconds3 > KLING_V4_4K_MAX_SECONDS ? unsupported2(`renders at most ${KLING_V4_4K_MAX_SECONDS} s at 4K`) : void 0;
10164
+ }
10155
10165
  function klingV4(req) {
10166
+ const fourK = klingV4FourK(req.durationSeconds ?? 5, req);
10167
+ if (fourK !== void 0) return fourK;
10156
10168
  if (hasReferences(req)) {
10157
10169
  if (req.lastFrame !== void 0) {
10158
10170
  return unsupported2("takes an end frame only without reference images or videos");
@@ -10256,7 +10268,10 @@ var RULES = new Map([
10256
10268
  [KLING_O3_OMNI, o3Reference],
10257
10269
  [O3_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
10258
10270
  [KLING_V4, klingV4],
10259
- [KLING_V4_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
10271
+ [
10272
+ KLING_V4_EDIT,
10273
+ (req) => needsSource(req) ?? klingV4FourK(req.durationSeconds ?? req.sourceVideo?.durationSeconds, req) ?? needsPrompt(req)
10274
+ ],
10260
10275
  [KLING_V4_FLASH, klingV4Flash],
10261
10276
  [KLING_V4_FLASH_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
10262
10277
  [H3_TURBO, h3Turbo],