@shop-os/modelkit 0.29.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/CHANGELOG.md +24 -0
- package/dist/catalog.cjs +181 -17
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.js +181 -17
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +261 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +261 -38
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,30 @@ header in the release PR.
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
+
## [0.31.0] - Unreleased
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- `ltx-2.5` and `ltx-2.5-fast` (ENG-4326): Lightricks LTX 2.5 Pro and Fast on fal partner endpoints
|
|
16
|
+
`lightricks/ltx-2.5/{text,image}-to-video/{pro,fast}`, on the LTX 2.3 adapter (`adapters/fal-ltx.ts`):
|
|
17
|
+
a start frame routes to image-to-video (with an optional end frame), else text-to-video. Pro renders
|
|
18
|
+
720p or 1080p, 6/8/10 s; Fast renders 720p to 2160p (`2k`/`4k`), even 6-20 s, over 10 s at 720p or
|
|
19
|
+
1080p only. LTX 2.5 has no safety-checker field, so the rows do not support `safetyChecker`. No new
|
|
20
|
+
vocabulary.
|
|
21
|
+
|
|
22
|
+
### Live rows to add after publish
|
|
23
|
+
- Pricing rows (shopos + sloosh, every env) for `ltx-2.5` 720p/1080p and `ltx-2.5-fast` 720p/1080p/2k/4k.
|
|
24
|
+
|
|
25
|
+
## [0.30.0] - Unreleased
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
- `ideogram-4.6` image row on the fal adapter (`ideogram/v4.6`), generation only. `aspectRatio` + `size` (`2K` or `4K`, default `2K`) pick one of fal's fixed sizes, and `exactSize` is sent as given. `quality` is `low`, `medium` or `high`; `auto` sends nothing and fal uses `medium`. fal's prompt expansion is off (the edit endpoint has no such field). It takes no reference images: the edit-only `very_low` tier and masked edits are not exposed.
|
|
29
|
+
- `ideogram-4.6-edit` image row for Precise Edit, on the same `ideogram/v4.6` provider model; the adapter routes there on references. It requires at least one reference (up to 5): the first is the image to edit (`image_url`), the rest (up to 4) are `reference_image_urls`, the output keeps the source size, and `edit_precision` is always `high`. It is a separate row because fal charges edits more than generates and the image price table is keyed by the model row; `size` picks the billed tier.
|
|
30
|
+
|
|
31
|
+
fal bills any output above 2048x2048 px in area at the 4K price, so both rows report the delivered image's tier on the usage event: an edit bills the size it kept, and a generate bills its exact size's area. An `exactSize` needs 256 to 4096 px per side, in multiples of 32, within 1:6; anything else is refused before the call, and an accepted one sets `size` to its area's tier so the quote and the hold price it right.
|
|
32
|
+
|
|
33
|
+
### Live rows to add after publish
|
|
34
|
+
Add the `ideogram-4.6` and `ideogram-4.6-edit` rows to pro-backend's `model_catalog` only after their per-quality image prices exist and every app that will call them runs 0.30.0. An older kit sends `ideogram-4.6` down the Muse path, so every generate fails.
|
|
35
|
+
|
|
12
36
|
## [0.29.0] - Unreleased
|
|
13
37
|
|
|
14
38
|
### Added
|
package/dist/catalog.cjs
CHANGED
|
@@ -996,6 +996,65 @@ var IMAGE_MODELS = [
|
|
|
996
996
|
description: "Ideogram's precise edit model: repeated edits keep the untouched pixels and colours intact, at the source's native resolution. Also generates from text."
|
|
997
997
|
}
|
|
998
998
|
},
|
|
999
|
+
{
|
|
1000
|
+
// Generation only: fal charges edits more, so editing is its own row
|
|
1001
|
+
// (ideogram-4.6-edit) with its own prices. fal bills any output above
|
|
1002
|
+
// 2048x2048 in area at the 4K price; very_low renders at most 2K, so it is
|
|
1003
|
+
// not exposed (no 4K price exists for it, and the catalog seed gate needs
|
|
1004
|
+
// every size x quality priced). https://fal.ai/models/ideogram/v4.6
|
|
1005
|
+
id: "ideogram-4.6",
|
|
1006
|
+
aliases: [],
|
|
1007
|
+
label: "Ideogram 4.6",
|
|
1008
|
+
type: "image",
|
|
1009
|
+
adapter: "fal",
|
|
1010
|
+
providerModelId: "ideogram/v4.6",
|
|
1011
|
+
lifecycle: "active",
|
|
1012
|
+
exposure: ["cowork", "space_builder"],
|
|
1013
|
+
constraints: {
|
|
1014
|
+
aspectRatios: ["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "5:4", "4:5"],
|
|
1015
|
+
sizes: ["2K", "4K"],
|
|
1016
|
+
qualityOptions: ["auto", "low", "medium", "high"],
|
|
1017
|
+
references: { images: 0 },
|
|
1018
|
+
supports: ["quality", "count", "seed"]
|
|
1019
|
+
},
|
|
1020
|
+
defaults: { size: "2K", aspectRatio: "1:1", quality: "medium", count: 1 },
|
|
1021
|
+
usage: { ...IMAGE_USAGE3, slug: "ideogram" },
|
|
1022
|
+
pricingKind: "image_size",
|
|
1023
|
+
display: {
|
|
1024
|
+
provider: "ideogram",
|
|
1025
|
+
description: "Ideogram 4.6 text-to-image from a prompt, at 2K or 4K. Edits go to Ideogram 4.6 Edit."
|
|
1026
|
+
}
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
// Precise Edit only: references switch to the /edit endpoint, where the
|
|
1030
|
+
// first is the image to edit and the rest (up to 4) guide it, so 5 images
|
|
1031
|
+
// in all. The output keeps the source size, so `size` only picks the
|
|
1032
|
+
// billed tier. Same provider model as the generate row, whose adapter
|
|
1033
|
+
// routes on references. https://fal.ai/models/ideogram/v4.6/edit
|
|
1034
|
+
id: "ideogram-4.6-edit",
|
|
1035
|
+
aliases: [],
|
|
1036
|
+
label: "Ideogram 4.6 Edit",
|
|
1037
|
+
type: "image",
|
|
1038
|
+
adapter: "fal",
|
|
1039
|
+
providerModelId: "ideogram/v4.6",
|
|
1040
|
+
lifecycle: "active",
|
|
1041
|
+
exposure: ["cowork", "space_builder"],
|
|
1042
|
+
constraints: {
|
|
1043
|
+
aspectRatios: ["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "5:4", "4:5"],
|
|
1044
|
+
sizes: ["2K", "4K"],
|
|
1045
|
+
qualityOptions: ["auto", "low", "medium", "high"],
|
|
1046
|
+
references: { images: 5 },
|
|
1047
|
+
requires: ["references"],
|
|
1048
|
+
supports: ["quality", "count", "seed"]
|
|
1049
|
+
},
|
|
1050
|
+
defaults: { size: "2K", aspectRatio: "1:1", quality: "medium", count: 1 },
|
|
1051
|
+
usage: { ...IMAGE_USAGE3, slug: "ideogram" },
|
|
1052
|
+
pricingKind: "image_size",
|
|
1053
|
+
display: {
|
|
1054
|
+
provider: "ideogram",
|
|
1055
|
+
description: "Ideogram 4.6 Precise Edit: the first image is edited and up to 4 more guide it. Repeated edits keep the untouched pixels and colours intact, and the output keeps the source size."
|
|
1056
|
+
}
|
|
1057
|
+
},
|
|
999
1058
|
{
|
|
1000
1059
|
id: "seedream-5-0-pro",
|
|
1001
1060
|
aliases: ["seedream-4-5"],
|
|
@@ -6293,6 +6352,76 @@ var VIDEO_FAMILY_MODELS = [
|
|
|
6293
6352
|
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."
|
|
6294
6353
|
},
|
|
6295
6354
|
capabilities: { lastFrameRequiresFirstFrame: true }
|
|
6355
|
+
},
|
|
6356
|
+
{
|
|
6357
|
+
// https://fal.ai/models/lightricks/ltx-2.5/text-to-video/pro/api (+ /image-to-video/pro):
|
|
6358
|
+
// a Lightricks partner endpoint on fal. Pro renders 720p and 1080p only, 6/8/10 s;
|
|
6359
|
+
// no safety checker field. Routing and tiers as LTX 2.3 (adapters/fal-ltx.ts).
|
|
6360
|
+
id: "ltx-2.5",
|
|
6361
|
+
aliases: ["ltx-2-5", "ltx25", "ltx-2.5-pro"],
|
|
6362
|
+
label: "LTX 2.5",
|
|
6363
|
+
type: "video",
|
|
6364
|
+
adapter: "fal",
|
|
6365
|
+
providerModelId: "lightricks/ltx-2.5/text-to-video/pro",
|
|
6366
|
+
lifecycle: "active",
|
|
6367
|
+
exposure: ["cowork", "space_builder"],
|
|
6368
|
+
constraints: {
|
|
6369
|
+
aspectRatios: ["adaptive", "16:9", "9:16"],
|
|
6370
|
+
resolutions: ["720p", "1080p"],
|
|
6371
|
+
durations: [6, 8, 10],
|
|
6372
|
+
supports: ["generateAudio", "lastFrame"],
|
|
6373
|
+
prompt: { referenceSyntax: "numbered", maxChars: 5e3 },
|
|
6374
|
+
audio: "optional"
|
|
6375
|
+
},
|
|
6376
|
+
defaults: {
|
|
6377
|
+
durationSeconds: 6,
|
|
6378
|
+
resolution: "1080p",
|
|
6379
|
+
aspectRatio: "adaptive",
|
|
6380
|
+
generateAudio: true
|
|
6381
|
+
},
|
|
6382
|
+
usage: { ...VIDEO_USAGE },
|
|
6383
|
+
pricingKind: "video_per_second",
|
|
6384
|
+
display: {
|
|
6385
|
+
provider: "lightricks",
|
|
6386
|
+
logo: LIGHTRICKS_LOGO,
|
|
6387
|
+
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."
|
|
6388
|
+
},
|
|
6389
|
+
capabilities: { lastFrameRequiresFirstFrame: true }
|
|
6390
|
+
},
|
|
6391
|
+
{
|
|
6392
|
+
// https://fal.ai/models/lightricks/ltx-2.5/text-to-video/fast/api (+ /image-to-video/fast):
|
|
6393
|
+
// 720p to 2160p, even durations 6-20 s; over 10 s is 720p or 1080p at 24/25 fps only
|
|
6394
|
+
// (the kit never sends fps, so the rule checks the tier).
|
|
6395
|
+
id: "ltx-2.5-fast",
|
|
6396
|
+
aliases: ["ltx-2-5-fast", "ltx25-fast"],
|
|
6397
|
+
label: "LTX 2.5 Fast",
|
|
6398
|
+
type: "video",
|
|
6399
|
+
adapter: "fal",
|
|
6400
|
+
providerModelId: "lightricks/ltx-2.5/text-to-video/fast",
|
|
6401
|
+
lifecycle: "active",
|
|
6402
|
+
exposure: ["cowork", "space_builder"],
|
|
6403
|
+
constraints: {
|
|
6404
|
+
aspectRatios: ["adaptive", "16:9", "9:16"],
|
|
6405
|
+
resolutions: ["720p", "1080p", "2k", "4k"],
|
|
6406
|
+
durations: [6, 8, 10, 12, 14, 16, 18, 20],
|
|
6407
|
+
supports: ["generateAudio", "lastFrame"],
|
|
6408
|
+
prompt: { referenceSyntax: "numbered", maxChars: 5e3 },
|
|
6409
|
+
audio: "optional"
|
|
6410
|
+
},
|
|
6411
|
+
defaults: {
|
|
6412
|
+
durationSeconds: 6,
|
|
6413
|
+
resolution: "1080p",
|
|
6414
|
+
aspectRatio: "adaptive",
|
|
6415
|
+
generateAudio: true
|
|
6416
|
+
},
|
|
6417
|
+
usage: { ...VIDEO_USAGE },
|
|
6418
|
+
pricingKind: "video_per_second",
|
|
6419
|
+
display: {
|
|
6420
|
+
provider: "lightricks",
|
|
6421
|
+
logo: LIGHTRICKS_LOGO,
|
|
6422
|
+
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."
|
|
6423
|
+
},
|
|
6424
|
+
capabilities: { lastFrameRequiresFirstFrame: true }
|
|
6296
6425
|
}
|
|
6297
6426
|
];
|
|
6298
6427
|
|
|
@@ -10001,6 +10130,17 @@ function falImageSpec(providerModelId) {
|
|
|
10001
10130
|
}
|
|
10002
10131
|
var AREA_1K = 1024 * 1024;
|
|
10003
10132
|
var AREA_2K = 2048 * 2048;
|
|
10133
|
+
var IDEOGRAM_46_EXACT = {
|
|
10134
|
+
minSide: 256,
|
|
10135
|
+
maxSide: 4096,
|
|
10136
|
+
minArea: 256 * 256,
|
|
10137
|
+
maxArea: 4096 * 4096,
|
|
10138
|
+
multipleOf: 32,
|
|
10139
|
+
maxAspect: 6,
|
|
10140
|
+
minTier: "2K",
|
|
10141
|
+
topTier: "4K"
|
|
10142
|
+
};
|
|
10143
|
+
var IDEOGRAM_46_IDS = /* @__PURE__ */ new Set(["ideogram/v4.6"]);
|
|
10004
10144
|
function checkExactSize(exact, b) {
|
|
10005
10145
|
const match = /^(\d+)x(\d+)$/.exec(exact);
|
|
10006
10146
|
if (match === null) {
|
|
@@ -10024,7 +10164,7 @@ function checkExactSize(exact, b) {
|
|
|
10024
10164
|
return { ok: true, size: { width, height, tier: exactTier(area, b) } };
|
|
10025
10165
|
}
|
|
10026
10166
|
function exactTier(area, b) {
|
|
10027
|
-
if (area <= AREA_1K) return "1K";
|
|
10167
|
+
if (area <= AREA_1K) return b.minTier ?? "1K";
|
|
10028
10168
|
if (b.topTier === void 0 || area <= AREA_2K) return "2K";
|
|
10029
10169
|
return b.topTier;
|
|
10030
10170
|
}
|
|
@@ -10086,23 +10226,43 @@ function falImageProblem(spec, req) {
|
|
|
10086
10226
|
}
|
|
10087
10227
|
function falExactSize(spec, req) {
|
|
10088
10228
|
if (req.exactSize === void 0 || spec.exactSize === void 0) return void 0;
|
|
10089
|
-
|
|
10229
|
+
return checkedExactSize(req.exactSize, spec.exactSize);
|
|
10230
|
+
}
|
|
10231
|
+
function checkedExactSize(exact, bounds) {
|
|
10232
|
+
const check = checkExactSize(exact, bounds);
|
|
10090
10233
|
return check.ok ? check.size : void 0;
|
|
10091
10234
|
}
|
|
10235
|
+
function ideogram46ExactSize(model, req) {
|
|
10236
|
+
if (req.exactSize === void 0) return void 0;
|
|
10237
|
+
const check = checkExactSize(req.exactSize, IDEOGRAM_46_EXACT);
|
|
10238
|
+
if (check.ok) return check.size;
|
|
10239
|
+
throw new ModelKitError({
|
|
10240
|
+
code: "unsupported_option",
|
|
10241
|
+
message: `${model.label}: ${check.message}`,
|
|
10242
|
+
model: model.id,
|
|
10243
|
+
retryable: false
|
|
10244
|
+
});
|
|
10245
|
+
}
|
|
10092
10246
|
function applyFalImageRules(model, req, callerSize, warnings) {
|
|
10093
10247
|
if (model.adapter !== "fal" && model.adapter !== "alibaba") return;
|
|
10094
10248
|
const spec = falImageSpec(model.providerModelId);
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10249
|
+
const ideogram46 = IDEOGRAM_46_IDS.has(model.providerModelId.toLowerCase());
|
|
10250
|
+
if (spec === void 0 && !ideogram46) return;
|
|
10251
|
+
let exact;
|
|
10252
|
+
if (spec === void 0) {
|
|
10253
|
+
exact = ideogram46ExactSize(model, req);
|
|
10254
|
+
} else {
|
|
10255
|
+
const problem = falImageProblem(spec, withPromptForResolve(req));
|
|
10256
|
+
if (problem !== void 0) {
|
|
10257
|
+
throw new ModelKitError({
|
|
10258
|
+
code: problem.code,
|
|
10259
|
+
message: problem.message,
|
|
10260
|
+
model: model.id,
|
|
10261
|
+
retryable: false
|
|
10262
|
+
});
|
|
10263
|
+
}
|
|
10264
|
+
exact = falExactSize(spec, req);
|
|
10104
10265
|
}
|
|
10105
|
-
const exact = falExactSize(spec, req);
|
|
10106
10266
|
if (exact === void 0) return;
|
|
10107
10267
|
if (callerSize !== void 0 && callerSize !== exact.tier) {
|
|
10108
10268
|
warnings.push({
|
|
@@ -10159,6 +10319,8 @@ var VIDU_Q4 = "fal-ai/vidu/q4";
|
|
|
10159
10319
|
var OMNIHUMAN_V2 = "bytedance/omnihuman/v2";
|
|
10160
10320
|
var LTX_T2V = "fal-ai/ltx-2.3/text-to-video";
|
|
10161
10321
|
var LTX_FAST_T2V = "fal-ai/ltx-2.3/text-to-video/fast";
|
|
10322
|
+
var LTX25_T2V = "lightricks/ltx-2.5/text-to-video/pro";
|
|
10323
|
+
var LTX25_FAST_T2V = "lightricks/ltx-2.5/text-to-video/fast";
|
|
10162
10324
|
var KLING_O3_IMAGE_CAP = 7;
|
|
10163
10325
|
var KLING_V4_IMAGE_CAP = 10;
|
|
10164
10326
|
var TURBO_AUDIO_MIN_SECONDS = 2;
|
|
@@ -10335,7 +10497,7 @@ function imageAndAudio(req, audioSeconds) {
|
|
|
10335
10497
|
}
|
|
10336
10498
|
return inputSeconds("audio", audio, audioSeconds);
|
|
10337
10499
|
}
|
|
10338
|
-
function ltx(
|
|
10500
|
+
function ltx(longTiers) {
|
|
10339
10501
|
return (req) => {
|
|
10340
10502
|
if (req.lastFrame !== void 0 && req.firstFrame === void 0) {
|
|
10341
10503
|
return missing("takes an end frame only together with a start frame");
|
|
@@ -10343,8 +10505,8 @@ function ltx(fast) {
|
|
|
10343
10505
|
if (count(req.referenceImages) + count(req.referenceVideos) + count(req.referenceAudios) > 0) {
|
|
10344
10506
|
return unsupported2("takes no reference images, videos or audio");
|
|
10345
10507
|
}
|
|
10346
|
-
if (
|
|
10347
|
-
return unsupported2(
|
|
10508
|
+
if (longTiers !== null && (req.durationSeconds ?? 6) > 10 && req.resolution !== void 0 && !longTiers.includes(req.resolution)) {
|
|
10509
|
+
return unsupported2(`renders over 10 s at ${longTiers.join(" or ")} only`);
|
|
10348
10510
|
}
|
|
10349
10511
|
return needsPrompt(req);
|
|
10350
10512
|
};
|
|
@@ -10373,8 +10535,10 @@ var RULES = new Map([
|
|
|
10373
10535
|
...AVATAR_AUDIO.map(
|
|
10374
10536
|
([id, limits]) => [id, (req) => imageAndAudio(req, limits)]
|
|
10375
10537
|
),
|
|
10376
|
-
[LTX_T2V, ltx(
|
|
10377
|
-
[LTX_FAST_T2V, ltx(
|
|
10538
|
+
[LTX_T2V, ltx(null)],
|
|
10539
|
+
[LTX_FAST_T2V, ltx(["1080p"])],
|
|
10540
|
+
[LTX25_T2V, ltx(null)],
|
|
10541
|
+
[LTX25_FAST_T2V, ltx(["720p", "1080p"])]
|
|
10378
10542
|
]);
|
|
10379
10543
|
function falVideoProblem(providerModelId, req) {
|
|
10380
10544
|
return RULES.get(providerModelId.toLowerCase())?.(req);
|