@shop-os/modelkit 0.28.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/CHANGELOG.md +10 -0
- package/dist/catalog.cjs +91 -1
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.js +91 -1
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +144 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +144 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5542,6 +5542,7 @@ var KLING_LOGO2 = "https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@1.97.0
|
|
|
5542
5542
|
var MINIMAX_LOGO4 = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/f4c2e906-28b7-4a4a-b491-df8fef7808ed.png";
|
|
5543
5543
|
var BYTEDANCE_LOGO = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/3bba5d81-4e57-4e71-911b-cdfa05acca2c_compressed.png";
|
|
5544
5544
|
var XAI_LOGO = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/858b7fcc-9bd5-411d-aea1-a7b35ecfffab_compressed.png";
|
|
5545
|
+
var LIGHTRICKS_LOGO = "https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@1.97.0/light/lightricks.png";
|
|
5545
5546
|
var H3_RATIOS = ["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"];
|
|
5546
5547
|
var HAPPY_HORSE_RATIOS = [
|
|
5547
5548
|
"16:9",
|
|
@@ -6140,6 +6141,77 @@ var VIDEO_FAMILY_MODELS = [
|
|
|
6140
6141
|
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."
|
|
6141
6142
|
},
|
|
6142
6143
|
capabilities: {}
|
|
6144
|
+
},
|
|
6145
|
+
{
|
|
6146
|
+
// https://fal.ai/models/fal-ai/ltx-2.3/text-to-video/api (+ /image-to-video): one row;
|
|
6147
|
+
// a start frame routes to image-to-video, else text-to-video. The kit's 2k/4k tiers
|
|
6148
|
+
// are fal's 1440p/2160p (adapters/fal-ltx.ts). "adaptive" is fal's "auto" on
|
|
6149
|
+
// image-to-video; text-to-video leaves an adaptive ratio at fal's 16:9 default.
|
|
6150
|
+
id: "ltx-2.3",
|
|
6151
|
+
aliases: ["ltx-2-3", "ltx23"],
|
|
6152
|
+
label: "LTX 2.3",
|
|
6153
|
+
type: "video",
|
|
6154
|
+
adapter: "fal",
|
|
6155
|
+
providerModelId: "fal-ai/ltx-2.3/text-to-video",
|
|
6156
|
+
lifecycle: "active",
|
|
6157
|
+
exposure: ["cowork", "space_builder"],
|
|
6158
|
+
constraints: {
|
|
6159
|
+
aspectRatios: ["adaptive", "16:9", "9:16"],
|
|
6160
|
+
resolutions: ["1080p", "2k", "4k"],
|
|
6161
|
+
durations: [6, 8, 10],
|
|
6162
|
+
supports: ["generateAudio", "lastFrame", "safetyChecker"],
|
|
6163
|
+
prompt: { referenceSyntax: "numbered", maxChars: 5e3 },
|
|
6164
|
+
audio: "optional"
|
|
6165
|
+
},
|
|
6166
|
+
defaults: {
|
|
6167
|
+
durationSeconds: 6,
|
|
6168
|
+
resolution: "1080p",
|
|
6169
|
+
aspectRatio: "adaptive",
|
|
6170
|
+
generateAudio: true
|
|
6171
|
+
},
|
|
6172
|
+
usage: { ...VIDEO_USAGE },
|
|
6173
|
+
pricingKind: "video_per_second",
|
|
6174
|
+
display: {
|
|
6175
|
+
provider: "lightricks",
|
|
6176
|
+
logo: LIGHTRICKS_LOGO,
|
|
6177
|
+
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."
|
|
6178
|
+
},
|
|
6179
|
+
capabilities: { lastFrameRequiresFirstFrame: true }
|
|
6180
|
+
},
|
|
6181
|
+
{
|
|
6182
|
+
// https://fal.ai/models/fal-ai/ltx-2.3/text-to-video/fast/api (+ /image-to-video/fast):
|
|
6183
|
+
// the fast tier at the same resolutions; even durations 6-20 s, but over 10 s is
|
|
6184
|
+
// 1080p at 25 fps only (the kit never sends fps, so the rule checks the tier).
|
|
6185
|
+
id: "ltx-2.3-fast",
|
|
6186
|
+
aliases: ["ltx-2-3-fast", "ltx23-fast"],
|
|
6187
|
+
label: "LTX 2.3 Fast",
|
|
6188
|
+
type: "video",
|
|
6189
|
+
adapter: "fal",
|
|
6190
|
+
providerModelId: "fal-ai/ltx-2.3/text-to-video/fast",
|
|
6191
|
+
lifecycle: "active",
|
|
6192
|
+
exposure: ["cowork", "space_builder"],
|
|
6193
|
+
constraints: {
|
|
6194
|
+
aspectRatios: ["adaptive", "16:9", "9:16"],
|
|
6195
|
+
resolutions: ["1080p", "2k", "4k"],
|
|
6196
|
+
durations: [6, 8, 10, 12, 14, 16, 18, 20],
|
|
6197
|
+
supports: ["generateAudio", "lastFrame", "safetyChecker"],
|
|
6198
|
+
prompt: { referenceSyntax: "numbered", maxChars: 5e3 },
|
|
6199
|
+
audio: "optional"
|
|
6200
|
+
},
|
|
6201
|
+
defaults: {
|
|
6202
|
+
durationSeconds: 6,
|
|
6203
|
+
resolution: "1080p",
|
|
6204
|
+
aspectRatio: "adaptive",
|
|
6205
|
+
generateAudio: true
|
|
6206
|
+
},
|
|
6207
|
+
usage: { ...VIDEO_USAGE },
|
|
6208
|
+
pricingKind: "video_per_second",
|
|
6209
|
+
display: {
|
|
6210
|
+
provider: "lightricks",
|
|
6211
|
+
logo: LIGHTRICKS_LOGO,
|
|
6212
|
+
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."
|
|
6213
|
+
},
|
|
6214
|
+
capabilities: { lastFrameRequiresFirstFrame: true }
|
|
6143
6215
|
}
|
|
6144
6216
|
];
|
|
6145
6217
|
|
|
@@ -10202,6 +10274,8 @@ var HAPPY_HORSE = "happyhorse-1.1";
|
|
|
10202
10274
|
var HAPPY_HORSE_EDIT = "alibaba/happy-horse/video-edit";
|
|
10203
10275
|
var VIDU_Q4 = "fal-ai/vidu/q4";
|
|
10204
10276
|
var OMNIHUMAN_V2 = "bytedance/omnihuman/v2";
|
|
10277
|
+
var LTX_T2V = "fal-ai/ltx-2.3/text-to-video";
|
|
10278
|
+
var LTX_FAST_T2V = "fal-ai/ltx-2.3/text-to-video/fast";
|
|
10205
10279
|
var KLING_O3_IMAGE_CAP = 7;
|
|
10206
10280
|
var KLING_V4_IMAGE_CAP = 10;
|
|
10207
10281
|
var TURBO_AUDIO_MIN_SECONDS = 2;
|
|
@@ -10378,6 +10452,20 @@ function imageAndAudio(req, audioSeconds) {
|
|
|
10378
10452
|
}
|
|
10379
10453
|
return inputSeconds("audio", audio, audioSeconds);
|
|
10380
10454
|
}
|
|
10455
|
+
function ltx(fast) {
|
|
10456
|
+
return (req) => {
|
|
10457
|
+
if (req.lastFrame !== void 0 && req.firstFrame === void 0) {
|
|
10458
|
+
return missing("takes an end frame only together with a start frame");
|
|
10459
|
+
}
|
|
10460
|
+
if (count(req.referenceImages) + count(req.referenceVideos) + count(req.referenceAudios) > 0) {
|
|
10461
|
+
return unsupported3("takes no reference images, videos or audio");
|
|
10462
|
+
}
|
|
10463
|
+
if (fast && (req.durationSeconds ?? 6) > 10 && req.resolution !== void 0 && req.resolution !== "1080p") {
|
|
10464
|
+
return unsupported3("renders over 10 s at 1080p only");
|
|
10465
|
+
}
|
|
10466
|
+
return needsPrompt(req);
|
|
10467
|
+
};
|
|
10468
|
+
}
|
|
10381
10469
|
var RULES = new Map([
|
|
10382
10470
|
[MOTION_PRO, motionControl],
|
|
10383
10471
|
[MOTION_STANDARD, motionControl],
|
|
@@ -10401,7 +10489,9 @@ var RULES = new Map([
|
|
|
10401
10489
|
[OMNIHUMAN_V2, (req) => imageAndAudio(req, OMNIHUMAN_AUDIO_SECONDS)],
|
|
10402
10490
|
...AVATAR_AUDIO.map(
|
|
10403
10491
|
([id, limits]) => [id, (req) => imageAndAudio(req, limits)]
|
|
10404
|
-
)
|
|
10492
|
+
),
|
|
10493
|
+
[LTX_T2V, ltx(false)],
|
|
10494
|
+
[LTX_FAST_T2V, ltx(true)]
|
|
10405
10495
|
]);
|
|
10406
10496
|
function falVideoProblem(providerModelId, req) {
|
|
10407
10497
|
return RULES.get(providerModelId.toLowerCase())?.(req);
|
|
@@ -13591,6 +13681,58 @@ var klingOmniFamily = {
|
|
|
13591
13681
|
plan: plan2
|
|
13592
13682
|
};
|
|
13593
13683
|
|
|
13684
|
+
// src/adapters/fal-ltx.ts
|
|
13685
|
+
var LTX_T2V2 = "fal-ai/ltx-2.3/text-to-video";
|
|
13686
|
+
var LTX_I2V = "fal-ai/ltx-2.3/image-to-video";
|
|
13687
|
+
var LTX_FAST_T2V2 = "fal-ai/ltx-2.3/text-to-video/fast";
|
|
13688
|
+
var LTX_FAST_I2V = "fal-ai/ltx-2.3/image-to-video/fast";
|
|
13689
|
+
var LTX_TIERS = {
|
|
13690
|
+
"360p": "360p",
|
|
13691
|
+
"480p": "480p",
|
|
13692
|
+
"720p": "720p",
|
|
13693
|
+
"768p": "768p",
|
|
13694
|
+
"1080p": "1080p",
|
|
13695
|
+
"2k": "1440p",
|
|
13696
|
+
"4k": "2160p"
|
|
13697
|
+
};
|
|
13698
|
+
function ltxGenerate(fast, req, ctx) {
|
|
13699
|
+
const resolution = resolutionOf2(req, ctx);
|
|
13700
|
+
const duration = wholeSeconds(req, ctx);
|
|
13701
|
+
const input = {
|
|
13702
|
+
prompt: req.prompt.trim(),
|
|
13703
|
+
duration,
|
|
13704
|
+
resolution: LTX_TIERS[resolution],
|
|
13705
|
+
generate_audio: req.generateAudio ?? true
|
|
13706
|
+
};
|
|
13707
|
+
if (req.safetyChecker !== void 0) input["enable_safety_checker"] = req.safetyChecker;
|
|
13708
|
+
const firstFrame = req.firstFrame;
|
|
13709
|
+
const endpoint = firstFrame === void 0 ? fast ? LTX_FAST_T2V2 : LTX_T2V2 : fast ? LTX_FAST_I2V : LTX_I2V;
|
|
13710
|
+
if (firstFrame === void 0) {
|
|
13711
|
+
const ratio = concreteRatio(req);
|
|
13712
|
+
if (ratio !== void 0) input["aspect_ratio"] = ratio;
|
|
13713
|
+
} else {
|
|
13714
|
+
input["image_url"] = refToUrl(firstFrame);
|
|
13715
|
+
if (req.lastFrame !== void 0) input["end_image_url"] = refToUrl(req.lastFrame);
|
|
13716
|
+
if (req.aspectRatio !== void 0) {
|
|
13717
|
+
input["aspect_ratio"] = req.aspectRatio === "adaptive" ? "auto" : req.aspectRatio;
|
|
13718
|
+
}
|
|
13719
|
+
}
|
|
13720
|
+
return { endpoint, input, resolution, seconds: requestedSeconds(duration) };
|
|
13721
|
+
}
|
|
13722
|
+
var LTX_MODEL_IDS = /* @__PURE__ */ new Set([
|
|
13723
|
+
LTX_T2V2,
|
|
13724
|
+
LTX_I2V,
|
|
13725
|
+
LTX_FAST_T2V2,
|
|
13726
|
+
LTX_FAST_I2V
|
|
13727
|
+
]);
|
|
13728
|
+
var ltxFamily = {
|
|
13729
|
+
ids: LTX_MODEL_IDS,
|
|
13730
|
+
plan(req, ctx) {
|
|
13731
|
+
const id = ctx.model.providerModelId.toLowerCase();
|
|
13732
|
+
return ltxGenerate(id === LTX_FAST_T2V2 || id === LTX_FAST_I2V, req, ctx);
|
|
13733
|
+
}
|
|
13734
|
+
};
|
|
13735
|
+
|
|
13594
13736
|
// src/adapters/fal-minimax-h3.ts
|
|
13595
13737
|
var TURBO = "minimax/h3-max-turbo";
|
|
13596
13738
|
var INSERT = MINIMAX_H3_INSERT;
|
|
@@ -13761,6 +13903,7 @@ var FAMILIES2 = [
|
|
|
13761
13903
|
klingV4Family,
|
|
13762
13904
|
minimaxH3MaxFamily,
|
|
13763
13905
|
happyHorseFamily,
|
|
13906
|
+
ltxFamily,
|
|
13764
13907
|
viduFamily,
|
|
13765
13908
|
omnihumanFamily,
|
|
13766
13909
|
avatarFamily
|