@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.js CHANGED
@@ -6271,6 +6271,76 @@ var VIDEO_FAMILY_MODELS = [
6271
6271
  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."
6272
6272
  },
6273
6273
  capabilities: { lastFrameRequiresFirstFrame: true }
6274
+ },
6275
+ {
6276
+ // https://fal.ai/models/lightricks/ltx-2.5/text-to-video/pro/api (+ /image-to-video/pro):
6277
+ // a Lightricks partner endpoint on fal. Pro renders 720p and 1080p only, 6/8/10 s;
6278
+ // no safety checker field. Routing and tiers as LTX 2.3 (adapters/fal-ltx.ts).
6279
+ id: "ltx-2.5",
6280
+ aliases: ["ltx-2-5", "ltx25", "ltx-2.5-pro"],
6281
+ label: "LTX 2.5",
6282
+ type: "video",
6283
+ adapter: "fal",
6284
+ providerModelId: "lightricks/ltx-2.5/text-to-video/pro",
6285
+ lifecycle: "active",
6286
+ exposure: ["cowork", "space_builder"],
6287
+ constraints: {
6288
+ aspectRatios: ["adaptive", "16:9", "9:16"],
6289
+ resolutions: ["720p", "1080p"],
6290
+ durations: [6, 8, 10],
6291
+ supports: ["generateAudio", "lastFrame"],
6292
+ prompt: { referenceSyntax: "numbered", maxChars: 5e3 },
6293
+ audio: "optional"
6294
+ },
6295
+ defaults: {
6296
+ durationSeconds: 6,
6297
+ resolution: "1080p",
6298
+ aspectRatio: "adaptive",
6299
+ generateAudio: true
6300
+ },
6301
+ usage: { ...VIDEO_USAGE },
6302
+ pricingKind: "video_per_second",
6303
+ display: {
6304
+ provider: "lightricks",
6305
+ logo: LIGHTRICKS_LOGO,
6306
+ 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."
6307
+ },
6308
+ capabilities: { lastFrameRequiresFirstFrame: true }
6309
+ },
6310
+ {
6311
+ // https://fal.ai/models/lightricks/ltx-2.5/text-to-video/fast/api (+ /image-to-video/fast):
6312
+ // 720p to 2160p, even durations 6-20 s; over 10 s is 720p or 1080p at 24/25 fps only
6313
+ // (the kit never sends fps, so the rule checks the tier).
6314
+ id: "ltx-2.5-fast",
6315
+ aliases: ["ltx-2-5-fast", "ltx25-fast"],
6316
+ label: "LTX 2.5 Fast",
6317
+ type: "video",
6318
+ adapter: "fal",
6319
+ providerModelId: "lightricks/ltx-2.5/text-to-video/fast",
6320
+ lifecycle: "active",
6321
+ exposure: ["cowork", "space_builder"],
6322
+ constraints: {
6323
+ aspectRatios: ["adaptive", "16:9", "9:16"],
6324
+ resolutions: ["720p", "1080p", "2k", "4k"],
6325
+ durations: [6, 8, 10, 12, 14, 16, 18, 20],
6326
+ supports: ["generateAudio", "lastFrame"],
6327
+ prompt: { referenceSyntax: "numbered", maxChars: 5e3 },
6328
+ audio: "optional"
6329
+ },
6330
+ defaults: {
6331
+ durationSeconds: 6,
6332
+ resolution: "1080p",
6333
+ aspectRatio: "adaptive",
6334
+ generateAudio: true
6335
+ },
6336
+ usage: { ...VIDEO_USAGE },
6337
+ pricingKind: "video_per_second",
6338
+ display: {
6339
+ provider: "lightricks",
6340
+ logo: LIGHTRICKS_LOGO,
6341
+ 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."
6342
+ },
6343
+ capabilities: { lastFrameRequiresFirstFrame: true }
6274
6344
  }
6275
6345
  ];
6276
6346
 
@@ -10366,6 +10436,8 @@ var VIDU_Q4 = "fal-ai/vidu/q4";
10366
10436
  var OMNIHUMAN_V2 = "bytedance/omnihuman/v2";
10367
10437
  var LTX_T2V = "fal-ai/ltx-2.3/text-to-video";
10368
10438
  var LTX_FAST_T2V = "fal-ai/ltx-2.3/text-to-video/fast";
10439
+ var LTX25_T2V = "lightricks/ltx-2.5/text-to-video/pro";
10440
+ var LTX25_FAST_T2V = "lightricks/ltx-2.5/text-to-video/fast";
10369
10441
  var KLING_O3_IMAGE_CAP = 7;
10370
10442
  var KLING_V4_IMAGE_CAP = 10;
10371
10443
  var TURBO_AUDIO_MIN_SECONDS = 2;
@@ -10542,7 +10614,7 @@ function imageAndAudio(req, audioSeconds) {
10542
10614
  }
10543
10615
  return inputSeconds("audio", audio, audioSeconds);
10544
10616
  }
