@howells/motif-sdk 0.12.0 → 1.0.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 +10 -5
- package/dist/index.cjs +0 -3
- package/dist/index.d.cts +1 -5
- package/dist/index.d.ts +1 -5
- package/dist/index.js +0 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,10 +10,14 @@ npm install @howells/motif-sdk
|
|
|
10
10
|
|
|
11
11
|
## Generate Images
|
|
12
12
|
|
|
13
|
+
The primary image API is `createMotifImage` (`@howells/motif-sdk/image`) — provider-agnostic generate/edit across google, openai, replicate, and fal. See [Image Layer](#image-layer-howellsmotif-sdkimage) below.
|
|
14
|
+
|
|
15
|
+
The examples in this section use the low-level `FalClient`, the fal-native client for fal-specific capabilities (queue, upload, upscale, background removal, video, and utility tools).
|
|
16
|
+
|
|
13
17
|
```ts
|
|
14
|
-
import {
|
|
18
|
+
import { FalClient } from "@howells/motif-sdk";
|
|
15
19
|
|
|
16
|
-
const motif = new
|
|
20
|
+
const motif = new FalClient({
|
|
17
21
|
apiKey: process.env.FAL_KEY!,
|
|
18
22
|
retries: 3,
|
|
19
23
|
timeout: 120_000,
|
|
@@ -103,7 +107,8 @@ const videoJob = await motif.submitVideo({
|
|
|
103
107
|
|
|
104
108
|
## Main Exports
|
|
105
109
|
|
|
106
|
-
- `
|
|
110
|
+
- `createMotifImage` (`@howells/motif-sdk/image`) - the primary image API: provider-agnostic generate/edit/best-of-N across google, openai, replicate, and fal.
|
|
111
|
+
- `FalClient` - low-level fal-native client for generation, queue jobs, upload, utility tools, and payload deletion.
|
|
107
112
|
- `buildGenerateBody` - Pure fal request normalization for dry runs and tests.
|
|
108
113
|
- `MODELS`, `GENERATION_MODELS`, `UTILITY_MODELS`, `VIDEO_MODELS` - Motif model aliases, fal endpoints, capabilities, pricing, and benchmarks.
|
|
109
114
|
- `FAL_TOOLS`, `FAL_TOOL_IDS`, `buildFalToolRequest`, `isFalToolId` - Normalized fal utility endpoints such as SAM, depth, upscaling, moderation, and background removal.
|
|
@@ -119,13 +124,13 @@ The package exports public types for generation, processing, queue, metadata, an
|
|
|
119
124
|
|
|
120
125
|
- `GenerateOptions`, `MotifResponse`, `MotifImage`
|
|
121
126
|
- `UpscaleOptions`, `RemoveBackgroundOptions`, `VideoOptions`, `VideoResponse`
|
|
122
|
-
- `QueuedJob`, `JobStatus`, `
|
|
127
|
+
- `QueuedJob`, `JobStatus`, `FalClientConfig`
|
|
123
128
|
- `ModelConfig`, `AspectRatio`, `Resolution`, `ImageSize`, `ImageQuality`, `BackgroundMode`, `ThinkingLevel`
|
|
124
129
|
- `FalToolConfig`, `FalToolId`, `FalToolRequest`, `FalToolRunOptions`
|
|
125
130
|
|
|
126
131
|
## Image Layer (`@howells/motif-sdk/image`)
|
|
127
132
|
|
|
128
|
-
|
|
133
|
+
The primary, provider-agnostic image generation + editing layer — the recommended way to generate and edit images. The fal-specific `FalClient` surface above stays for fal-native extras. It is an ESM-only subpath export, built on the Vercel AI SDK image interface (`ai`'s `generateImage`).
|
|
129
134
|
|
|
130
135
|
```bash
|
|
131
136
|
npm install @howells/motif-sdk
|
package/dist/index.cjs
CHANGED
|
@@ -36,7 +36,6 @@ __export(src_exports, {
|
|
|
36
36
|
IMAGE_TEXT_TO_IMAGE_TOP_20: () => IMAGE_TEXT_TO_IMAGE_TOP_20,
|
|
37
37
|
MODELS: () => MODELS,
|
|
38
38
|
MotifError: () => MotifError,
|
|
39
|
-
MotifServer: () => MotifServer,
|
|
40
39
|
RECRAFT_STYLES: () => RECRAFT_STYLES,
|
|
41
40
|
RESOLUTIONS: () => RESOLUTIONS,
|
|
42
41
|
UTILITY_MODELS: () => UTILITY_MODELS,
|
|
@@ -3237,7 +3236,6 @@ var FalClient = class {
|
|
|
3237
3236
|
});
|
|
3238
3237
|
}
|
|
3239
3238
|
};
|
|
3240
|
-
var MotifServer = FalClient;
|
|
3241
3239
|
var MotifError = class extends Error {
|
|
3242
3240
|
status;
|
|
3243
3241
|
code;
|
|
@@ -3278,7 +3276,6 @@ function toMotifError(error) {
|
|
|
3278
3276
|
IMAGE_TEXT_TO_IMAGE_TOP_20,
|
|
3279
3277
|
MODELS,
|
|
3280
3278
|
MotifError,
|
|
3281
|
-
MotifServer,
|
|
3282
3279
|
RECRAFT_STYLES,
|
|
3283
3280
|
RESOLUTIONS,
|
|
3284
3281
|
UTILITY_MODELS,
|
package/dist/index.d.cts
CHANGED
|
@@ -395,8 +395,6 @@ interface FalClientConfig {
|
|
|
395
395
|
/** Request timeout in ms (default 120_000) */
|
|
396
396
|
timeout?: number;
|
|
397
397
|
}
|
|
398
|
-
/** @deprecated Renamed to {@link FalClientConfig}. */
|
|
399
|
-
type MotifServerConfig = FalClientConfig;
|
|
400
398
|
|
|
401
399
|
/** Ordered by popularity: square first, then common ratios */
|
|
402
400
|
declare const ASPECT_RATIOS: AspectRatio[];
|
|
@@ -930,8 +928,6 @@ declare class FalClient {
|
|
|
930
928
|
*/
|
|
931
929
|
private normalizeResponse;
|
|
932
930
|
}
|
|
933
|
-
/** @deprecated Renamed to {@link FalClient}. `MotifServer` is kept as an alias for backwards compatibility and will be removed in 1.0. */
|
|
934
|
-
declare const MotifServer: typeof FalClient;
|
|
935
931
|
declare class MotifError extends Error {
|
|
936
932
|
readonly status: number;
|
|
937
933
|
readonly code?: string;
|
|
@@ -1328,4 +1324,4 @@ type FalToolId = (typeof FAL_TOOL_IDS)[number];
|
|
|
1328
1324
|
declare function isFalToolId(tool: string): tool is FalToolId;
|
|
1329
1325
|
declare function buildFalToolRequest(options: FalToolRunOptions): FalToolRequest;
|
|
1330
1326
|
|
|
1331
|
-
export { ASPECT_RATIOS, type AspectRatio, type BackgroundMode, CREATIVE_FIELDS, CREATIVE_TAXONOMY, type CreativeDirection, type CreativeField, type CreativeOption, CreativeOptionError, type CreativeOptionErrorDetails, type CreativePromptResult, type CustomImageSize, EDIT_CAPABLE_MODELS, type EnrichPromptOptions, FAL_TOOLS, FAL_TOOLS_CHECKED_AT, FAL_TOOL_IDS, FORMAT_PRESETS, FalClient, type FalClientConfig, type FalImageSizePreset, type FalToolConfig, type FalToolId, type FalToolInputKind, type FalToolRequest, type FalToolRunOptions, GENERATION_MODELS, type GenerateOptions, type GenerationModelName, type GptImageSize, IDEOGRAM_STYLES, IMAGE_EDITING_TOP_20, IMAGE_TEXT_TO_IMAGE_TOP_20, type ImageOutputFormat, type ImageQuality, type ImageSize, type JobStatus, type LeaderboardEntry, type LeaderboardSnapshot, MODELS, type ModelConfig, type ModelType, type MotifEnv, MotifError, type MotifImage, type MotifResponse,
|
|
1327
|
+
export { ASPECT_RATIOS, type AspectRatio, type BackgroundMode, CREATIVE_FIELDS, CREATIVE_TAXONOMY, type CreativeDirection, type CreativeField, type CreativeOption, CreativeOptionError, type CreativeOptionErrorDetails, type CreativePromptResult, type CustomImageSize, EDIT_CAPABLE_MODELS, type EnrichPromptOptions, FAL_TOOLS, FAL_TOOLS_CHECKED_AT, FAL_TOOL_IDS, FORMAT_PRESETS, FalClient, type FalClientConfig, type FalImageSizePreset, type FalToolConfig, type FalToolId, type FalToolInputKind, type FalToolRequest, type FalToolRunOptions, GENERATION_MODELS, type GenerateOptions, type GenerationModelName, type GptImageSize, IDEOGRAM_STYLES, IMAGE_EDITING_TOP_20, IMAGE_TEXT_TO_IMAGE_TOP_20, type ImageOutputFormat, type ImageQuality, type ImageSize, type JobStatus, type LeaderboardEntry, type LeaderboardSnapshot, MODELS, type ModelConfig, type ModelType, type MotifEnv, MotifError, type MotifImage, type MotifResponse, type QueuedJob, RECRAFT_STYLES, RESOLUTIONS, type RemoveBackgroundOptions, type Resolution, type SizeMode, type ThinkingLevel, type ToolResponse, type ToolRunOptions, UTILITY_MODELS, type UpscaleOptions, VIDEO_IMAGE_TO_VIDEO_TOP_15, VIDEO_MODELS, VIDEO_TEXT_TO_VIDEO_TOP_15, type VideoOptions, type VideoResponse, aspectToFalImageSize, aspectToGptSize, buildFalToolRequest, buildGenerateBody, enrichPrompt, estimateCost, estimateVideoCost, getFalKeyFromEnv, isFalToolId, motifEnvSchema, parseMotifEnv, sanitizePrompt };
|
package/dist/index.d.ts
CHANGED
|
@@ -395,8 +395,6 @@ interface FalClientConfig {
|
|
|
395
395
|
/** Request timeout in ms (default 120_000) */
|
|
396
396
|
timeout?: number;
|
|
397
397
|
}
|
|
398
|
-
/** @deprecated Renamed to {@link FalClientConfig}. */
|
|
399
|
-
type MotifServerConfig = FalClientConfig;
|
|
400
398
|
|
|
401
399
|
/** Ordered by popularity: square first, then common ratios */
|
|
402
400
|
declare const ASPECT_RATIOS: AspectRatio[];
|
|
@@ -930,8 +928,6 @@ declare class FalClient {
|
|
|
930
928
|
*/
|
|
931
929
|
private normalizeResponse;
|
|
932
930
|
}
|
|
933
|
-
/** @deprecated Renamed to {@link FalClient}. `MotifServer` is kept as an alias for backwards compatibility and will be removed in 1.0. */
|
|
934
|
-
declare const MotifServer: typeof FalClient;
|
|
935
931
|
declare class MotifError extends Error {
|
|
936
932
|
readonly status: number;
|
|
937
933
|
readonly code?: string;
|
|
@@ -1328,4 +1324,4 @@ type FalToolId = (typeof FAL_TOOL_IDS)[number];
|
|
|
1328
1324
|
declare function isFalToolId(tool: string): tool is FalToolId;
|
|
1329
1325
|
declare function buildFalToolRequest(options: FalToolRunOptions): FalToolRequest;
|
|
1330
1326
|
|
|
1331
|
-
export { ASPECT_RATIOS, type AspectRatio, type BackgroundMode, CREATIVE_FIELDS, CREATIVE_TAXONOMY, type CreativeDirection, type CreativeField, type CreativeOption, CreativeOptionError, type CreativeOptionErrorDetails, type CreativePromptResult, type CustomImageSize, EDIT_CAPABLE_MODELS, type EnrichPromptOptions, FAL_TOOLS, FAL_TOOLS_CHECKED_AT, FAL_TOOL_IDS, FORMAT_PRESETS, FalClient, type FalClientConfig, type FalImageSizePreset, type FalToolConfig, type FalToolId, type FalToolInputKind, type FalToolRequest, type FalToolRunOptions, GENERATION_MODELS, type GenerateOptions, type GenerationModelName, type GptImageSize, IDEOGRAM_STYLES, IMAGE_EDITING_TOP_20, IMAGE_TEXT_TO_IMAGE_TOP_20, type ImageOutputFormat, type ImageQuality, type ImageSize, type JobStatus, type LeaderboardEntry, type LeaderboardSnapshot, MODELS, type ModelConfig, type ModelType, type MotifEnv, MotifError, type MotifImage, type MotifResponse,
|
|
1327
|
+
export { ASPECT_RATIOS, type AspectRatio, type BackgroundMode, CREATIVE_FIELDS, CREATIVE_TAXONOMY, type CreativeDirection, type CreativeField, type CreativeOption, CreativeOptionError, type CreativeOptionErrorDetails, type CreativePromptResult, type CustomImageSize, EDIT_CAPABLE_MODELS, type EnrichPromptOptions, FAL_TOOLS, FAL_TOOLS_CHECKED_AT, FAL_TOOL_IDS, FORMAT_PRESETS, FalClient, type FalClientConfig, type FalImageSizePreset, type FalToolConfig, type FalToolId, type FalToolInputKind, type FalToolRequest, type FalToolRunOptions, GENERATION_MODELS, type GenerateOptions, type GenerationModelName, type GptImageSize, IDEOGRAM_STYLES, IMAGE_EDITING_TOP_20, IMAGE_TEXT_TO_IMAGE_TOP_20, type ImageOutputFormat, type ImageQuality, type ImageSize, type JobStatus, type LeaderboardEntry, type LeaderboardSnapshot, MODELS, type ModelConfig, type ModelType, type MotifEnv, MotifError, type MotifImage, type MotifResponse, type QueuedJob, RECRAFT_STYLES, RESOLUTIONS, type RemoveBackgroundOptions, type Resolution, type SizeMode, type ThinkingLevel, type ToolResponse, type ToolRunOptions, UTILITY_MODELS, type UpscaleOptions, VIDEO_IMAGE_TO_VIDEO_TOP_15, VIDEO_MODELS, VIDEO_TEXT_TO_VIDEO_TOP_15, type VideoOptions, type VideoResponse, aspectToFalImageSize, aspectToGptSize, buildFalToolRequest, buildGenerateBody, enrichPrompt, estimateCost, estimateVideoCost, getFalKeyFromEnv, isFalToolId, motifEnvSchema, parseMotifEnv, sanitizePrompt };
|
package/dist/index.js
CHANGED
|
@@ -3177,7 +3177,6 @@ var FalClient = class {
|
|
|
3177
3177
|
});
|
|
3178
3178
|
}
|
|
3179
3179
|
};
|
|
3180
|
-
var MotifServer = FalClient;
|
|
3181
3180
|
var MotifError = class extends Error {
|
|
3182
3181
|
status;
|
|
3183
3182
|
code;
|
|
@@ -3217,7 +3216,6 @@ export {
|
|
|
3217
3216
|
IMAGE_TEXT_TO_IMAGE_TOP_20,
|
|
3218
3217
|
MODELS,
|
|
3219
3218
|
MotifError,
|
|
3220
|
-
MotifServer,
|
|
3221
3219
|
RECRAFT_STYLES,
|
|
3222
3220
|
RESOLUTIONS,
|
|
3223
3221
|
UTILITY_MODELS,
|