@howells/motif-sdk 7.0.0 → 7.1.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/README.md +1 -1
- package/dist/image.d.ts +17 -22
- package/dist/image.js +17 -34
- package/dist/index.cjs +39 -64
- package/dist/index.d.cts +17 -26
- package/dist/index.d.ts +17 -26
- package/dist/index.js +39 -64
- package/dist/registry.d.ts +5 -12
- package/dist/registry.js +9 -18
- package/package.json +1 -1
package/dist/registry.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `@howells/motif-sdk/registry` — the Model and tool tables behind Task
|
|
3
|
+
* resolution, for callers that show or price Models themselves. Most callers
|
|
4
|
+
* want the Task client from the package root instead.
|
|
5
|
+
*/
|
|
2
6
|
/** ─── Model Types ─────────────────────────────────────────────── */
|
|
3
7
|
type AspectRatio = "auto" | "8:1" | "4:1" | "21:9" | "16:9" | "3:2" | "4:3" | "5:4" | "1:1" | "4:5" | "3:4" | "2:3" | "9:16" | "1:4" | "1:8";
|
|
4
8
|
type Resolution = "0.5K" | "1K" | "2K" | "4K";
|
|
@@ -139,22 +143,14 @@ interface ModelConfig {
|
|
|
139
143
|
/** Use fal queue submit/status/result even for generate() calls. */
|
|
140
144
|
useQueue?: boolean;
|
|
141
145
|
}
|
|
142
|
-
//#endregion
|
|
143
|
-
//#region src/aspects.d.ts
|
|
144
146
|
/** Pixel sizes of fal's named `image_size` presets. `auto` has none. */
|
|
145
147
|
export declare const FAL_PRESET_SIZES: Readonly<Record<string, CustomImageSize>>;
|
|
146
|
-
//#endregion
|
|
147
|
-
//#region src/cost.d.ts
|
|
148
148
|
/**
|
|
149
149
|
* Estimate cost based on model and settings. `editImages` is the number of
|
|
150
150
|
* input images on an edit, for Models whose edits cost more than generation.
|
|
151
151
|
*/
|
|
152
152
|
export declare function estimateCost(model: string, resolution?: Resolution, numImages?: number, editImages?: number): number | null;
|
|
153
|
-
//#endregion
|
|
154
|
-
//#region src/models.d.ts
|
|
155
153
|
export declare const MODELS: Record<string, ModelConfig>;
|
|
156
|
-
//#endregion
|
|
157
|
-
//#region src/tool-types.d.ts
|
|
158
154
|
type FalToolInputKind = "image" | "images" | "video";
|
|
159
155
|
/**
|
|
160
156
|
* Machine-readable cost, so `--dry-run` can emit a number rather than the
|
|
@@ -313,8 +309,6 @@ interface FalToolConfig {
|
|
|
313
309
|
sourceUrl: string;
|
|
314
310
|
task: string;
|
|
315
311
|
}
|
|
316
|
-
//#endregion
|
|
317
|
-
//#region src/tools.d.ts
|
|
318
312
|
export declare const FAL_TOOLS: {
|
|
319
313
|
readonly "got-ocr": {
|
|
320
314
|
readonly category: "analysis";
|
|
@@ -1753,5 +1747,4 @@ export declare const FAL_TOOLS: {
|
|
|
1753
1747
|
declare const FAL_TOOL_IDS: (keyof typeof FAL_TOOLS)[];
|
|
1754
1748
|
type FalToolId = (typeof FAL_TOOL_IDS)[number];
|
|
1755
1749
|
export declare function isFalToolId(tool: string): tool is FalToolId;
|
|
1756
|
-
//#endregion
|
|
1757
1750
|
export type { FalToolConfig, FalToolPrice, ModelConfig };
|
package/dist/registry.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/aspects.ts
|
|
2
2
|
/** Pixel sizes of fal's named `image_size` presets. `auto` has none. */
|
|
3
3
|
const FAL_PRESET_SIZES = {
|
|
4
4
|
landscape_16_9: {
|
|
@@ -26,8 +26,7 @@ const FAL_PRESET_SIZES = {
|
|
|
26
26
|
width: 1024
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
|
|
30
|
-
//#region src/models.ts
|
|
29
|
+
// src/models.ts
|
|
31
30
|
const AA_IMAGE_LEADERBOARD_SNAPSHOT = "2026-10-07";
|
|
32
31
|
const AA_IMAGE_SOURCES = ["https://artificialanalysis.ai/image/leaderboard/text-to-image", "https://artificialanalysis.ai/image/leaderboard/editing"];
|
|
33
32
|
const FAL_PRICING_CHECKED_AT = "2026-05-12";
|
|
@@ -1196,8 +1195,7 @@ const MODELS = {
|
|
|
1196
1195
|
"ideogram3-transparent",
|
|
1197
1196
|
"recraft41"
|
|
1198
1197
|
].filter((id) => MODELS[id]?.supportsEdit === true);
|
|
1199
|
-
|
|
1200
|
-
//#region src/cost.ts
|
|
1198
|
+
// src/cost.ts
|
|
1201
1199
|
/**
|
|
1202
1200
|
* Estimate cost based on model and settings. `editImages` is the number of
|
|
1203
1201
|
* input images on an edit, for Models whose edits cost more than generation.
|
|
@@ -1222,8 +1220,7 @@ function estimateCost(model, resolution, numImages = 1, editImages = 0) {
|
|
|
1222
1220
|
default: return .1 * numImages;
|
|
1223
1221
|
}
|
|
1224
1222
|
}
|
|
1225
|
-
|
|
1226
|
-
//#region src/tool-registry/analysis.ts
|
|
1223
|
+
// src/tool-registry/analysis.ts
|
|
1227
1224
|
const ANALYSIS_TOOLS = {
|
|
1228
1225
|
"got-ocr": {
|
|
1229
1226
|
category: "analysis",
|
|
@@ -1337,8 +1334,7 @@ const ANALYSIS_TOOLS = {
|
|
|
1337
1334
|
task: "vision moderation"
|
|
1338
1335
|
}
|
|
1339
1336
|
};
|
|
1340
|
-
|
|
1341
|
-
//#region src/tool-registry/assets.ts
|
|
1337
|
+
// src/tool-registry/assets.ts
|
|
1342
1338
|
const ASSET_TOOLS = {
|
|
1343
1339
|
"hunyuan3d-v3": {
|
|
1344
1340
|
category: "3d",
|
|
@@ -1656,8 +1652,7 @@ const ASSET_TOOLS = {
|
|
|
1656
1652
|
task: "single-image 3D reconstruction"
|
|
1657
1653
|
}
|
|
1658
1654
|
};
|
|
1659
|
-
|
|
1660
|
-
//#region src/tool-registry/background.ts
|
|
1655
|
+
// src/tool-registry/background.ts
|
|
1661
1656
|
const BACKGROUND_TOOLS = {
|
|
1662
1657
|
"ben-v2": {
|
|
1663
1658
|
category: "background",
|
|
@@ -2032,8 +2027,7 @@ const BACKGROUND_TOOLS = {
|
|
|
2032
2027
|
task: "video enhancement"
|
|
2033
2028
|
}
|
|
2034
2029
|
};
|
|
2035
|
-
|
|
2036
|
-
//#region src/tool-registry/editing.ts
|
|
2030
|
+
// src/tool-registry/editing.ts
|
|
2037
2031
|
const EDITING_TOOLS = {
|
|
2038
2032
|
"bria-eraser": {
|
|
2039
2033
|
category: "erase",
|
|
@@ -2304,8 +2298,7 @@ const EDITING_TOOLS = {
|
|
|
2304
2298
|
task: "virtual garment try-on"
|
|
2305
2299
|
}
|
|
2306
2300
|
};
|
|
2307
|
-
|
|
2308
|
-
//#region src/tool-registry/structure.ts
|
|
2301
|
+
// src/tool-registry/structure.ts
|
|
2309
2302
|
const STRUCTURE_TOOLS = {
|
|
2310
2303
|
"depth-anything": {
|
|
2311
2304
|
category: "preprocess",
|
|
@@ -2697,8 +2690,7 @@ const STRUCTURE_TOOLS = {
|
|
|
2697
2690
|
task: "depth preprocessing"
|
|
2698
2691
|
}
|
|
2699
2692
|
};
|
|
2700
|
-
|
|
2701
|
-
//#region src/tools.ts
|
|
2693
|
+
// src/tools.ts
|
|
2702
2694
|
const FAL_TOOLS = {
|
|
2703
2695
|
...ANALYSIS_TOOLS,
|
|
2704
2696
|
...ASSET_TOOLS,
|
|
@@ -2710,5 +2702,4 @@ Object.keys(FAL_TOOLS);
|
|
|
2710
2702
|
function isFalToolId(tool) {
|
|
2711
2703
|
return Object.hasOwn(FAL_TOOLS, tool);
|
|
2712
2704
|
}
|
|
2713
|
-
//#endregion
|
|
2714
2705
|
export { FAL_PRESET_SIZES, FAL_TOOLS, MODELS, estimateCost, isFalToolId };
|