10545
- function ltx(fast) {
10617
+ function ltx(longTiers) {
10546
10618
  return (req) => {
10547
10619
  if (req.lastFrame !== void 0 && req.firstFrame === void 0) {
10548
10620
  return missing("takes an end frame only together with a start frame");
@@ -10550,8 +10622,8 @@ function ltx(fast) {
10550
10622
  if (count(req.referenceImages) + count(req.referenceVideos) + count(req.referenceAudios) > 0) {
10551
10623
  return unsupported3("takes no reference images, videos or audio");
10552
10624
  }
10553
- if (fast && (req.durationSeconds ?? 6) > 10 && req.resolution !== void 0 && req.resolution !== "1080p") {
10554
- return unsupported3("renders over 10 s at 1080p only");
10625
+ if (longTiers !== null && (req.durationSeconds ?? 6) > 10 && req.resolution !== void 0 && !longTiers.includes(req.resolution)) {
10626
+ return unsupported3(`renders over 10 s at ${longTiers.join(" or ")} only`);
10555
10627
  }
10556
10628
  return needsPrompt(req);
10557
10629
  };
@@ -10580,8 +10652,10 @@ var RULES = new Map([
10580
10652
  ...AVATAR_AUDIO.map(
10581
10653
  ([id, limits]) => [id, (req) => imageAndAudio(req, limits)]
10582
10654
  ),
10583
- [LTX_T2V, ltx(false)],
10584
- [LTX_FAST_T2V, ltx(true)]
10655
+ [LTX_T2V, ltx(null)],
10656
+ [LTX_FAST_T2V, ltx(["1080p"])],
10657
+ [LTX25_T2V, ltx(null)],
10658
+ [LTX25_FAST_T2V, ltx(["720p", "1080p"])]
10585
10659
  ]);
10586
10660
  function falVideoProblem(providerModelId, req) {
10587
10661
  return RULES.get(providerModelId.toLowerCase())?.(req);
@@ -13787,6 +13861,10 @@ var LTX_T2V2 = "fal-ai/ltx-2.3/text-to-video";
13787
13861
  var LTX_I2V = "fal-ai/ltx-2.3/image-to-video";
13788
13862
  var LTX_FAST_T2V2 = "fal-ai/ltx-2.3/text-to-video/fast";
13789
13863
  var LTX_FAST_I2V = "fal-ai/ltx-2.3/image-to-video/fast";
13864
+ var LTX25_T2V2 = "lightricks/ltx-2.5/text-to-video/pro";
13865
+ var LTX25_I2V = "lightricks/ltx-2.5/image-to-video/pro";
13866
+ var LTX25_FAST_T2V2 = "lightricks/ltx-2.5/text-to-video/fast";
13867
+ var LTX25_FAST_I2V = "lightricks/ltx-2.5/image-to-video/fast";
13790
13868
  var LTX_TIERS = {
13791
13869
  "360p": "360p",
13792
13870
  "480p": "480p",
@@ -13796,7 +13874,13 @@ var LTX_TIERS = {
13796
13874
  "2k": "1440p",
13797
13875
  "4k": "2160p"
13798
13876
  };
13799
- function ltxGenerate(fast, req, ctx) {
13877
+ var I2V_OF = /* @__PURE__ */ new Map([
13878
+ [LTX_T2V2, LTX_I2V],
13879
+ [LTX_FAST_T2V2, LTX_FAST_I2V],
13880
+ [LTX25_T2V2, LTX25_I2V],
13881
+ [LTX25_FAST_T2V2, LTX25_FAST_I2V]
13882
+ ]);
13883
+ function ltxGenerate(t2v, i2v, req, ctx) {
13800
13884
  const resolution = resolutionOf2(req, ctx);
13801
13885
  const duration = wholeSeconds(req, ctx);
13802
13886
  const input = {
@@ -13805,9 +13889,11 @@ function ltxGenerate(fast, req, ctx) {
13805
13889
  resolution: LTX_TIERS[resolution],
13806
13890
  generate_audio: req.generateAudio ?? true
13807
13891
  };
13808
- if (req.safetyChecker !== void 0) input["enable_safety_checker"] = req.safetyChecker;
13892
+ if (req.safetyChecker !== void 0 && t2v.startsWith("fal-ai/ltx-2.3/")) {
13893
+ input["enable_safety_checker"] = req.safetyChecker;
13894
+ }
13809
13895
  const firstFrame = req.firstFrame;
13810
- const endpoint = firstFrame === void 0 ? fast ? LTX_FAST_T2V2 : LTX_T2V2 : fast ? LTX_FAST_I2V : LTX_I2V;
13896
+ const endpoint = firstFrame === void 0 ? t2v : i2v;
13811
13897
  if (firstFrame === void 0) {
13812
13898
  const ratio = concreteRatio(req);
13813
13899
  if (ratio !== void 0) input["aspect_ratio"] = ratio;
@@ -13820,17 +13906,13 @@ function ltxGenerate(fast, req, ctx) {
13820
13906
  }
13821
13907
  return { endpoint, input, resolution, seconds: requestedSeconds(duration) };
13822
13908
  }
13823
- var LTX_MODEL_IDS = /* @__PURE__ */ new Set([
13824
- LTX_T2V2,
13825
- LTX_I2V,
13826
- LTX_FAST_T2V2,
13827
- LTX_FAST_I2V
13828
- ]);
13909
+ var LTX_MODEL_IDS = new Set([...I2V_OF.entries()].flat());
13829
13910
  var ltxFamily = {
13830
13911
  ids: LTX_MODEL_IDS,
13831
13912
  plan(req, ctx) {
13832
13913
  const id = ctx.model.providerModelId.toLowerCase();
13833
- return ltxGenerate(id === LTX_FAST_T2V2 || id === LTX_FAST_I2V, req, ctx);
13914
+ const t2v = I2V_OF.has(id) ? id : [...I2V_OF.entries()].find(([, i2v]) => i2v === id)?.[0] ?? LTX_T2V2;
13915
+ return ltxGenerate(t2v, I2V_OF.get(t2v) ?? LTX_I2V, req, ctx);
13834
13916
  }
13835
13917
  };
13836
13918