@shop-os/modelkit 0.30.0 → 0.31.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/index.cjs CHANGED
@@ -6428,6 +6428,76 @@ var VIDEO_FAMILY_MODELS = [
6428
6428
  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."
6429
6429
  },
6430
6430
  capabilities: { lastFrameRequiresFirstFrame: true }
6431
+ },
6432
+ {
6433
+ // https://fal.ai/models/lightricks/ltx-2.5/text-to-video/pro/api (+ /image-to-video/pro):
6434
+ // a Lightricks partner endpoint on fal. Pro renders 720p and 1080p only, 6/8/10 s;
6435
+ // no safety checker field. Routing and tiers as LTX 2.3 (adapters/fal-ltx.ts).
6436
+ id: "ltx-2.5",
6437
+ aliases: ["ltx-2-5", "ltx25", "ltx-2.5-pro"],
6438
+ label: "LTX 2.5",
6439
+ type: "video",
6440
+ adapter: "fal",
6441
+ providerModelId: "lightricks/ltx-2.5/text-to-video/pro",
6442
+ lifecycle: "active",
6443
+ exposure: ["cowork", "space_builder"],
6444
+ constraints: {
6445
+ aspectRatios: ["adaptive", "16:9", "9:16"],
6446
+ resolutions: ["720p", "1080p"],
6447
+ durations: [6, 8, 10],
6448
+ supports: ["generateAudio", "lastFrame"],
6449
+ prompt: { referenceSyntax: "numbered", maxChars: 5e3 },
6450
+ audio: "optional"
6451
+ },
6452
+ defaults: {
6453
+ durationSeconds: 6,
6454
+ resolution: "1080p",
6455
+ aspectRatio: "adaptive",
6456
+ generateAudio: true
6457
+ },
6458
+ usage: { ...VIDEO_USAGE },
6459
+ pricingKind: "video_per_second",
6460
+ display: {
6461
+ provider: "lightricks",
6462
+ logo: LIGHTRICKS_LOGO,
6463
+ description: "Lightricks LTX 2.5 Pro text-to-video and start/end-frame image-to-video with native audio; 6, 8 or 10 seconds at 720p or 1080p in landscape or portrait."
6464
+ },
6465
+ capabilities: { lastFrameRequiresFirstFrame: true }
6466
+ },
6467
+ {
6468
+ // https://fal.ai/models/lightricks/ltx-2.5/text-to-video/fast/api (+ /image-to-video/fast):
6469
+ // 720p to 2160p, even durations 6-20 s; over 10 s is 720p or 1080p at 24/25 fps only
6470
+ // (the kit never sends fps, so the rule checks the tier).
6471
+ id: "ltx-2.5-fast",
6472
+ aliases: ["ltx-2-5-fast", "ltx25-fast"],
6473
+ label: "LTX 2.5 Fast",
6474
+ type: "video",
6475
+ adapter: "fal",
6476
+ providerModelId: "lightricks/ltx-2.5/text-to-video/fast",
6477
+ lifecycle: "active",
6478
+ exposure: ["cowork", "space_builder"],
6479
+ constraints: {
6480
+ aspectRatios: ["adaptive", "16:9", "9:16"],
6481
+ resolutions: ["720p", "1080p", "2k", "4k"],
6482
+ durations: [6, 8, 10, 12, 14, 16, 18, 20],
6483
+ supports: ["generateAudio", "lastFrame"],
6484
+ prompt: { referenceSyntax: "numbered", maxChars: 5e3 },
6485
+ audio: "optional"
6486
+ },
6487
+ defaults: {
6488
+ durationSeconds: 6,
6489
+ resolution: "1080p",
6490
+ aspectRatio: "adaptive",
6491
+ generateAudio: true
6492
+ },
6493
+ usage: { ...VIDEO_USAGE },
6494
+ pricingKind: "video_per_second",
6495
+ display: {
6496
+ provider: "lightricks",
6497
+ logo: LIGHTRICKS_LOGO,
6498
+ description: "Speed-optimized Lightricks LTX 2.5 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 720p or 1080p."
6499
+ },
6500
+ capabilities: { lastFrameRequiresFirstFrame: true }
6431
6501
  }
6432
6502
  ];
6433
6503
 
@@ -10523,6 +10593,8 @@ var VIDU_Q4 = "fal-ai/vidu/q4";
10523
10593
  var OMNIHUMAN_V2 = "bytedance/omnihuman/v2";
10524
10594
  var LTX_T2V = "fal-ai/ltx-2.3/text-to-video";
10525
10595
  var LTX_FAST_T2V = "fal-ai/ltx-2.3/text-to-video/fast";
10596
+ var LTX25_T2V = "lightricks/ltx-2.5/text-to-video/pro";
10597
+ var LTX25_FAST_T2V = "lightricks/ltx-2.5/text-to-video/fast";
10526
10598
  var KLING_O3_IMAGE_CAP = 7;
10527
10599
  var KLING_V4_IMAGE_CAP = 10;
10528
10600
  var TURBO_AUDIO_MIN_SECONDS = 2;
@@ -10699,7 +10771,7 @@ function imageAndAudio(req, audioSeconds) {
10699
10771
  }
10700
10772
  return inputSeconds("audio", audio, audioSeconds);
10701
10773
  }
