@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/dist/catalog.js CHANGED
@@ -5661,7 +5661,9 @@ var VIDEO_FAMILY_MODELS = [
5661
5661
  // start frame included (fal: "counts toward the image reference limit"), 300 px min.
5662
5662
  // Reference videos: 5, 3-30.05 s each and 30 s combined, 700 px min, 23.9-60.05 fps.
5663
5663
  // The prompt names references as @Image1, @Video1 (no space; @Element1 for elements,
5664
- // which the kit does not send). No sound switch on any endpoint.
5664
+ // which the kit does not send). No sound switch on any endpoint. 4K since 2026-11-19;
5665
+ // the endpoints also take `hdr` (10-bit, 1080p and 4K, billed per output second on top),
5666
+ // which the kit does not send: no price row can carry that fee yet (ENG-4272).
5665
5667
  id: "kling-4.0",
5666
5668
  aliases: ["kling-4", "kling-v4"],
5667
5669
  label: "Kling 4.0",
@@ -5673,7 +5675,7 @@ var VIDEO_FAMILY_MODELS = [
5673
5675
  constraints: {
5674
5676
  inputBilling: "kling-v4",
5675
5677
  aspectRatios: ["adaptive", "16:9", "9:16", "1:1", "21:9"],
5676
- resolutions: ["720p", "1080p"],
5678
+ resolutions: ["720p", "1080p", "4k"],
5677
5679
  durations: { min: 3, max: 30 },
5678
5680
  durationPresets: [5, 10, 15, 30],
5679
5681
  references: {
@@ -5694,7 +5696,7 @@ var VIDEO_FAMILY_MODELS = [
5694
5696
  display: {
5695
5697
  provider: "kuaishou",
5696
5698
  logo: KLING_LOGO2,
5697
- 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."
5699
+ 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."
5698
5700
  },
5699
5701
  capabilities: { lastFrameRequiresFirstFrame: true }
5700
5702
  },
@@ -5712,7 +5714,7 @@ var VIDEO_FAMILY_MODELS = [
5712
5714
  exposure: ["cowork", "space_builder"],
5713
5715
  constraints: {
5714
5716
  inputBilling: "kling-v4",
5715
- resolutions: ["720p", "1080p"],
5717
+ resolutions: ["720p", "1080p", "4k"],
5716
5718
  durations: { min: 3, max: 30 },
5717
5719
  references: { ...NO_REFERENCES, images: 10 },
5718
5720
  requires: ["sourceVideo"],
@@ -5728,7 +5730,7 @@ var VIDEO_FAMILY_MODELS = [
5728
5730
  display: {
5729
5731
  provider: "kuaishou",
5730
5732
  logo: KLING_LOGO2,
5731
- 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."
5733
+ 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."
5732
5734
  },
5733
5735
  capabilities: { acceptsSourceVideo: true, videoEdit: true }
5734
5736
  },
@@ -10060,7 +10062,17 @@ function o3Reference(req) {
10060
10062
  function hasReferences(req) {
10061
10063
  return count(req.referenceImages) + count(req.referenceVideos) > 0;
10062
10064
  }
10065
+ var KLING_V4_4K_MAX_SECONDS = 15;
10066
+ function klingV4FourK(seconds3, req) {
10067
+ if (req.resolution !== "4k") return void 0;
10068
+ if (seconds3 === void 0) {
10069
+ return missing(`needs a measured source video of up to ${KLING_V4_4K_MAX_SECONDS} s at 4K`);
10070
+ }
10071
+ return seconds3 > KLING_V4_4K_MAX_SECONDS ? unsupported2(`renders at most ${KLING_V4_4K_MAX_SECONDS} s at 4K`) : void 0;
10072
+ }
10063
10073
  function klingV4(req) {
10074
+ const fourK = klingV4FourK(req.durationSeconds ?? 5, req);
10075
+ if (fourK !== void 0) return fourK;
10064
10076
  if (hasReferences(req)) {
10065
10077
  if (req.lastFrame !== void 0) {
10066
10078
  return unsupported2("takes an end frame only without reference images or videos");
@@ -10164,7 +10176,10 @@ var RULES = new Map([
10164
10176
  [KLING_O3_OMNI, o3Reference],
10165
10177
  [O3_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
10166
10178
  [KLING_V4, klingV4],
10167
- [KLING_V4_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
10179
+ [
10180
+ KLING_V4_EDIT,
10181
+ (req) => needsSource(req) ?? klingV4FourK(req.durationSeconds ?? req.sourceVideo?.durationSeconds, req) ?? needsPrompt(req)
10182
+ ],
10168
10183
  [KLING_V4_FLASH, klingV4Flash],
10169
10184
  [KLING_V4_FLASH_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
10170
10185
  [H3_TURBO, h3Turbo],