@shop-os/modelkit 0.27.0 → 0.29.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
@@ -5531,6 +5531,7 @@ var KLING_LOGO2 = "https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@1.97.0
5531
5531
  var MINIMAX_LOGO4 = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/f4c2e906-28b7-4a4a-b491-df8fef7808ed.png";
5532
5532
  var BYTEDANCE_LOGO = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/3bba5d81-4e57-4e71-911b-cdfa05acca2c_compressed.png";
5533
5533
  var XAI_LOGO = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/858b7fcc-9bd5-411d-aea1-a7b35ecfffab_compressed.png";
5534
+ var LIGHTRICKS_LOGO = "https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@1.97.0/light/lightricks.png";
5534
5535
  var H3_RATIOS = ["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"];
5535
5536
  var HAPPY_HORSE_RATIOS = [
5536
5537
  "16:9",
@@ -5661,7 +5662,9 @@ var VIDEO_FAMILY_MODELS = [
5661
5662
  // start frame included (fal: "counts toward the image reference limit"), 300 px min.
5662
5663
  // Reference videos: 5, 3-30.05 s each and 30 s combined, 700 px min, 23.9-60.05 fps.
5663
5664
  // 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.
5665
+ // which the kit does not send). No sound switch on any endpoint. 4K since 2026-11-19;
5666
+ // the endpoints also take `hdr` (10-bit, 1080p and 4K, billed per output second on top),
5667
+ // which the kit does not send: no price row can carry that fee yet (ENG-4272).
5665
5668
  id: "kling-4.0",
5666
5669
  aliases: ["kling-4", "kling-v4"],
5667
5670
  label: "Kling 4.0",
@@ -5673,7 +5676,7 @@ var VIDEO_FAMILY_MODELS = [
5673
5676
  constraints: {
5674
5677
  inputBilling: "kling-v4",
5675
5678
  aspectRatios: ["adaptive", "16:9", "9:16", "1:1", "21:9"],
5676
- resolutions: ["720p", "1080p"],
5679
+ resolutions: ["720p", "1080p", "4k"],
5677
5680
  durations: { min: 3, max: 30 },
5678
5681
  durationPresets: [5, 10, 15, 30],
5679
5682
  references: {
@@ -5694,7 +5697,7 @@ var VIDEO_FAMILY_MODELS = [
5694
5697
  display: {
5695
5698
  provider: "kuaishou",
5696
5699
  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."
5700
+ 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
5701
  },
5699
5702
  capabilities: { lastFrameRequiresFirstFrame: true }
5700
5703
  },
@@ -5712,7 +5715,7 @@ var VIDEO_FAMILY_MODELS = [
5712
5715
  exposure: ["cowork", "space_builder"],
5713
5716
  constraints: {
5714
5717
  inputBilling: "kling-v4",
5715
- resolutions: ["720p", "1080p"],
5718
+ resolutions: ["720p", "1080p", "4k"],
5716
5719
  durations: { min: 3, max: 30 },
5717
5720
  references: { ...NO_REFERENCES, images: 10 },
5718
5721
  requires: ["sourceVideo"],
@@ -5728,7 +5731,7 @@ var VIDEO_FAMILY_MODELS = [
5728
5731
  display: {
5729
5732
  provider: "kuaishou",
5730
5733
  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."
5734
+ 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
5735
  },
5733
5736
  capabilities: { acceptsSourceVideo: true, videoEdit: true }
5734
5737
  },
@@ -6127,6 +6130,77 @@ var VIDEO_FAMILY_MODELS = [
6127
6130
  description: "xAI Grok Imagine 1.5: text- and image-to-video at native 1080p with lip-synced audio, or up to 14 reference images and pinned first and last frames at 720p, up to 15 seconds."
6128
6131
  },
6129
6132
  capabilities: {}
6133
+ },
6134
+ {
6135
+ // https://fal.ai/models/fal-ai/ltx-2.3/text-to-video/api (+ /image-to-video): one row;
6136
+ // a start frame routes to image-to-video, else text-to-video. The kit's 2k/4k tiers
6137
+ // are fal's 1440p/2160p (adapters/fal-ltx.ts). "adaptive" is fal's "auto" on
6138
+ // image-to-video; text-to-video leaves an adaptive ratio at fal's 16:9 default.
6139
+ id: "ltx-2.3",
6140
+ aliases: ["ltx-2-3", "ltx23"],
6141
+ label: "LTX 2.3",
6142
+ type: "video",
6143
+ adapter: "fal",
6144
+ providerModelId: "fal-ai/ltx-2.3/text-to-video",
6145
+ lifecycle: "active",
6146
+ exposure: ["cowork", "space_builder"],
6147
+ constraints: {
6148
+ aspectRatios: ["adaptive", "16:9", "9:16"],
6149
+ resolutions: ["1080p", "2k", "4k"],
6150
+ durations: [6, 8, 10],
6151
+ supports: ["generateAudio", "lastFrame", "safetyChecker"],
6152
+ prompt: { referenceSyntax: "numbered", maxChars: 5e3 },
6153
+ audio: "optional"
6154
+ },
6155
+ defaults: {
6156
+ durationSeconds: 6,
6157
+ resolution: "1080p",
6158
+ aspectRatio: "adaptive",
6159
+ generateAudio: true
6160
+ },
6161
+ usage: { ...VIDEO_USAGE },
6162
+ pricingKind: "video_per_second",
6163
+ display: {
6164
+ provider: "lightricks",
6165
+ logo: LIGHTRICKS_LOGO,
6166
+ description: "Lightricks LTX 2.3 open-source text-to-video and start/end-frame image-to-video with native audio; 6, 8 or 10 seconds at up to 4K in landscape or portrait."
6167
+ },
6168
+ capabilities: { lastFrameRequiresFirstFrame: true }
6169
+ },
6170
+ {
6171
+ // https://fal.ai/models/fal-ai/ltx-2.3/text-to-video/fast/api (+ /image-to-video/fast):
6172
+ // the fast tier at the same resolutions; even durations 6-20 s, but over 10 s is
6173
+ // 1080p at 25 fps only (the kit never sends fps, so the rule checks the tier).
6174
+ id: "ltx-2.3-fast",
6175
+ aliases: ["ltx-2-3-fast", "ltx23-fast"],
6176
+ label: "LTX 2.3 Fast",
6177
+ type: "video",
6178
+ adapter: "fal",
6179
+ providerModelId: "fal-ai/ltx-2.3/text-to-video/fast",
6180
+ lifecycle: "active",
6181
+ exposure: ["cowork", "space_builder"],
6182
+ constraints: {
6183
+ aspectRatios: ["adaptive", "16:9", "9:16"],
6184
+ resolutions: ["1080p", "2k", "4k"],
6185
+ durations: [6, 8, 10, 12, 14, 16, 18, 20],
6186
+ supports: ["generateAudio", "lastFrame", "safetyChecker"],
6187
+ prompt: { referenceSyntax: "numbered", maxChars: 5e3 },
6188
+ audio: "optional"
6189
+ },
6190
+ defaults: {
6191
+ durationSeconds: 6,
6192
+ resolution: "1080p",
6193
+ aspectRatio: "adaptive",
6194
+ generateAudio: true
6195
+ },
6196
+ usage: { ...VIDEO_USAGE },
6197
+ pricingKind: "video_per_second",
6198
+ display: {
6199
+ provider: "lightricks",
6200
+ logo: LIGHTRICKS_LOGO,
6201
+ description: "Speed-optimized Lightricks LTX 2.3 Fast text-to-video and start/end-frame image-to-video with native audio; 6-20 seconds at up to 4K, over 10 seconds at 1080p."
6202
+ },
6203
+ capabilities: { lastFrameRequiresFirstFrame: true }
6130
6204
  }
6131
6205
  ];
6132
6206
 
@@ -9991,6 +10065,8 @@ var HAPPY_HORSE = "happyhorse-1.1";
9991
10065
  var HAPPY_HORSE_EDIT = "alibaba/happy-horse/video-edit";
9992
10066
  var VIDU_Q4 = "fal-ai/vidu/q4";
9993
10067
  var OMNIHUMAN_V2 = "bytedance/omnihuman/v2";
10068
+ var LTX_T2V = "fal-ai/ltx-2.3/text-to-video";
10069
+ var LTX_FAST_T2V = "fal-ai/ltx-2.3/text-to-video/fast";
9994
10070
  var KLING_O3_IMAGE_CAP = 7;
9995
10071
  var KLING_V4_IMAGE_CAP = 10;
9996
10072
  var TURBO_AUDIO_MIN_SECONDS = 2;
@@ -10060,7 +10136,17 @@ function o3Reference(req) {
10060
10136
  function hasReferences(req) {
10061
10137
  return count(req.referenceImages) + count(req.referenceVideos) > 0;
10062
10138
  }
10139
+ var KLING_V4_4K_MAX_SECONDS = 15;
10140
+ function klingV4FourK(seconds3, req) {
10141
+ if (req.resolution !== "4k") return void 0;
10142
+ if (seconds3 === void 0) {
10143
+ return missing(`needs a measured source video of up to ${KLING_V4_4K_MAX_SECONDS} s at 4K`);
10144
+ }
10145
+ return seconds3 > KLING_V4_4K_MAX_SECONDS ? unsupported2(`renders at most ${KLING_V4_4K_MAX_SECONDS} s at 4K`) : void 0;
10146
+ }
10063
10147
  function klingV4(req) {
10148
+ const fourK = klingV4FourK(req.durationSeconds ?? 5, req);
10149
+ if (fourK !== void 0) return fourK;
10064
10150
  if (hasReferences(req)) {
10065
10151
  if (req.lastFrame !== void 0) {
10066
10152
  return unsupported2("takes an end frame only without reference images or videos");
@@ -10157,6 +10243,20 @@ function imageAndAudio(req, audioSeconds) {
10157
10243
  }
10158
10244
  return inputSeconds("audio", audio, audioSeconds);
10159
10245
  }
10246
+ function ltx(fast) {
10247
+ return (req) => {
10248
+ if (req.lastFrame !== void 0 && req.firstFrame === void 0) {
10249
+ return missing("takes an end frame only together with a start frame");
10250
+ }
10251
+ if (count(req.referenceImages) + count(req.referenceVideos) + count(req.referenceAudios) > 0) {
10252
+ return unsupported2("takes no reference images, videos or audio");
10253
+ }
10254
+ if (fast && (req.durationSeconds ?? 6) > 10 && req.resolution !== void 0 && req.resolution !== "1080p") {
10255
+ return unsupported2("renders over 10 s at 1080p only");
10256
+ }
10257
+ return needsPrompt(req);
10258
+ };
10259
+ }
10160
10260
  var RULES = new Map([
10161
10261
  [MOTION_PRO, motionControl],
10162
10262
  [MOTION_STANDARD, motionControl],
@@ -10164,7 +10264,10 @@ var RULES = new Map([
10164
10264
  [KLING_O3_OMNI, o3Reference],
10165
10265
  [O3_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
10166
10266
  [KLING_V4, klingV4],
10167
- [KLING_V4_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
10267
+ [
10268
+ KLING_V4_EDIT,
10269
+ (req) => needsSource(req) ?? klingV4FourK(req.durationSeconds ?? req.sourceVideo?.durationSeconds, req) ?? needsPrompt(req)
10270
+ ],
10168
10271
  [KLING_V4_FLASH, klingV4Flash],
10169
10272
  [KLING_V4_FLASH_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
10170
10273
  [H3_TURBO, h3Turbo],
@@ -10177,7 +10280,9 @@ var RULES = new Map([
10177
10280
  [OMNIHUMAN_V2, (req) => imageAndAudio(req, OMNIHUMAN_AUDIO_SECONDS)],
10178
10281
  ...AVATAR_AUDIO.map(
10179
10282
  ([id, limits]) => [id, (req) => imageAndAudio(req, limits)]
10180
- )
10283
+ ),
10284
+ [LTX_T2V, ltx(false)],
10285
+ [LTX_FAST_T2V, ltx(true)]
10181
10286
  ]);
10182
10287
  function falVideoProblem(providerModelId, req) {
10183
10288
  return RULES.get(providerModelId.toLowerCase())?.(req);