10702
- function ltx(fast) {
10774
+ function ltx(longTiers) {
10703
10775
  return (req) => {
10704
10776
  if (req.lastFrame !== void 0 && req.firstFrame === void 0) {
10705
10777
  return missing("takes an end frame only together with a start frame");
@@ -10707,8 +10779,8 @@ function ltx(fast) {
10707
10779
  if (count(req.referenceImages) + count(req.referenceVideos) + count(req.referenceAudios) > 0) {
10708
10780
  return unsupported3("takes no reference images, videos or audio");
10709
10781
  }
10710
- if (fast && (req.durationSeconds ?? 6) > 10 && req.resolution !== void 0 && req.resolution !== "1080p") {
10711
- return unsupported3("renders over 10 s at 1080p only");
10782
+ if (longTiers !== null && (req.durationSeconds ?? 6) > 10 && req.resolution !== void 0 && !longTiers.includes(req.resolution)) {
10783
+ return unsupported3(`renders over 10 s at ${longTiers.join(" or ")} only`);
10712
10784
  }
10713
10785
  return needsPrompt(req);
10714
10786
  };
@@ -10737,8 +10809,10 @@ var RULES = new Map([
10737
10809
  ...AVATAR_AUDIO.map(
10738
10810
  ([id, limits]) => [id, (req) => imageAndAudio(req, limits)]
10739
10811
  ),
10740
- [LTX_T2V, ltx(false)],
10741
- [LTX_FAST_T2V, ltx(true)]
10812
+ [LTX_T2V, ltx(null)],
10813
+ [LTX_FAST_T2V, ltx(["1080p"])],
10814
+ [LTX25_T2V, ltx(null)],
10815
+ [LTX25_FAST_T2V, ltx(["720p", "1080p"])]
10742
10816
  ]);
10743
10817
  function falVideoProblem(providerModelId, req) {
10744
10818
  return RULES.get(providerModelId.toLowerCase())?.(req);
@@ -13944,6 +14018,10 @@ var LTX_T2V2 = "fal-ai/ltx-2.3/text-to-video";
13944
14018
  var LTX_I2V = "fal-ai/ltx-2.3/image-to-video";
13945
14019
  var LTX_FAST_T2V2 = "fal-ai/ltx-2.3/text-to-video/fast";
13946
14020
  var LTX_FAST_I2V = "fal-ai/ltx-2.3/image-to-video/fast";
14021
+ var LTX25_T2V2 = "lightricks/ltx-2.5/text-to-video/pro";
14022
+ var LTX25_I2V = "lightricks/ltx-2.5/image-to-video/pro";
14023
+ var LTX25_FAST_T2V2 = "lightricks/ltx-2.5/text-to-video/fast";
14024
+ var LTX25_FAST_I2V = "lightricks/ltx-2.5/image-to-video/fast";
13947
14025
  var LTX_TIERS = {
13948
14026
  "360p": "360p",
13949
14027
  "480p": "480p",
@@ -13953,7 +14031,13 @@ var LTX_TIERS = {
13953
14031
  "2k": "1440p",
13954
14032
  "4k": "2160p"
13955
14033
  };
13956
- function ltxGenerate(fast, req, ctx) {
14034
+ var I2V_OF = /* @__PURE__ */ new Map([
14035
+ [LTX_T2V2, LTX_I2V],
14036
+ [LTX_FAST_T2V2, LTX_FAST_I2V],
14037
+ [LTX25_T2V2, LTX25_I2V],
14038
+ [LTX25_FAST_T2V2, LTX25_FAST_I2V]
14039
+ ]);
14040
+ function ltxGenerate(t2v, i2v, req, ctx) {
13957
14041
  const resolution = resolutionOf2(req, ctx);
13958
14042
  const duration = wholeSeconds(req, ctx);
13959
14043
  const input = {
@@ -13962,9 +14046,11 @@ function ltxGenerate(fast, req, ctx) {
13962
14046
  resolution: LTX_TIERS[resolution],
13963
14047
  generate_audio: req.generateAudio ?? true
13964
14048
  };
13965
- if (req.safetyChecker !== void 0) input["enable_safety_checker"] = req.safetyChecker;
14049
+ if (req.safetyChecker !== void 0 && t2v.startsWith("fal-ai/ltx-2.3/")) {
14050
+ input["enable_safety_checker"] = req.safetyChecker;
14051
+ }
13966
14052
  const firstFrame = req.firstFrame;
13967
- const endpoint = firstFrame === void 0 ? fast ? LTX_FAST_T2V2 : LTX_T2V2 : fast ? LTX_FAST_I2V : LTX_I2V;
14053
+ const endpoint = firstFrame === void 0 ? t2v : i2v;
13968
14054
  if (firstFrame === void 0) {
13969
14055
  const ratio = concreteRatio(req);
13970
14056
  if (ratio !== void 0) input["aspect_ratio"] = ratio;
@@ -13977,17 +14063,13 @@ function ltxGenerate(fast, req, ctx) {
13977
14063
  }
13978
14064
  return { endpoint, input, resolution, seconds: requestedSeconds(duration) };
13979
14065
  }
13980
- var LTX_MODEL_IDS = /* @__PURE__ */ new Set([
13981
- LTX_T2V2,
13982
- LTX_I2V,
13983
- LTX_FAST_T2V2,
13984
- LTX_FAST_I2V
13985
- ]);
14066
+ var LTX_MODEL_IDS = new Set([...I2V_OF.entries()].flat());
13986
14067
  var ltxFamily = {
13987
14068
  ids: LTX_MODEL_IDS,
13988
14069
  plan(req, ctx) {
13989
14070
  const id = ctx.model.providerModelId.toLowerCase();
13990
- return ltxGenerate(id === LTX_FAST_T2V2 || id === LTX_FAST_I2V, req, ctx);
14071
+ const t2v = I2V_OF.has(id) ? id : [...I2V_OF.entries()].find(([, i2v]) => i2v === id)?.[0] ?? LTX_T2V2;
14072
+ return ltxGenerate(t2v, I2V_OF.get(t2v) ?? LTX_I2V, req, ctx);
13991
14073
  }
13992
14074
  };
13993
14075