@shop-os/modelkit 0.3.3 → 0.3.5
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 +19 -0
- package/dist/catalog.cjs +69 -8
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +10 -1
- package/dist/catalog.d.ts +10 -1
- package/dist/catalog.js +69 -8
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +80 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +80 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/catalog.d.cts
CHANGED
|
@@ -149,6 +149,8 @@ interface VideoToolRequest {
|
|
|
149
149
|
source: VideoToolSource;
|
|
150
150
|
/** Upscale rows. */
|
|
151
151
|
upscaleFactor?: number;
|
|
152
|
+
/** Upscale rows whose `constraints.tool.prompt` is set; ignored by every other row. */
|
|
153
|
+
prompt?: string;
|
|
152
154
|
/** Interpolate rows. */
|
|
153
155
|
targetFps?: number;
|
|
154
156
|
/** HDR rows; the row's first `outputFormats` entry when unset. */
|
|
@@ -271,6 +273,8 @@ interface VideoToolConstraints {
|
|
|
271
273
|
};
|
|
272
274
|
/** Upscale: the output's long edge may not pass this, in pixels. */
|
|
273
275
|
maxOutputLongEdge?: number;
|
|
276
|
+
/** Upscale: the row takes an optional prompt that guides added detail. */
|
|
277
|
+
prompt?: boolean;
|
|
274
278
|
/** Interpolate: allowed target frame rate range. */
|
|
275
279
|
fps?: {
|
|
276
280
|
min: number;
|
|
@@ -794,6 +798,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
794
798
|
max: z.ZodNumber;
|
|
795
799
|
}, z.core.$loose>>;
|
|
796
800
|
maxOutputLongEdge: z.ZodOptional<z.ZodNumber>;
|
|
801
|
+
prompt: z.ZodOptional<z.ZodBoolean>;
|
|
797
802
|
fps: z.ZodOptional<z.ZodObject<{
|
|
798
803
|
min: z.ZodNumber;
|
|
799
804
|
max: z.ZodNumber;
|
|
@@ -1065,7 +1070,11 @@ declare const VIDEO_MODELS: CatalogModel[];
|
|
|
1065
1070
|
|
|
1066
1071
|
/**
|
|
1067
1072
|
* Topaz Labs video tools on fal. `providerOptions.fal.model` names the Topaz model the
|
|
1068
|
-
* endpoint runs; the adapter sends it as `model`.
|
|
1073
|
+
* endpoint runs; the adapter sends it as `model`. Precision and Starlight are also listed in
|
|
1074
|
+
* Space Builder's video upscale node.
|
|
1075
|
+
*
|
|
1076
|
+
* FLUX video upscale on fal: one endpoint, two rows, because fal prices its `creativity`
|
|
1077
|
+
* modes differently and pricing is keyed by model. `providerOptions.fal.input` fixes the mode.
|
|
1069
1078
|
*/
|
|
1070
1079
|
declare const VIDEO_TOOL_MODELS: CatalogModel[];
|
|
1071
1080
|
|
package/dist/catalog.d.ts
CHANGED
|
@@ -149,6 +149,8 @@ interface VideoToolRequest {
|
|
|
149
149
|
source: VideoToolSource;
|
|
150
150
|
/** Upscale rows. */
|
|
151
151
|
upscaleFactor?: number;
|
|
152
|
+
/** Upscale rows whose `constraints.tool.prompt` is set; ignored by every other row. */
|
|
153
|
+
prompt?: string;
|
|
152
154
|
/** Interpolate rows. */
|
|
153
155
|
targetFps?: number;
|
|
154
156
|
/** HDR rows; the row's first `outputFormats` entry when unset. */
|
|
@@ -271,6 +273,8 @@ interface VideoToolConstraints {
|
|
|
271
273
|
};
|
|
272
274
|
/** Upscale: the output's long edge may not pass this, in pixels. */
|
|
273
275
|
maxOutputLongEdge?: number;
|
|
276
|
+
/** Upscale: the row takes an optional prompt that guides added detail. */
|
|
277
|
+
prompt?: boolean;
|
|
274
278
|
/** Interpolate: allowed target frame rate range. */
|
|
275
279
|
fps?: {
|
|
276
280
|
min: number;
|
|
@@ -794,6 +798,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
794
798
|
max: z.ZodNumber;
|
|
795
799
|
}, z.core.$loose>>;
|
|
796
800
|
maxOutputLongEdge: z.ZodOptional<z.ZodNumber>;
|
|
801
|
+
prompt: z.ZodOptional<z.ZodBoolean>;
|
|
797
802
|
fps: z.ZodOptional<z.ZodObject<{
|
|
798
803
|
min: z.ZodNumber;
|
|
799
804
|
max: z.ZodNumber;
|
|
@@ -1065,7 +1070,11 @@ declare const VIDEO_MODELS: CatalogModel[];
|
|
|
1065
1070
|
|
|
1066
1071
|
/**
|
|
1067
1072
|
* Topaz Labs video tools on fal. `providerOptions.fal.model` names the Topaz model the
|
|
1068
|
-
* endpoint runs; the adapter sends it as `model`.
|
|
1073
|
+
* endpoint runs; the adapter sends it as `model`. Precision and Starlight are also listed in
|
|
1074
|
+
* Space Builder's video upscale node.
|
|
1075
|
+
*
|
|
1076
|
+
* FLUX video upscale on fal: one endpoint, two rows, because fal prices its `creativity`
|
|
1077
|
+
* modes differently and pricing is keyed by model. `providerOptions.fal.input` fixes the mode.
|
|
1069
1078
|
*/
|
|
1070
1079
|
declare const VIDEO_TOOL_MODELS: CatalogModel[];
|
|
1071
1080
|
|
package/dist/catalog.js
CHANGED
|
@@ -2002,8 +2002,16 @@ var VIDEO_MODELS = [
|
|
|
2002
2002
|
|
|
2003
2003
|
// src/catalog/video-tools.ts
|
|
2004
2004
|
var TOPAZ_LOGO = "https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@1.97.0/light/topazlabs.png";
|
|
2005
|
+
var FLUX_LOGO = "https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@1.97.0/light/flux.png";
|
|
2005
2006
|
var TOPAZ_SOURCE_SECONDS = { max: 300 };
|
|
2006
|
-
var
|
|
2007
|
+
var SECONDS_USAGE = { unit: "seconds" };
|
|
2008
|
+
var FLUX_SOURCE_SECONDS = { max: 20 };
|
|
2009
|
+
var FLUX_UPSCALE_TOOL = {
|
|
2010
|
+
kind: "upscale",
|
|
2011
|
+
upscaleFactor: { min: 1.5, max: 3 },
|
|
2012
|
+
maxOutputLongEdge: 3840,
|
|
2013
|
+
prompt: true
|
|
2014
|
+
};
|
|
2007
2015
|
var VIDEO_TOOL_MODELS = [
|
|
2008
2016
|
{
|
|
2009
2017
|
id: "topaz-precision",
|
|
@@ -2013,7 +2021,7 @@ var VIDEO_TOOL_MODELS = [
|
|
|
2013
2021
|
adapter: "fal",
|
|
2014
2022
|
providerModelId: "topaz/upscale/video/precision",
|
|
2015
2023
|
lifecycle: "active",
|
|
2016
|
-
exposure: ["cowork"],
|
|
2024
|
+
exposure: ["cowork", "space_builder"],
|
|
2017
2025
|
constraints: {
|
|
2018
2026
|
supports: [],
|
|
2019
2027
|
sourceVideoSeconds: TOPAZ_SOURCE_SECONDS,
|
|
@@ -2021,7 +2029,7 @@ var VIDEO_TOOL_MODELS = [
|
|
|
2021
2029
|
},
|
|
2022
2030
|
defaults: {},
|
|
2023
2031
|
providerOptions: { fal: { model: "Proteus" } },
|
|
2024
|
-
usage:
|
|
2032
|
+
usage: SECONDS_USAGE,
|
|
2025
2033
|
pricingKind: "video_per_second",
|
|
2026
2034
|
display: {
|
|
2027
2035
|
provider: "topaz",
|
|
@@ -2038,7 +2046,7 @@ var VIDEO_TOOL_MODELS = [
|
|
|
2038
2046
|
adapter: "fal",
|
|
2039
2047
|
providerModelId: "topaz/upscale/video/generative",
|
|
2040
2048
|
lifecycle: "active",
|
|
2041
|
-
exposure: ["cowork"],
|
|
2049
|
+
exposure: ["cowork", "space_builder"],
|
|
2042
2050
|
constraints: {
|
|
2043
2051
|
supports: [],
|
|
2044
2052
|
sourceVideoSeconds: TOPAZ_SOURCE_SECONDS,
|
|
@@ -2046,7 +2054,7 @@ var VIDEO_TOOL_MODELS = [
|
|
|
2046
2054
|
},
|
|
2047
2055
|
defaults: {},
|
|
2048
2056
|
providerOptions: { fal: { model: "Starlight Precise 2.6" } },
|
|
2049
|
-
usage:
|
|
2057
|
+
usage: SECONDS_USAGE,
|
|
2050
2058
|
pricingKind: "video_per_second",
|
|
2051
2059
|
display: {
|
|
2052
2060
|
provider: "topaz",
|
|
@@ -2071,7 +2079,7 @@ var VIDEO_TOOL_MODELS = [
|
|
|
2071
2079
|
},
|
|
2072
2080
|
defaults: {},
|
|
2073
2081
|
providerOptions: { fal: { model: "Apollo" } },
|
|
2074
|
-
usage:
|
|
2082
|
+
usage: SECONDS_USAGE,
|
|
2075
2083
|
pricingKind: "video_per_second",
|
|
2076
2084
|
display: {
|
|
2077
2085
|
provider: "topaz",
|
|
@@ -2094,13 +2102,63 @@ var VIDEO_TOOL_MODELS = [
|
|
|
2094
2102
|
tool: { kind: "hdr", outputFormats: ["h265", "prores"] }
|
|
2095
2103
|
},
|
|
2096
2104
|
defaults: {},
|
|
2097
|
-
usage:
|
|
2105
|
+
usage: SECONDS_USAGE,
|
|
2098
2106
|
pricingKind: "video_per_second",
|
|
2099
2107
|
display: {
|
|
2100
2108
|
provider: "topaz",
|
|
2101
2109
|
logo: TOPAZ_LOGO,
|
|
2102
2110
|
description: "Topaz Hyperion 2.5 SDR to HDR: a 10-bit HDR master in H.265 (HDR10) or ProRes 422 HQ, at the source's size and frame rate."
|
|
2103
2111
|
}
|
|
2112
|
+
},
|
|
2113
|
+
{
|
|
2114
|
+
id: "flux-video-upscale-precise",
|
|
2115
|
+
aliases: [],
|
|
2116
|
+
label: "FLUX Upscale Precise",
|
|
2117
|
+
type: "video-tool",
|
|
2118
|
+
adapter: "fal",
|
|
2119
|
+
providerModelId: "blackforestlabs/flux-video-upscale",
|
|
2120
|
+
lifecycle: "active",
|
|
2121
|
+
exposure: ["space_builder"],
|
|
2122
|
+
constraints: {
|
|
2123
|
+
supports: [],
|
|
2124
|
+
sourceVideoSeconds: FLUX_SOURCE_SECONDS,
|
|
2125
|
+
tool: FLUX_UPSCALE_TOOL
|
|
2126
|
+
},
|
|
2127
|
+
defaults: {},
|
|
2128
|
+
providerOptions: { fal: { input: { creativity: 0 } } },
|
|
2129
|
+
usage: SECONDS_USAGE,
|
|
2130
|
+
pricingKind: "video_per_second",
|
|
2131
|
+
display: {
|
|
2132
|
+
provider: "black-forest-labs",
|
|
2133
|
+
logo: FLUX_LOGO,
|
|
2134
|
+
description: "FLUX 3 super-resolution, source-faithful: 1.5x to 3x, up to 4K, for clips up to 20 seconds.",
|
|
2135
|
+
sortOrder: 30
|
|
2136
|
+
}
|
|
2137
|
+
},
|
|
2138
|
+
{
|
|
2139
|
+
id: "flux-video-upscale-creative",
|
|
2140
|
+
aliases: [],
|
|
2141
|
+
label: "FLUX Upscale Creative",
|
|
2142
|
+
type: "video-tool",
|
|
2143
|
+
adapter: "fal",
|
|
2144
|
+
providerModelId: "blackforestlabs/flux-video-upscale",
|
|
2145
|
+
lifecycle: "active",
|
|
2146
|
+
exposure: ["space_builder"],
|
|
2147
|
+
constraints: {
|
|
2148
|
+
supports: [],
|
|
2149
|
+
sourceVideoSeconds: FLUX_SOURCE_SECONDS,
|
|
2150
|
+
tool: FLUX_UPSCALE_TOOL
|
|
2151
|
+
},
|
|
2152
|
+
defaults: {},
|
|
2153
|
+
providerOptions: { fal: { input: { creativity: 1 } } },
|
|
2154
|
+
usage: SECONDS_USAGE,
|
|
2155
|
+
pricingKind: "video_per_second",
|
|
2156
|
+
display: {
|
|
2157
|
+
provider: "black-forest-labs",
|
|
2158
|
+
logo: FLUX_LOGO,
|
|
2159
|
+
description: "FLUX 3 super-resolution that adds fine detail, optionally guided by a prompt: 1.5x to 3x, up to 4K, for clips up to 20 seconds. Costs more than Precise.",
|
|
2160
|
+
sortOrder: 40
|
|
2161
|
+
}
|
|
2104
2162
|
}
|
|
2105
2163
|
];
|
|
2106
2164
|
|
|
@@ -2607,6 +2665,7 @@ var VideoToolConstraintsSchema = z3.looseObject({
|
|
|
2607
2665
|
kind: z3.enum(["upscale", "interpolate", "hdr"]),
|
|
2608
2666
|
upscaleFactor: RangeSchema.optional(),
|
|
2609
2667
|
maxOutputLongEdge: z3.number().positive().optional(),
|
|
2668
|
+
prompt: z3.boolean().optional(),
|
|
2610
2669
|
fps: RangeSchema.optional(),
|
|
2611
2670
|
outputFormats: z3.array(z3.enum(["h265", "prores"])).min(1).optional()
|
|
2612
2671
|
});
|
|
@@ -3065,6 +3124,7 @@ var ToolSchema = z6.object({
|
|
|
3065
3124
|
kind: z6.enum(["upscale", "interpolate", "hdr"]),
|
|
3066
3125
|
upscaleFactor: RangeSchema2.optional(),
|
|
3067
3126
|
maxOutputLongEdge: z6.number().positive().optional(),
|
|
3127
|
+
prompt: z6.boolean().optional(),
|
|
3068
3128
|
fps: RangeSchema2.optional(),
|
|
3069
3129
|
outputFormats: z6.array(z6.enum(["h265", "prores"])).min(1).optional()
|
|
3070
3130
|
});
|
|
@@ -3072,11 +3132,12 @@ function videoToolConstraints(row) {
|
|
|
3072
3132
|
if (row.type !== "video-tool") return void 0;
|
|
3073
3133
|
const parsed = ToolSchema.safeParse(row.constraints.tool);
|
|
3074
3134
|
if (!parsed.success) return void 0;
|
|
3075
|
-
const { kind, upscaleFactor, maxOutputLongEdge, fps, outputFormats } = parsed.data;
|
|
3135
|
+
const { kind, upscaleFactor, maxOutputLongEdge, prompt, fps, outputFormats } = parsed.data;
|
|
3076
3136
|
return {
|
|
3077
3137
|
kind,
|
|
3078
3138
|
...upscaleFactor !== void 0 && { upscaleFactor },
|
|
3079
3139
|
...maxOutputLongEdge !== void 0 && { maxOutputLongEdge },
|
|
3140
|
+
...prompt !== void 0 && { prompt },
|
|
3080
3141
|
...fps !== void 0 && { fps },
|
|
3081
3142
|
...outputFormats !== void 0 && { outputFormats }
|
|
3082
3143
|
};
|