@howells/motif-sdk 0.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/LICENSE +21 -0
- package/dist/index.cjs +2747 -0
- package/dist/index.d.cts +1128 -0
- package/dist/index.d.ts +1128 -0
- package/dist/index.js +2693 -0
- package/package.json +64 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1128 @@
|
|
|
1
|
+
import { Result } from 'neverthrow';
|
|
2
|
+
export { Result, ResultAsync, err, ok } from 'neverthrow';
|
|
3
|
+
import * as _howells_envy from '@howells/envy';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
|
|
6
|
+
/** ─── Model Types ─────────────────────────────────────────────── */
|
|
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";
|
|
8
|
+
type Resolution = "0.5K" | "1K" | "2K" | "4K";
|
|
9
|
+
type ModelType = "generation" | "utility" | "video";
|
|
10
|
+
type ImageOutputFormat = "jpeg" | "png" | "webp";
|
|
11
|
+
type BackgroundMode = "auto" | "transparent" | "opaque";
|
|
12
|
+
type ImageQuality = "auto" | "low" | "medium" | "high";
|
|
13
|
+
type ThinkingLevel = "minimal" | "high";
|
|
14
|
+
type GptImageSize = "auto" | "1024x1024" | "1536x1024" | "1024x1536";
|
|
15
|
+
type FalImageSizePreset = "auto" | "square_hd" | "square" | "portrait_4_3" | "portrait_16_9" | "landscape_4_3" | "landscape_16_9";
|
|
16
|
+
type CustomImageSize = {
|
|
17
|
+
height: number;
|
|
18
|
+
width: number;
|
|
19
|
+
};
|
|
20
|
+
type ImageSize = GptImageSize | FalImageSizePreset | CustomImageSize;
|
|
21
|
+
/** How the model accepts image dimensions */
|
|
22
|
+
type SizeMode = "aspect_ratio" | "image_size_enum" | "gpt_size" | "none";
|
|
23
|
+
type QualityTier = "good" | "better" | "best" | "frontier";
|
|
24
|
+
type SpeedTier = "fast" | "balanced" | "slow" | "very_slow" | "unknown";
|
|
25
|
+
type PriceTier = "budget" | "standard" | "premium" | "ultra" | "variable";
|
|
26
|
+
interface FalPricing {
|
|
27
|
+
checkedAt: string;
|
|
28
|
+
currency: "USD";
|
|
29
|
+
endpointId: string;
|
|
30
|
+
estimatedCostPerImageUsd?: number;
|
|
31
|
+
source: "fal-pricing-api";
|
|
32
|
+
unit: string;
|
|
33
|
+
unitPrice: number;
|
|
34
|
+
}
|
|
35
|
+
interface LeaderboardMetric {
|
|
36
|
+
elo: number;
|
|
37
|
+
pricePer1k?: number | null;
|
|
38
|
+
rank: number;
|
|
39
|
+
winRate?: number;
|
|
40
|
+
}
|
|
41
|
+
interface ModelBenchmark {
|
|
42
|
+
artificialAnalysis?: {
|
|
43
|
+
editing?: LeaderboardMetric;
|
|
44
|
+
sourceUrls: string[];
|
|
45
|
+
snapshotDate: string;
|
|
46
|
+
textToImage?: LeaderboardMetric;
|
|
47
|
+
};
|
|
48
|
+
speed?: {
|
|
49
|
+
medianSeconds?: number;
|
|
50
|
+
p95Seconds?: number;
|
|
51
|
+
source: "artificial-analysis-models";
|
|
52
|
+
};
|
|
53
|
+
tiers?: {
|
|
54
|
+
price: PriceTier;
|
|
55
|
+
quality: QualityTier;
|
|
56
|
+
speed: SpeedTier;
|
|
57
|
+
};
|
|
58
|
+
useCase?: string;
|
|
59
|
+
}
|
|
60
|
+
interface ModelConfig {
|
|
61
|
+
benchmark?: ModelBenchmark;
|
|
62
|
+
editEndpoint?: string;
|
|
63
|
+
editImagesField?: "image_urls" | "image_url";
|
|
64
|
+
endpoint: string;
|
|
65
|
+
falPricing?: FalPricing;
|
|
66
|
+
maxReferenceImages?: number;
|
|
67
|
+
name: string;
|
|
68
|
+
pricing: string;
|
|
69
|
+
pricePerImageUsd?: number;
|
|
70
|
+
/** How this model accepts dimensions (default: "aspect_ratio") */
|
|
71
|
+
sizeMode?: SizeMode;
|
|
72
|
+
supportsAspect: boolean;
|
|
73
|
+
supportsBackground?: boolean;
|
|
74
|
+
supportsEdit: boolean;
|
|
75
|
+
supportsEnhancePrompt?: boolean;
|
|
76
|
+
supportsExpandPrompt?: boolean;
|
|
77
|
+
supportsGuidanceScale?: boolean;
|
|
78
|
+
supportsGoogleSearch?: boolean;
|
|
79
|
+
supportsImagePromptStrength?: boolean;
|
|
80
|
+
supportsInferenceSteps?: boolean;
|
|
81
|
+
supportsLimitGenerations?: boolean;
|
|
82
|
+
supportsMaskImage?: boolean;
|
|
83
|
+
supportsNegativePrompt?: boolean;
|
|
84
|
+
supportsNumImages: boolean;
|
|
85
|
+
supportsOutputFormat?: boolean;
|
|
86
|
+
supportedOutputFormats?: readonly ImageOutputFormat[];
|
|
87
|
+
supportsQuality?: boolean;
|
|
88
|
+
supportsRaw?: boolean;
|
|
89
|
+
supportsRenderingSpeed?: boolean;
|
|
90
|
+
supportsResolution: boolean;
|
|
91
|
+
supportsSafetyTolerance?: boolean;
|
|
92
|
+
supportsSafetyChecker?: boolean;
|
|
93
|
+
supportsSeed?: boolean;
|
|
94
|
+
supportsStyle?: boolean;
|
|
95
|
+
supportsSyncMode?: boolean;
|
|
96
|
+
supportsThinkingLevel?: boolean;
|
|
97
|
+
supportsWebSearch?: boolean;
|
|
98
|
+
type: ModelType;
|
|
99
|
+
/** Use fal queue submit/status/result even for generate() calls. */
|
|
100
|
+
useQueue?: boolean;
|
|
101
|
+
}
|
|
102
|
+
/** ─── Generation Types ───────────────────────────────────────── */
|
|
103
|
+
interface GenerateOptions {
|
|
104
|
+
aspect?: AspectRatio;
|
|
105
|
+
/** GPT background mode where supported */
|
|
106
|
+
background?: BackgroundMode;
|
|
107
|
+
editImageUrls?: string[];
|
|
108
|
+
/** Google-search alias for fal models that expose enable_google_search */
|
|
109
|
+
enableGoogleSearch?: boolean;
|
|
110
|
+
/** fal safety checker toggle where supported */
|
|
111
|
+
enableSafetyChecker?: boolean;
|
|
112
|
+
/** Enable web search for generative context where supported */
|
|
113
|
+
enableWebSearch?: boolean;
|
|
114
|
+
/** Auto-enhance the prompt before generation (flux only) */
|
|
115
|
+
enhancePrompt?: boolean;
|
|
116
|
+
/** Enable MagicPrompt expansion (ideogram only) */
|
|
117
|
+
expandPrompt?: boolean;
|
|
118
|
+
/** CFG guidance scale — flux-fast: 1–20 */
|
|
119
|
+
guidanceScale?: number;
|
|
120
|
+
/** Direct fal image_size override, including custom {width,height} where supported */
|
|
121
|
+
imageSize?: ImageSize;
|
|
122
|
+
/** FLUX image prompt/reference strength where supported */
|
|
123
|
+
imagePromptStrength?: number;
|
|
124
|
+
inputFidelity?: "low" | "high";
|
|
125
|
+
/** Nano Banana 2 generation limiting toggle */
|
|
126
|
+
limitGenerations?: boolean;
|
|
127
|
+
/** Mask image URL for inpainting/editing where supported */
|
|
128
|
+
maskImageUrl?: string;
|
|
129
|
+
model: string;
|
|
130
|
+
/** What NOT to include in the image (ideogram only) */
|
|
131
|
+
negativePrompt?: string;
|
|
132
|
+
numImages?: number;
|
|
133
|
+
/** Number of diffusion inference steps — flux-fast: 1–12 */
|
|
134
|
+
numInferenceSteps?: number;
|
|
135
|
+
/** Output image format (default: model-dependent) */
|
|
136
|
+
outputFormat?: ImageOutputFormat;
|
|
137
|
+
prompt: string;
|
|
138
|
+
/** GPT/OpenAI quality where supported */
|
|
139
|
+
quality?: ImageQuality;
|
|
140
|
+
/** Generate less processed, more natural images (flux only) */
|
|
141
|
+
raw?: boolean;
|
|
142
|
+
/** Speed vs. quality trade-off (ideogram only) */
|
|
143
|
+
renderingSpeed?: "TURBO" | "BALANCED" | "QUALITY";
|
|
144
|
+
resolution?: Resolution;
|
|
145
|
+
/** Safety tolerance level "1"–"6", where "1" is strictest */
|
|
146
|
+
safetyTolerance?: string;
|
|
147
|
+
/** Reproducible generation seed */
|
|
148
|
+
seed?: number;
|
|
149
|
+
/** Style preset — recraft: 70+ hierarchical styles; ideogram: "AUTO"|"GENERAL"|"REALISTIC"|"DESIGN" */
|
|
150
|
+
style?: string;
|
|
151
|
+
/** Return media as data URI where supported */
|
|
152
|
+
syncMode?: boolean;
|
|
153
|
+
/** Nano Banana 2 thinking mode */
|
|
154
|
+
thinkingLevel?: ThinkingLevel;
|
|
155
|
+
transparent?: boolean;
|
|
156
|
+
}
|
|
157
|
+
interface UpscaleOptions {
|
|
158
|
+
creativity?: number;
|
|
159
|
+
/** CFG guidance scale for upscaling (clarity only, 0–20, default 4) */
|
|
160
|
+
guidanceScale?: number;
|
|
161
|
+
imageUrl: string;
|
|
162
|
+
model?: "clarity" | "crystal";
|
|
163
|
+
/** What NOT to include in the upscaled result (clarity only) */
|
|
164
|
+
negativePrompt?: string;
|
|
165
|
+
/** Number of diffusion steps (clarity only, 4–50, default 18) */
|
|
166
|
+
numInferenceSteps?: number;
|
|
167
|
+
/** Prompt to guide the upscaling process (clarity only) */
|
|
168
|
+
prompt?: string;
|
|
169
|
+
/** How closely to preserve the original image (clarity only, 0–1, default 0.6) */
|
|
170
|
+
resemblance?: number;
|
|
171
|
+
scaleFactor?: number;
|
|
172
|
+
}
|
|
173
|
+
interface RemoveBackgroundOptions {
|
|
174
|
+
imageUrl: string;
|
|
175
|
+
model?: "rmbg" | "bria";
|
|
176
|
+
/** BiRefNet operating resolution (rmbg model only, default "1024x1024") */
|
|
177
|
+
operatingResolution?: "1024x1024" | "2048x2048";
|
|
178
|
+
/** Output image format (rmbg model only) */
|
|
179
|
+
outputFormat?: "png" | "webp" | "gif";
|
|
180
|
+
/** Return the alpha mask alongside the result (rmbg model only) */
|
|
181
|
+
outputMask?: boolean;
|
|
182
|
+
/** Apply foreground edge refinement (rmbg model only, default true) */
|
|
183
|
+
refineForeground?: boolean;
|
|
184
|
+
/** BiRefNet model variant (rmbg model only) */
|
|
185
|
+
variant?: "General Use (Light)" | "General Use (Heavy)" | "Portrait";
|
|
186
|
+
}
|
|
187
|
+
interface VideoOptions {
|
|
188
|
+
/** CFG guidance scale for video generation (0–1, default 0.5) */
|
|
189
|
+
cfgScale?: number;
|
|
190
|
+
/** Duration in seconds (3-15) */
|
|
191
|
+
duration?: number;
|
|
192
|
+
/** Optional end frame image URL */
|
|
193
|
+
endImageUrl?: string;
|
|
194
|
+
/** Generate audio track (default true, costs more) */
|
|
195
|
+
generateAudio?: boolean;
|
|
196
|
+
/** Source image URL */
|
|
197
|
+
imageUrl: string;
|
|
198
|
+
/** What NOT to include in the video */
|
|
199
|
+
negativePrompt?: string;
|
|
200
|
+
/** Text description of the motion/scene */
|
|
201
|
+
prompt: string;
|
|
202
|
+
}
|
|
203
|
+
interface VideoResponse {
|
|
204
|
+
contentType: string;
|
|
205
|
+
fileName: string;
|
|
206
|
+
fileSize: number;
|
|
207
|
+
url: string;
|
|
208
|
+
}
|
|
209
|
+
interface ToolRunOptions {
|
|
210
|
+
input?: string;
|
|
211
|
+
inputs?: string[];
|
|
212
|
+
options?: Record<string, unknown>;
|
|
213
|
+
tool: string;
|
|
214
|
+
}
|
|
215
|
+
type ToolResponse = Record<string, unknown>;
|
|
216
|
+
/** ─── Response Types ─────────────────────────────────────────── */
|
|
217
|
+
interface MotifImage {
|
|
218
|
+
content_type?: string;
|
|
219
|
+
height?: number;
|
|
220
|
+
url: string;
|
|
221
|
+
width?: number;
|
|
222
|
+
}
|
|
223
|
+
interface MotifResponse {
|
|
224
|
+
images: MotifImage[];
|
|
225
|
+
prompt?: string;
|
|
226
|
+
seed?: number;
|
|
227
|
+
}
|
|
228
|
+
/** ─── Queue Types ────────────────────────────────────────────── */
|
|
229
|
+
interface QueuedJob {
|
|
230
|
+
endpoint: string;
|
|
231
|
+
estimatedCost: number;
|
|
232
|
+
requestId: string;
|
|
233
|
+
}
|
|
234
|
+
interface JobStatus {
|
|
235
|
+
error?: string;
|
|
236
|
+
logs?: Array<{
|
|
237
|
+
message: string;
|
|
238
|
+
timestamp: string;
|
|
239
|
+
}>;
|
|
240
|
+
queuePosition?: number;
|
|
241
|
+
status: "queued" | "processing" | "completed" | "failed";
|
|
242
|
+
}
|
|
243
|
+
/** ─── Configuration ──────────────────────────────────────────── */
|
|
244
|
+
interface MotifServerConfig {
|
|
245
|
+
apiKey: string;
|
|
246
|
+
/** Max retry attempts for 429/5xx errors (default 3, set 0 to disable) */
|
|
247
|
+
retries?: number;
|
|
248
|
+
/** Request timeout in ms (default 120_000) */
|
|
249
|
+
timeout?: number;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** Ordered by popularity: square first, then common ratios */
|
|
253
|
+
declare const ASPECT_RATIOS: AspectRatio[];
|
|
254
|
+
declare const RESOLUTIONS: Resolution[];
|
|
255
|
+
/** Map aspect ratio to GPT image_size (GPT doesn't support arbitrary aspects) */
|
|
256
|
+
declare function aspectToGptSize(aspect: AspectRatio): string;
|
|
257
|
+
/**
|
|
258
|
+
* Map aspect ratio to fal.ai image_size enum.
|
|
259
|
+
* Used by FLUX Schnell, Recraft, Ideogram, and other models that accept
|
|
260
|
+
* named size presets rather than aspect ratio strings.
|
|
261
|
+
*/
|
|
262
|
+
declare function aspectToFalImageSize(aspect: AspectRatio): string;
|
|
263
|
+
/** Format presets that set aspect + resolution in one click */
|
|
264
|
+
declare const FORMAT_PRESETS: Record<string, {
|
|
265
|
+
label: string;
|
|
266
|
+
aspect: AspectRatio;
|
|
267
|
+
resolution?: Resolution;
|
|
268
|
+
}>;
|
|
269
|
+
|
|
270
|
+
/** Estimate cost based on model and settings */
|
|
271
|
+
declare function estimateCost(model: string, resolution?: Resolution, numImages?: number): number;
|
|
272
|
+
/** Estimate cost for video generation */
|
|
273
|
+
declare function estimateVideoCost(durationSeconds?: number, generateAudio?: boolean): number;
|
|
274
|
+
|
|
275
|
+
declare const motifEnvSchema: _howells_envy.EnvSchema<{
|
|
276
|
+
readonly optional: {
|
|
277
|
+
readonly FAL_KEY: z.ZodString;
|
|
278
|
+
};
|
|
279
|
+
}>;
|
|
280
|
+
type MotifEnv = ReturnType<typeof motifEnvSchema.parse>;
|
|
281
|
+
declare function parseMotifEnv(input?: Record<string, unknown>): MotifEnv;
|
|
282
|
+
declare function getFalKeyFromEnv(input?: Record<string, unknown>): string | undefined;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Build the fal.ai request body for a generation request.
|
|
286
|
+
* Shared between sync generate() (CLI) and queue-based submit (web).
|
|
287
|
+
*
|
|
288
|
+
* Models use different sizing APIs:
|
|
289
|
+
* - `gpt_size`: GPT's fixed dimensions (1024x1024, 1536x1024, etc.)
|
|
290
|
+
* - `aspect_ratio`: string like "16:9" (Gemini, Grok, FLUX Pro Ultra)
|
|
291
|
+
* - `image_size_enum`: named presets like "landscape_4_3" (FLUX.2, Seedream, Recraft, Ideogram, GPT Image 2)
|
|
292
|
+
* - `none`: no size control (video models)
|
|
293
|
+
*/
|
|
294
|
+
declare function buildGenerateBody(options: GenerateOptions): {
|
|
295
|
+
endpoint: string;
|
|
296
|
+
body: Record<string, unknown>;
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
interface LeaderboardEntry {
|
|
300
|
+
apiPricing?: string;
|
|
301
|
+
creator: string;
|
|
302
|
+
elo: number;
|
|
303
|
+
isCurrent?: boolean;
|
|
304
|
+
model: string;
|
|
305
|
+
rank: number;
|
|
306
|
+
routableModelId?: string;
|
|
307
|
+
}
|
|
308
|
+
interface LeaderboardSnapshot {
|
|
309
|
+
capturedAt: string;
|
|
310
|
+
entries: LeaderboardEntry[];
|
|
311
|
+
source: string;
|
|
312
|
+
}
|
|
313
|
+
declare const IMAGE_TEXT_TO_IMAGE_TOP_20: LeaderboardSnapshot;
|
|
314
|
+
declare const IMAGE_EDITING_TOP_20: LeaderboardSnapshot;
|
|
315
|
+
declare const VIDEO_TEXT_TO_VIDEO_TOP_15: LeaderboardSnapshot;
|
|
316
|
+
declare const VIDEO_IMAGE_TO_VIDEO_TOP_15: LeaderboardSnapshot;
|
|
317
|
+
|
|
318
|
+
declare const MODELS: Record<string, ModelConfig>;
|
|
319
|
+
declare const GENERATION_MODELS: readonly ["gpt2", "gpt", "banana2", "banana", "gemini", "gemini3", "seedream4", "seedream45", "flux2-max", "flux2-pro", "flux2-flex", "flux2-dev", "flux", "flux-fast", "recraft", "ideogram", "grok-image", "qwen"];
|
|
320
|
+
declare const UTILITY_MODELS: readonly ["clarity", "crystal", "rmbg", "bria"];
|
|
321
|
+
declare const VIDEO_MODELS: readonly ["kling"];
|
|
322
|
+
type GenerationModelName = (typeof GENERATION_MODELS)[number];
|
|
323
|
+
/** Recraft v3 style presets. Pass as the `style` field in GenerateOptions. */
|
|
324
|
+
declare const RECRAFT_STYLES: readonly ["realistic_image", "realistic_image/b_and_w", "realistic_image/enterprise", "realistic_image/hard_flash", "realistic_image/hdr", "realistic_image/motion_blur", "realistic_image/natural_light", "realistic_image/studio_portrait", "realistic_image/long_exposure", "digital_illustration", "digital_illustration/2d_art_poster", "digital_illustration/2d_art_poster_2", "digital_illustration/engraving_color", "digital_illustration/grain", "digital_illustration/hand_drawn", "digital_illustration/hand_drawn_outline", "digital_illustration/handmade_3d", "digital_illustration/infantile_sketch", "digital_illustration/pixel_art", "digital_illustration/psychedelic", "digital_illustration/seamless", "digital_illustration/voxel", "digital_illustration/watercolor", "vector_illustration", "vector_illustration/cartoon", "vector_illustration/doodle_line_art", "vector_illustration/engraving", "vector_illustration/flat_2", "vector_illustration/kawaii", "vector_illustration/line_art", "vector_illustration/line_circuit", "vector_illustration/linocut", "vector_illustration/zentangle"];
|
|
325
|
+
/** Ideogram v3 top-level style categories. Pass as the `style` field in GenerateOptions. */
|
|
326
|
+
declare const IDEOGRAM_STYLES: readonly ["AUTO", "GENERAL", "REALISTIC", "DESIGN"];
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Motif Server SDK
|
|
330
|
+
*
|
|
331
|
+
* Server-side SDK for AI image generation via fal.ai.
|
|
332
|
+
* All async methods return `Result<T, MotifError>` — no thrown exceptions.
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* ```typescript
|
|
336
|
+
* import { MotifServer } from "./fal";
|
|
337
|
+
*
|
|
338
|
+
* const motif = new MotifServer(process.env.FAL_KEY!);
|
|
339
|
+
* const result = await motif.generate({ prompt: "a red balloon", model: "banana" });
|
|
340
|
+
*
|
|
341
|
+
* if (result.isOk()) {
|
|
342
|
+
* console.log(result.value.images[0].url);
|
|
343
|
+
* } else {
|
|
344
|
+
* console.error(result.error.message);
|
|
345
|
+
* }
|
|
346
|
+
* ```
|
|
347
|
+
*/
|
|
348
|
+
declare class MotifServer {
|
|
349
|
+
private readonly apiKey;
|
|
350
|
+
private readonly timeout;
|
|
351
|
+
private readonly retries;
|
|
352
|
+
constructor(config: MotifServerConfig | string);
|
|
353
|
+
/** ─── Synchronous Generation ──────────────────────────────── */
|
|
354
|
+
/** Generate images synchronously (blocks until fal.ai returns). */
|
|
355
|
+
generate(options: GenerateOptions): Promise<Result<MotifResponse, MotifError>>;
|
|
356
|
+
private generateQueued;
|
|
357
|
+
/** ─── Queue-Based Generation ──────────────────────────────── */
|
|
358
|
+
/** Submit a generation to the fal.ai queue (returns immediately). */
|
|
359
|
+
submitGeneration(options: GenerateOptions): Promise<Result<QueuedJob, MotifError>>;
|
|
360
|
+
/** Check the status of a queued generation. */
|
|
361
|
+
getJobStatus(endpoint: string, requestId: string): Promise<Result<JobStatus, MotifError>>;
|
|
362
|
+
/** Fetch the completed result from the queue. */
|
|
363
|
+
getJobResult(endpoint: string, requestId: string): Promise<Result<MotifResponse, MotifError>>;
|
|
364
|
+
/** ─── Processing ──────────────────────────────────────────── */
|
|
365
|
+
/** Upscale an image using clarity or crystal upscaler. */
|
|
366
|
+
upscale(options: UpscaleOptions): Promise<Result<MotifResponse, MotifError>>;
|
|
367
|
+
/** Remove the background from an image. */
|
|
368
|
+
removeBackground(options: RemoveBackgroundOptions): Promise<Result<MotifResponse, MotifError>>;
|
|
369
|
+
/** ─── Video Generation ───────────────────────────────────── */
|
|
370
|
+
/**
|
|
371
|
+
* Generate a video from an image using Kling v3 Pro.
|
|
372
|
+
* This uses the queue API since video generation takes 30-120s.
|
|
373
|
+
* Returns immediately with a job — poll with getJobStatus/getVideoResult.
|
|
374
|
+
*/
|
|
375
|
+
submitVideo(options: VideoOptions): Promise<Result<QueuedJob, MotifError>>;
|
|
376
|
+
/** Fetch the completed video result from the queue. */
|
|
377
|
+
getVideoResult(endpoint: string, requestId: string): Promise<Result<VideoResponse, MotifError>>;
|
|
378
|
+
/** ─── File Upload ─────────────────────────────────────────── */
|
|
379
|
+
/**
|
|
380
|
+
* Upload a file to fal.ai CDN storage and return the public URL.
|
|
381
|
+
* Uses the two-step initiate + PUT flow.
|
|
382
|
+
*/
|
|
383
|
+
uploadToFalCdn(file: ArrayBuffer | Uint8Array, options: {
|
|
384
|
+
contentType: string;
|
|
385
|
+
fileName: string;
|
|
386
|
+
}): Promise<Result<string, MotifError>>;
|
|
387
|
+
/** ─── Utilities ───────────────────────────────────────────── */
|
|
388
|
+
/** Run a registered fal utility/tool endpoint. */
|
|
389
|
+
runTool(options: ToolRunOptions): Promise<Result<ToolResponse, MotifError>>;
|
|
390
|
+
/** Estimate cost for a generation (no API call). */
|
|
391
|
+
estimateCost(model: string, resolution?: Resolution, numImages?: number): number;
|
|
392
|
+
/** Build the fal.ai request body without sending it. */
|
|
393
|
+
buildRequestBody(options: GenerateOptions): {
|
|
394
|
+
endpoint: string;
|
|
395
|
+
body: Record<string, unknown>;
|
|
396
|
+
};
|
|
397
|
+
/** Model registry. */
|
|
398
|
+
get models(): Record<string, ModelConfig>;
|
|
399
|
+
/** Generation model keys. */
|
|
400
|
+
get generationModels(): readonly ["gpt2", "gpt", "banana2", "banana", "gemini", "gemini3", "seedream4", "seedream45", "flux2-max", "flux2-pro", "flux2-flex", "flux2-dev", "flux", "flux-fast", "recraft", "ideogram", "grok-image", "qwen"];
|
|
401
|
+
/** Utility model keys. */
|
|
402
|
+
get utilityModels(): readonly ["clarity", "crystal", "rmbg", "bria"];
|
|
403
|
+
/** Registered fal utility/tool endpoints. */
|
|
404
|
+
get tools(): {
|
|
405
|
+
readonly nsfw: {
|
|
406
|
+
readonly name: "NSFW Checker";
|
|
407
|
+
readonly endpoint: "fal-ai/x-ailab/nsfw";
|
|
408
|
+
readonly task: "vision moderation";
|
|
409
|
+
readonly category: "moderation";
|
|
410
|
+
readonly description: "Predict whether one or more images contain NSFW concepts.";
|
|
411
|
+
readonly inputKind: "images";
|
|
412
|
+
readonly inputField: "image_urls";
|
|
413
|
+
readonly outputKeys: ["has_nsfw_concepts"];
|
|
414
|
+
readonly pricing: "$0.001/image";
|
|
415
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/x-ailab/nsfw";
|
|
416
|
+
};
|
|
417
|
+
readonly "topaz-image": {
|
|
418
|
+
readonly name: "Topaz Image Upscale";
|
|
419
|
+
readonly endpoint: "fal-ai/topaz/upscale/image";
|
|
420
|
+
readonly task: "image enhancement";
|
|
421
|
+
readonly category: "upscale";
|
|
422
|
+
readonly description: "Professional Topaz image enhancement and upscaling.";
|
|
423
|
+
readonly inputKind: "image";
|
|
424
|
+
readonly inputField: "image_url";
|
|
425
|
+
readonly outputKeys: ["image"];
|
|
426
|
+
readonly pricing: "$0.08+ by output megapixels";
|
|
427
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/topaz/upscale/image";
|
|
428
|
+
readonly defaultOptions: {
|
|
429
|
+
readonly model: "Standard V2";
|
|
430
|
+
readonly output_format: "jpeg";
|
|
431
|
+
readonly upscale_factor: 2;
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
readonly "topaz-video": {
|
|
435
|
+
readonly name: "Topaz Video Upscale";
|
|
436
|
+
readonly endpoint: "fal-ai/topaz/upscale/video";
|
|
437
|
+
readonly task: "video enhancement";
|
|
438
|
+
readonly category: "upscale";
|
|
439
|
+
readonly description: "Professional Topaz video enhancement and upscaling.";
|
|
440
|
+
readonly inputKind: "video";
|
|
441
|
+
readonly inputField: "video_url";
|
|
442
|
+
readonly outputKeys: ["video"];
|
|
443
|
+
readonly pricing: "$0.01-$0.08/sec by output resolution";
|
|
444
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/topaz/upscale/video";
|
|
445
|
+
readonly defaultOptions: {
|
|
446
|
+
readonly model: "Proteus";
|
|
447
|
+
readonly upscale_factor: 2;
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
readonly "bria-rmbg": {
|
|
451
|
+
readonly name: "Bria RMBG 2.0";
|
|
452
|
+
readonly endpoint: "fal-ai/bria/background/remove";
|
|
453
|
+
readonly task: "image background removal";
|
|
454
|
+
readonly category: "background";
|
|
455
|
+
readonly description: "Commercial-safe background removal for images.";
|
|
456
|
+
readonly inputKind: "image";
|
|
457
|
+
readonly inputField: "image_url";
|
|
458
|
+
readonly outputKeys: ["image"];
|
|
459
|
+
readonly pricing: "$0.02/image";
|
|
460
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/bria/background/remove";
|
|
461
|
+
};
|
|
462
|
+
readonly birefnet: {
|
|
463
|
+
readonly name: "BirefNet Background Removal";
|
|
464
|
+
readonly endpoint: "fal-ai/birefnet/v2";
|
|
465
|
+
readonly task: "image background removal";
|
|
466
|
+
readonly category: "background";
|
|
467
|
+
readonly description: "High-resolution dichotomous image segmentation and background removal.";
|
|
468
|
+
readonly inputKind: "image";
|
|
469
|
+
readonly inputField: "image_url";
|
|
470
|
+
readonly outputKeys: ["image", "mask_image"];
|
|
471
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
472
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/birefnet/v2";
|
|
473
|
+
readonly defaultOptions: {
|
|
474
|
+
readonly model: "General Use (Light)";
|
|
475
|
+
readonly operating_resolution: "1024x1024";
|
|
476
|
+
readonly output_format: "png";
|
|
477
|
+
readonly refine_foreground: true;
|
|
478
|
+
};
|
|
479
|
+
};
|
|
480
|
+
readonly rembg: {
|
|
481
|
+
readonly name: "Remove Background";
|
|
482
|
+
readonly endpoint: "fal-ai/imageutils/rembg";
|
|
483
|
+
readonly task: "image background removal";
|
|
484
|
+
readonly category: "background";
|
|
485
|
+
readonly description: "Generic image background removal utility.";
|
|
486
|
+
readonly inputKind: "image";
|
|
487
|
+
readonly inputField: "image_url";
|
|
488
|
+
readonly outputKeys: ["image"];
|
|
489
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
490
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/imageutils/rembg";
|
|
491
|
+
readonly defaultOptions: {
|
|
492
|
+
readonly crop_to_bbox: false;
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
readonly "bria-video-rmbg": {
|
|
496
|
+
readonly name: "Bria Video Background Removal";
|
|
497
|
+
readonly endpoint: "bria/video/background-removal";
|
|
498
|
+
readonly task: "video background removal";
|
|
499
|
+
readonly category: "background";
|
|
500
|
+
readonly description: "Remove video backgrounds with configurable output container.";
|
|
501
|
+
readonly inputKind: "video";
|
|
502
|
+
readonly inputField: "video_url";
|
|
503
|
+
readonly outputKeys: ["video"];
|
|
504
|
+
readonly pricing: "$0.14/sec";
|
|
505
|
+
readonly sourceUrl: "https://fal.ai/models/bria/video/background-removal";
|
|
506
|
+
readonly defaultOptions: {
|
|
507
|
+
readonly background_color: "Black";
|
|
508
|
+
readonly output_container_and_codec: "webm_vp9";
|
|
509
|
+
readonly preserve_audio: true;
|
|
510
|
+
};
|
|
511
|
+
};
|
|
512
|
+
readonly lineart: {
|
|
513
|
+
readonly name: "Line Art Preprocessor";
|
|
514
|
+
readonly endpoint: "fal-ai/image-preprocessors/lineart";
|
|
515
|
+
readonly task: "image preprocessing";
|
|
516
|
+
readonly category: "preprocess";
|
|
517
|
+
readonly description: "Generate line art/control-style edges from an input image.";
|
|
518
|
+
readonly inputKind: "image";
|
|
519
|
+
readonly inputField: "image_url";
|
|
520
|
+
readonly outputKeys: ["image"];
|
|
521
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
522
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/image-preprocessors/lineart";
|
|
523
|
+
readonly defaultOptions: {
|
|
524
|
+
readonly coarse: false;
|
|
525
|
+
};
|
|
526
|
+
};
|
|
527
|
+
readonly "sam-preprocessor": {
|
|
528
|
+
readonly name: "SAM Preprocessor";
|
|
529
|
+
readonly endpoint: "fal-ai/image-preprocessors/sam";
|
|
530
|
+
readonly task: "segmentation preprocessing";
|
|
531
|
+
readonly category: "preprocess";
|
|
532
|
+
readonly description: "Generate a SAM segmentation map for ControlNet-style workflows.";
|
|
533
|
+
readonly inputKind: "image";
|
|
534
|
+
readonly inputField: "image_url";
|
|
535
|
+
readonly outputKeys: ["image"];
|
|
536
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
537
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/image-preprocessors/sam";
|
|
538
|
+
};
|
|
539
|
+
readonly "midas-depth": {
|
|
540
|
+
readonly name: "MiDaS Depth Estimation";
|
|
541
|
+
readonly endpoint: "fal-ai/imageutils/depth";
|
|
542
|
+
readonly task: "depth map";
|
|
543
|
+
readonly category: "depth";
|
|
544
|
+
readonly description: "Create MiDaS depth maps from input images.";
|
|
545
|
+
readonly inputKind: "image";
|
|
546
|
+
readonly inputField: "image_url";
|
|
547
|
+
readonly outputKeys: ["image"];
|
|
548
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
549
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/imageutils/depth";
|
|
550
|
+
readonly defaultOptions: {
|
|
551
|
+
readonly a: number;
|
|
552
|
+
readonly bg_th: 0.1;
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
readonly "midas-preprocessor": {
|
|
556
|
+
readonly name: "MiDaS Preprocessor";
|
|
557
|
+
readonly endpoint: "fal-ai/image-preprocessors/midas";
|
|
558
|
+
readonly task: "depth and normal preprocessing";
|
|
559
|
+
readonly category: "preprocess";
|
|
560
|
+
readonly description: "Generate MiDaS depth and normal maps for image workflows.";
|
|
561
|
+
readonly inputKind: "image";
|
|
562
|
+
readonly inputField: "image_url";
|
|
563
|
+
readonly outputKeys: ["depth_map", "normal_map"];
|
|
564
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
565
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/image-preprocessors/midas";
|
|
566
|
+
};
|
|
567
|
+
readonly "marigold-depth": {
|
|
568
|
+
readonly name: "Marigold Depth Estimation";
|
|
569
|
+
readonly endpoint: "fal-ai/imageutils/marigold-depth";
|
|
570
|
+
readonly task: "depth map";
|
|
571
|
+
readonly category: "depth";
|
|
572
|
+
readonly description: "Create depth maps using Marigold depth estimation.";
|
|
573
|
+
readonly inputKind: "image";
|
|
574
|
+
readonly inputField: "image_url";
|
|
575
|
+
readonly outputKeys: ["image"];
|
|
576
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
577
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/imageutils/marigold-depth";
|
|
578
|
+
readonly defaultOptions: {
|
|
579
|
+
readonly ensemble_size: 10;
|
|
580
|
+
readonly num_inference_steps: 10;
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
readonly "depth-anything": {
|
|
584
|
+
readonly name: "Depth Anything v2 Preprocessor";
|
|
585
|
+
readonly endpoint: "fal-ai/image-preprocessors/depth-anything/v2";
|
|
586
|
+
readonly task: "depth preprocessing";
|
|
587
|
+
readonly category: "preprocess";
|
|
588
|
+
readonly description: "Generate Depth Anything v2 depth maps from input images.";
|
|
589
|
+
readonly inputKind: "image";
|
|
590
|
+
readonly inputField: "image_url";
|
|
591
|
+
readonly outputKeys: ["image"];
|
|
592
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
593
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/image-preprocessors/depth-anything/v2";
|
|
594
|
+
};
|
|
595
|
+
readonly "sam2-auto": {
|
|
596
|
+
readonly name: "SAM 2 Auto Segment";
|
|
597
|
+
readonly endpoint: "fal-ai/sam2/auto-segment";
|
|
598
|
+
readonly task: "automatic image segmentation";
|
|
599
|
+
readonly category: "segmentation";
|
|
600
|
+
readonly description: "Automatically segment an image into combined and individual masks.";
|
|
601
|
+
readonly inputKind: "image";
|
|
602
|
+
readonly inputField: "image_url";
|
|
603
|
+
readonly outputKeys: ["combined_mask", "individual_masks"];
|
|
604
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
605
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam2/auto-segment";
|
|
606
|
+
readonly defaultOptions: {
|
|
607
|
+
readonly min_mask_region_area: 100;
|
|
608
|
+
readonly output_format: "png";
|
|
609
|
+
readonly points_per_side: 32;
|
|
610
|
+
readonly pred_iou_thresh: 0.88;
|
|
611
|
+
readonly stability_score_thresh: 0.95;
|
|
612
|
+
};
|
|
613
|
+
};
|
|
614
|
+
readonly "sam3-image": {
|
|
615
|
+
readonly name: "SAM 3 Image";
|
|
616
|
+
readonly endpoint: "fal-ai/sam-3/image";
|
|
617
|
+
readonly task: "promptable image segmentation";
|
|
618
|
+
readonly category: "segmentation";
|
|
619
|
+
readonly description: "Segment image objects with text, point, or box prompts.";
|
|
620
|
+
readonly inputKind: "image";
|
|
621
|
+
readonly inputField: "image_url";
|
|
622
|
+
readonly outputKeys: ["image", "masks", "metadata", "scores", "boxes"];
|
|
623
|
+
readonly pricing: "$0.005/request";
|
|
624
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3/image";
|
|
625
|
+
readonly defaultOptions: {
|
|
626
|
+
readonly apply_mask: true;
|
|
627
|
+
readonly max_masks: 3;
|
|
628
|
+
readonly output_format: "png";
|
|
629
|
+
};
|
|
630
|
+
};
|
|
631
|
+
readonly "sam3-image-rle": {
|
|
632
|
+
readonly name: "SAM 3 Image RLE";
|
|
633
|
+
readonly endpoint: "fal-ai/sam-3/image-rle";
|
|
634
|
+
readonly task: "promptable image segmentation to RLE";
|
|
635
|
+
readonly category: "segmentation";
|
|
636
|
+
readonly description: "Segment image objects and return run-length encoded masks.";
|
|
637
|
+
readonly inputKind: "image";
|
|
638
|
+
readonly inputField: "image_url";
|
|
639
|
+
readonly outputKeys: ["rle_masks", "metadata", "scores", "boxes"];
|
|
640
|
+
readonly pricing: "$0.005/request";
|
|
641
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3/image-rle";
|
|
642
|
+
readonly defaultOptions: {
|
|
643
|
+
readonly apply_mask: true;
|
|
644
|
+
readonly max_masks: 3;
|
|
645
|
+
};
|
|
646
|
+
};
|
|
647
|
+
readonly "sam3-video": {
|
|
648
|
+
readonly name: "SAM 3 Video";
|
|
649
|
+
readonly endpoint: "fal-ai/sam-3/video";
|
|
650
|
+
readonly task: "promptable video segmentation";
|
|
651
|
+
readonly category: "segmentation";
|
|
652
|
+
readonly description: "Segment and track prompted objects across video frames.";
|
|
653
|
+
readonly inputKind: "video";
|
|
654
|
+
readonly inputField: "video_url";
|
|
655
|
+
readonly outputKeys: ["video", "boundingbox_frames_zip"];
|
|
656
|
+
readonly pricing: "$0.005/16 frames";
|
|
657
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3/video";
|
|
658
|
+
readonly defaultOptions: {
|
|
659
|
+
readonly apply_mask: true;
|
|
660
|
+
readonly detection_threshold: 0.5;
|
|
661
|
+
readonly prompt: "person";
|
|
662
|
+
readonly video_output_type: "X264 (.mp4)";
|
|
663
|
+
};
|
|
664
|
+
};
|
|
665
|
+
readonly "sam3-video-rle": {
|
|
666
|
+
readonly name: "SAM 3 Video RLE";
|
|
667
|
+
readonly endpoint: "fal-ai/sam-3/video-rle";
|
|
668
|
+
readonly task: "promptable video segmentation to RLE";
|
|
669
|
+
readonly category: "segmentation";
|
|
670
|
+
readonly description: "Track prompted video objects and return RLE mask data.";
|
|
671
|
+
readonly inputKind: "video";
|
|
672
|
+
readonly inputField: "video_url";
|
|
673
|
+
readonly outputKeys: ["rle_masks", "metadata"];
|
|
674
|
+
readonly pricing: "$0.005/16 frames";
|
|
675
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3/video-rle";
|
|
676
|
+
readonly defaultOptions: {
|
|
677
|
+
readonly apply_mask: true;
|
|
678
|
+
readonly detection_threshold: 0.5;
|
|
679
|
+
readonly prompt: "person";
|
|
680
|
+
};
|
|
681
|
+
};
|
|
682
|
+
readonly "sam3-1-video": {
|
|
683
|
+
readonly name: "SAM 3.1 Video";
|
|
684
|
+
readonly endpoint: "fal-ai/sam-3-1/video";
|
|
685
|
+
readonly task: "multi-object video segmentation";
|
|
686
|
+
readonly category: "segmentation";
|
|
687
|
+
readonly description: "SAM 3.1 video segmentation with Object Multiplex tracking for multiple objects.";
|
|
688
|
+
readonly inputKind: "video";
|
|
689
|
+
readonly inputField: "video_url";
|
|
690
|
+
readonly outputKeys: ["video", "boundingbox_frames_zip"];
|
|
691
|
+
readonly pricing: "fal pricing varies by frame count";
|
|
692
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3-1/video";
|
|
693
|
+
readonly defaultOptions: {
|
|
694
|
+
readonly apply_mask: true;
|
|
695
|
+
readonly prompt: "person";
|
|
696
|
+
};
|
|
697
|
+
};
|
|
698
|
+
readonly "sam3-3d-objects": {
|
|
699
|
+
readonly name: "SAM 3D Objects";
|
|
700
|
+
readonly endpoint: "fal-ai/sam-3/3d-objects";
|
|
701
|
+
readonly task: "single-image 3D object reconstruction";
|
|
702
|
+
readonly category: "3d";
|
|
703
|
+
readonly description: "Reconstruct one or more 3D objects from an image and prompts.";
|
|
704
|
+
readonly inputKind: "image";
|
|
705
|
+
readonly inputField: "image_url";
|
|
706
|
+
readonly outputKeys: ["gaussian_splat", "model_glb", "metadata", "individual_splats", "individual_glbs", "artifacts_zip"];
|
|
707
|
+
readonly pricing: "$0.02/generation";
|
|
708
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3/3d-objects";
|
|
709
|
+
readonly defaultOptions: {
|
|
710
|
+
readonly prompt: "car";
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
readonly "sam3-3d-body": {
|
|
714
|
+
readonly name: "SAM 3D Body";
|
|
715
|
+
readonly endpoint: "fal-ai/sam-3/3d-body";
|
|
716
|
+
readonly task: "single-image 3D body reconstruction";
|
|
717
|
+
readonly category: "3d";
|
|
718
|
+
readonly description: "Reconstruct human body meshes and keypoints from a single image.";
|
|
719
|
+
readonly inputKind: "image";
|
|
720
|
+
readonly inputField: "image_url";
|
|
721
|
+
readonly outputKeys: ["model_glb", "visualization", "meshes", "metadata"];
|
|
722
|
+
readonly pricing: "$0.015/inference";
|
|
723
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3/3d-body";
|
|
724
|
+
readonly defaultOptions: {
|
|
725
|
+
readonly export_meshes: true;
|
|
726
|
+
readonly include_3d_keypoints: true;
|
|
727
|
+
readonly include_mhr_params: true;
|
|
728
|
+
};
|
|
729
|
+
};
|
|
730
|
+
readonly "sam3-3d-align": {
|
|
731
|
+
readonly name: "SAM 3D Align";
|
|
732
|
+
readonly endpoint: "fal-ai/sam-3/3d-align";
|
|
733
|
+
readonly task: "3D scene alignment";
|
|
734
|
+
readonly category: "3d";
|
|
735
|
+
readonly description: "Align SAM 3D objects and bodies into a shared scene.";
|
|
736
|
+
readonly inputKind: "image";
|
|
737
|
+
readonly inputField: "image_url";
|
|
738
|
+
readonly outputKeys: ["scene_glb", "metadata", "artifacts_zip"];
|
|
739
|
+
readonly pricing: "fal pricing varies by scene";
|
|
740
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3/3d-align";
|
|
741
|
+
};
|
|
742
|
+
};
|
|
743
|
+
/** ─── Private ─────────────────────────────────────────────── */
|
|
744
|
+
/** Authenticated fetch to fal.ai APIs with retry logic. */
|
|
745
|
+
private request;
|
|
746
|
+
/**
|
|
747
|
+
* Normalize fal.ai responses.
|
|
748
|
+
* Some APIs return `{ image: {...} }` instead of `{ images: [...] }`.
|
|
749
|
+
*/
|
|
750
|
+
private normalizeResponse;
|
|
751
|
+
}
|
|
752
|
+
declare class MotifError extends Error {
|
|
753
|
+
readonly status: number;
|
|
754
|
+
readonly code?: string;
|
|
755
|
+
constructor(message: string, status: number, code?: string);
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
type FalToolInputKind = "image" | "images" | "video";
|
|
759
|
+
interface FalToolConfig {
|
|
760
|
+
category: "3d" | "background" | "depth" | "moderation" | "preprocess" | "segmentation" | "upscale";
|
|
761
|
+
defaultOptions?: Record<string, unknown>;
|
|
762
|
+
description: string;
|
|
763
|
+
endpoint: string;
|
|
764
|
+
inputField: "image_url" | "image_urls" | "video_url";
|
|
765
|
+
inputKind: FalToolInputKind;
|
|
766
|
+
name: string;
|
|
767
|
+
outputKeys: string[];
|
|
768
|
+
pricing: string;
|
|
769
|
+
sourceUrl: string;
|
|
770
|
+
task: string;
|
|
771
|
+
}
|
|
772
|
+
interface FalToolRunOptions {
|
|
773
|
+
input?: string;
|
|
774
|
+
inputs?: string[];
|
|
775
|
+
options?: Record<string, unknown>;
|
|
776
|
+
tool: string;
|
|
777
|
+
}
|
|
778
|
+
interface FalToolRequest {
|
|
779
|
+
body: Record<string, unknown>;
|
|
780
|
+
endpoint: string;
|
|
781
|
+
tool: FalToolConfig;
|
|
782
|
+
}
|
|
783
|
+
declare const FAL_TOOLS: {
|
|
784
|
+
readonly nsfw: {
|
|
785
|
+
readonly name: "NSFW Checker";
|
|
786
|
+
readonly endpoint: "fal-ai/x-ailab/nsfw";
|
|
787
|
+
readonly task: "vision moderation";
|
|
788
|
+
readonly category: "moderation";
|
|
789
|
+
readonly description: "Predict whether one or more images contain NSFW concepts.";
|
|
790
|
+
readonly inputKind: "images";
|
|
791
|
+
readonly inputField: "image_urls";
|
|
792
|
+
readonly outputKeys: ["has_nsfw_concepts"];
|
|
793
|
+
readonly pricing: "$0.001/image";
|
|
794
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/x-ailab/nsfw";
|
|
795
|
+
};
|
|
796
|
+
readonly "topaz-image": {
|
|
797
|
+
readonly name: "Topaz Image Upscale";
|
|
798
|
+
readonly endpoint: "fal-ai/topaz/upscale/image";
|
|
799
|
+
readonly task: "image enhancement";
|
|
800
|
+
readonly category: "upscale";
|
|
801
|
+
readonly description: "Professional Topaz image enhancement and upscaling.";
|
|
802
|
+
readonly inputKind: "image";
|
|
803
|
+
readonly inputField: "image_url";
|
|
804
|
+
readonly outputKeys: ["image"];
|
|
805
|
+
readonly pricing: "$0.08+ by output megapixels";
|
|
806
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/topaz/upscale/image";
|
|
807
|
+
readonly defaultOptions: {
|
|
808
|
+
readonly model: "Standard V2";
|
|
809
|
+
readonly output_format: "jpeg";
|
|
810
|
+
readonly upscale_factor: 2;
|
|
811
|
+
};
|
|
812
|
+
};
|
|
813
|
+
readonly "topaz-video": {
|
|
814
|
+
readonly name: "Topaz Video Upscale";
|
|
815
|
+
readonly endpoint: "fal-ai/topaz/upscale/video";
|
|
816
|
+
readonly task: "video enhancement";
|
|
817
|
+
readonly category: "upscale";
|
|
818
|
+
readonly description: "Professional Topaz video enhancement and upscaling.";
|
|
819
|
+
readonly inputKind: "video";
|
|
820
|
+
readonly inputField: "video_url";
|
|
821
|
+
readonly outputKeys: ["video"];
|
|
822
|
+
readonly pricing: "$0.01-$0.08/sec by output resolution";
|
|
823
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/topaz/upscale/video";
|
|
824
|
+
readonly defaultOptions: {
|
|
825
|
+
readonly model: "Proteus";
|
|
826
|
+
readonly upscale_factor: 2;
|
|
827
|
+
};
|
|
828
|
+
};
|
|
829
|
+
readonly "bria-rmbg": {
|
|
830
|
+
readonly name: "Bria RMBG 2.0";
|
|
831
|
+
readonly endpoint: "fal-ai/bria/background/remove";
|
|
832
|
+
readonly task: "image background removal";
|
|
833
|
+
readonly category: "background";
|
|
834
|
+
readonly description: "Commercial-safe background removal for images.";
|
|
835
|
+
readonly inputKind: "image";
|
|
836
|
+
readonly inputField: "image_url";
|
|
837
|
+
readonly outputKeys: ["image"];
|
|
838
|
+
readonly pricing: "$0.02/image";
|
|
839
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/bria/background/remove";
|
|
840
|
+
};
|
|
841
|
+
readonly birefnet: {
|
|
842
|
+
readonly name: "BirefNet Background Removal";
|
|
843
|
+
readonly endpoint: "fal-ai/birefnet/v2";
|
|
844
|
+
readonly task: "image background removal";
|
|
845
|
+
readonly category: "background";
|
|
846
|
+
readonly description: "High-resolution dichotomous image segmentation and background removal.";
|
|
847
|
+
readonly inputKind: "image";
|
|
848
|
+
readonly inputField: "image_url";
|
|
849
|
+
readonly outputKeys: ["image", "mask_image"];
|
|
850
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
851
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/birefnet/v2";
|
|
852
|
+
readonly defaultOptions: {
|
|
853
|
+
readonly model: "General Use (Light)";
|
|
854
|
+
readonly operating_resolution: "1024x1024";
|
|
855
|
+
readonly output_format: "png";
|
|
856
|
+
readonly refine_foreground: true;
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
readonly rembg: {
|
|
860
|
+
readonly name: "Remove Background";
|
|
861
|
+
readonly endpoint: "fal-ai/imageutils/rembg";
|
|
862
|
+
readonly task: "image background removal";
|
|
863
|
+
readonly category: "background";
|
|
864
|
+
readonly description: "Generic image background removal utility.";
|
|
865
|
+
readonly inputKind: "image";
|
|
866
|
+
readonly inputField: "image_url";
|
|
867
|
+
readonly outputKeys: ["image"];
|
|
868
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
869
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/imageutils/rembg";
|
|
870
|
+
readonly defaultOptions: {
|
|
871
|
+
readonly crop_to_bbox: false;
|
|
872
|
+
};
|
|
873
|
+
};
|
|
874
|
+
readonly "bria-video-rmbg": {
|
|
875
|
+
readonly name: "Bria Video Background Removal";
|
|
876
|
+
readonly endpoint: "bria/video/background-removal";
|
|
877
|
+
readonly task: "video background removal";
|
|
878
|
+
readonly category: "background";
|
|
879
|
+
readonly description: "Remove video backgrounds with configurable output container.";
|
|
880
|
+
readonly inputKind: "video";
|
|
881
|
+
readonly inputField: "video_url";
|
|
882
|
+
readonly outputKeys: ["video"];
|
|
883
|
+
readonly pricing: "$0.14/sec";
|
|
884
|
+
readonly sourceUrl: "https://fal.ai/models/bria/video/background-removal";
|
|
885
|
+
readonly defaultOptions: {
|
|
886
|
+
readonly background_color: "Black";
|
|
887
|
+
readonly output_container_and_codec: "webm_vp9";
|
|
888
|
+
readonly preserve_audio: true;
|
|
889
|
+
};
|
|
890
|
+
};
|
|
891
|
+
readonly lineart: {
|
|
892
|
+
readonly name: "Line Art Preprocessor";
|
|
893
|
+
readonly endpoint: "fal-ai/image-preprocessors/lineart";
|
|
894
|
+
readonly task: "image preprocessing";
|
|
895
|
+
readonly category: "preprocess";
|
|
896
|
+
readonly description: "Generate line art/control-style edges from an input image.";
|
|
897
|
+
readonly inputKind: "image";
|
|
898
|
+
readonly inputField: "image_url";
|
|
899
|
+
readonly outputKeys: ["image"];
|
|
900
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
901
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/image-preprocessors/lineart";
|
|
902
|
+
readonly defaultOptions: {
|
|
903
|
+
readonly coarse: false;
|
|
904
|
+
};
|
|
905
|
+
};
|
|
906
|
+
readonly "sam-preprocessor": {
|
|
907
|
+
readonly name: "SAM Preprocessor";
|
|
908
|
+
readonly endpoint: "fal-ai/image-preprocessors/sam";
|
|
909
|
+
readonly task: "segmentation preprocessing";
|
|
910
|
+
readonly category: "preprocess";
|
|
911
|
+
readonly description: "Generate a SAM segmentation map for ControlNet-style workflows.";
|
|
912
|
+
readonly inputKind: "image";
|
|
913
|
+
readonly inputField: "image_url";
|
|
914
|
+
readonly outputKeys: ["image"];
|
|
915
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
916
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/image-preprocessors/sam";
|
|
917
|
+
};
|
|
918
|
+
readonly "midas-depth": {
|
|
919
|
+
readonly name: "MiDaS Depth Estimation";
|
|
920
|
+
readonly endpoint: "fal-ai/imageutils/depth";
|
|
921
|
+
readonly task: "depth map";
|
|
922
|
+
readonly category: "depth";
|
|
923
|
+
readonly description: "Create MiDaS depth maps from input images.";
|
|
924
|
+
readonly inputKind: "image";
|
|
925
|
+
readonly inputField: "image_url";
|
|
926
|
+
readonly outputKeys: ["image"];
|
|
927
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
928
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/imageutils/depth";
|
|
929
|
+
readonly defaultOptions: {
|
|
930
|
+
readonly a: number;
|
|
931
|
+
readonly bg_th: 0.1;
|
|
932
|
+
};
|
|
933
|
+
};
|
|
934
|
+
readonly "midas-preprocessor": {
|
|
935
|
+
readonly name: "MiDaS Preprocessor";
|
|
936
|
+
readonly endpoint: "fal-ai/image-preprocessors/midas";
|
|
937
|
+
readonly task: "depth and normal preprocessing";
|
|
938
|
+
readonly category: "preprocess";
|
|
939
|
+
readonly description: "Generate MiDaS depth and normal maps for image workflows.";
|
|
940
|
+
readonly inputKind: "image";
|
|
941
|
+
readonly inputField: "image_url";
|
|
942
|
+
readonly outputKeys: ["depth_map", "normal_map"];
|
|
943
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
944
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/image-preprocessors/midas";
|
|
945
|
+
};
|
|
946
|
+
readonly "marigold-depth": {
|
|
947
|
+
readonly name: "Marigold Depth Estimation";
|
|
948
|
+
readonly endpoint: "fal-ai/imageutils/marigold-depth";
|
|
949
|
+
readonly task: "depth map";
|
|
950
|
+
readonly category: "depth";
|
|
951
|
+
readonly description: "Create depth maps using Marigold depth estimation.";
|
|
952
|
+
readonly inputKind: "image";
|
|
953
|
+
readonly inputField: "image_url";
|
|
954
|
+
readonly outputKeys: ["image"];
|
|
955
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
956
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/imageutils/marigold-depth";
|
|
957
|
+
readonly defaultOptions: {
|
|
958
|
+
readonly ensemble_size: 10;
|
|
959
|
+
readonly num_inference_steps: 10;
|
|
960
|
+
};
|
|
961
|
+
};
|
|
962
|
+
readonly "depth-anything": {
|
|
963
|
+
readonly name: "Depth Anything v2 Preprocessor";
|
|
964
|
+
readonly endpoint: "fal-ai/image-preprocessors/depth-anything/v2";
|
|
965
|
+
readonly task: "depth preprocessing";
|
|
966
|
+
readonly category: "preprocess";
|
|
967
|
+
readonly description: "Generate Depth Anything v2 depth maps from input images.";
|
|
968
|
+
readonly inputKind: "image";
|
|
969
|
+
readonly inputField: "image_url";
|
|
970
|
+
readonly outputKeys: ["image"];
|
|
971
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
972
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/image-preprocessors/depth-anything/v2";
|
|
973
|
+
};
|
|
974
|
+
readonly "sam2-auto": {
|
|
975
|
+
readonly name: "SAM 2 Auto Segment";
|
|
976
|
+
readonly endpoint: "fal-ai/sam2/auto-segment";
|
|
977
|
+
readonly task: "automatic image segmentation";
|
|
978
|
+
readonly category: "segmentation";
|
|
979
|
+
readonly description: "Automatically segment an image into combined and individual masks.";
|
|
980
|
+
readonly inputKind: "image";
|
|
981
|
+
readonly inputField: "image_url";
|
|
982
|
+
readonly outputKeys: ["combined_mask", "individual_masks"];
|
|
983
|
+
readonly pricing: "$0/compute-second listed by fal";
|
|
984
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam2/auto-segment";
|
|
985
|
+
readonly defaultOptions: {
|
|
986
|
+
readonly min_mask_region_area: 100;
|
|
987
|
+
readonly output_format: "png";
|
|
988
|
+
readonly points_per_side: 32;
|
|
989
|
+
readonly pred_iou_thresh: 0.88;
|
|
990
|
+
readonly stability_score_thresh: 0.95;
|
|
991
|
+
};
|
|
992
|
+
};
|
|
993
|
+
readonly "sam3-image": {
|
|
994
|
+
readonly name: "SAM 3 Image";
|
|
995
|
+
readonly endpoint: "fal-ai/sam-3/image";
|
|
996
|
+
readonly task: "promptable image segmentation";
|
|
997
|
+
readonly category: "segmentation";
|
|
998
|
+
readonly description: "Segment image objects with text, point, or box prompts.";
|
|
999
|
+
readonly inputKind: "image";
|
|
1000
|
+
readonly inputField: "image_url";
|
|
1001
|
+
readonly outputKeys: ["image", "masks", "metadata", "scores", "boxes"];
|
|
1002
|
+
readonly pricing: "$0.005/request";
|
|
1003
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3/image";
|
|
1004
|
+
readonly defaultOptions: {
|
|
1005
|
+
readonly apply_mask: true;
|
|
1006
|
+
readonly max_masks: 3;
|
|
1007
|
+
readonly output_format: "png";
|
|
1008
|
+
};
|
|
1009
|
+
};
|
|
1010
|
+
readonly "sam3-image-rle": {
|
|
1011
|
+
readonly name: "SAM 3 Image RLE";
|
|
1012
|
+
readonly endpoint: "fal-ai/sam-3/image-rle";
|
|
1013
|
+
readonly task: "promptable image segmentation to RLE";
|
|
1014
|
+
readonly category: "segmentation";
|
|
1015
|
+
readonly description: "Segment image objects and return run-length encoded masks.";
|
|
1016
|
+
readonly inputKind: "image";
|
|
1017
|
+
readonly inputField: "image_url";
|
|
1018
|
+
readonly outputKeys: ["rle_masks", "metadata", "scores", "boxes"];
|
|
1019
|
+
readonly pricing: "$0.005/request";
|
|
1020
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3/image-rle";
|
|
1021
|
+
readonly defaultOptions: {
|
|
1022
|
+
readonly apply_mask: true;
|
|
1023
|
+
readonly max_masks: 3;
|
|
1024
|
+
};
|
|
1025
|
+
};
|
|
1026
|
+
readonly "sam3-video": {
|
|
1027
|
+
readonly name: "SAM 3 Video";
|
|
1028
|
+
readonly endpoint: "fal-ai/sam-3/video";
|
|
1029
|
+
readonly task: "promptable video segmentation";
|
|
1030
|
+
readonly category: "segmentation";
|
|
1031
|
+
readonly description: "Segment and track prompted objects across video frames.";
|
|
1032
|
+
readonly inputKind: "video";
|
|
1033
|
+
readonly inputField: "video_url";
|
|
1034
|
+
readonly outputKeys: ["video", "boundingbox_frames_zip"];
|
|
1035
|
+
readonly pricing: "$0.005/16 frames";
|
|
1036
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3/video";
|
|
1037
|
+
readonly defaultOptions: {
|
|
1038
|
+
readonly apply_mask: true;
|
|
1039
|
+
readonly detection_threshold: 0.5;
|
|
1040
|
+
readonly prompt: "person";
|
|
1041
|
+
readonly video_output_type: "X264 (.mp4)";
|
|
1042
|
+
};
|
|
1043
|
+
};
|
|
1044
|
+
readonly "sam3-video-rle": {
|
|
1045
|
+
readonly name: "SAM 3 Video RLE";
|
|
1046
|
+
readonly endpoint: "fal-ai/sam-3/video-rle";
|
|
1047
|
+
readonly task: "promptable video segmentation to RLE";
|
|
1048
|
+
readonly category: "segmentation";
|
|
1049
|
+
readonly description: "Track prompted video objects and return RLE mask data.";
|
|
1050
|
+
readonly inputKind: "video";
|
|
1051
|
+
readonly inputField: "video_url";
|
|
1052
|
+
readonly outputKeys: ["rle_masks", "metadata"];
|
|
1053
|
+
readonly pricing: "$0.005/16 frames";
|
|
1054
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3/video-rle";
|
|
1055
|
+
readonly defaultOptions: {
|
|
1056
|
+
readonly apply_mask: true;
|
|
1057
|
+
readonly detection_threshold: 0.5;
|
|
1058
|
+
readonly prompt: "person";
|
|
1059
|
+
};
|
|
1060
|
+
};
|
|
1061
|
+
readonly "sam3-1-video": {
|
|
1062
|
+
readonly name: "SAM 3.1 Video";
|
|
1063
|
+
readonly endpoint: "fal-ai/sam-3-1/video";
|
|
1064
|
+
readonly task: "multi-object video segmentation";
|
|
1065
|
+
readonly category: "segmentation";
|
|
1066
|
+
readonly description: "SAM 3.1 video segmentation with Object Multiplex tracking for multiple objects.";
|
|
1067
|
+
readonly inputKind: "video";
|
|
1068
|
+
readonly inputField: "video_url";
|
|
1069
|
+
readonly outputKeys: ["video", "boundingbox_frames_zip"];
|
|
1070
|
+
readonly pricing: "fal pricing varies by frame count";
|
|
1071
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3-1/video";
|
|
1072
|
+
readonly defaultOptions: {
|
|
1073
|
+
readonly apply_mask: true;
|
|
1074
|
+
readonly prompt: "person";
|
|
1075
|
+
};
|
|
1076
|
+
};
|
|
1077
|
+
readonly "sam3-3d-objects": {
|
|
1078
|
+
readonly name: "SAM 3D Objects";
|
|
1079
|
+
readonly endpoint: "fal-ai/sam-3/3d-objects";
|
|
1080
|
+
readonly task: "single-image 3D object reconstruction";
|
|
1081
|
+
readonly category: "3d";
|
|
1082
|
+
readonly description: "Reconstruct one or more 3D objects from an image and prompts.";
|
|
1083
|
+
readonly inputKind: "image";
|
|
1084
|
+
readonly inputField: "image_url";
|
|
1085
|
+
readonly outputKeys: ["gaussian_splat", "model_glb", "metadata", "individual_splats", "individual_glbs", "artifacts_zip"];
|
|
1086
|
+
readonly pricing: "$0.02/generation";
|
|
1087
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3/3d-objects";
|
|
1088
|
+
readonly defaultOptions: {
|
|
1089
|
+
readonly prompt: "car";
|
|
1090
|
+
};
|
|
1091
|
+
};
|
|
1092
|
+
readonly "sam3-3d-body": {
|
|
1093
|
+
readonly name: "SAM 3D Body";
|
|
1094
|
+
readonly endpoint: "fal-ai/sam-3/3d-body";
|
|
1095
|
+
readonly task: "single-image 3D body reconstruction";
|
|
1096
|
+
readonly category: "3d";
|
|
1097
|
+
readonly description: "Reconstruct human body meshes and keypoints from a single image.";
|
|
1098
|
+
readonly inputKind: "image";
|
|
1099
|
+
readonly inputField: "image_url";
|
|
1100
|
+
readonly outputKeys: ["model_glb", "visualization", "meshes", "metadata"];
|
|
1101
|
+
readonly pricing: "$0.015/inference";
|
|
1102
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3/3d-body";
|
|
1103
|
+
readonly defaultOptions: {
|
|
1104
|
+
readonly export_meshes: true;
|
|
1105
|
+
readonly include_3d_keypoints: true;
|
|
1106
|
+
readonly include_mhr_params: true;
|
|
1107
|
+
};
|
|
1108
|
+
};
|
|
1109
|
+
readonly "sam3-3d-align": {
|
|
1110
|
+
readonly name: "SAM 3D Align";
|
|
1111
|
+
readonly endpoint: "fal-ai/sam-3/3d-align";
|
|
1112
|
+
readonly task: "3D scene alignment";
|
|
1113
|
+
readonly category: "3d";
|
|
1114
|
+
readonly description: "Align SAM 3D objects and bodies into a shared scene.";
|
|
1115
|
+
readonly inputKind: "image";
|
|
1116
|
+
readonly inputField: "image_url";
|
|
1117
|
+
readonly outputKeys: ["scene_glb", "metadata", "artifacts_zip"];
|
|
1118
|
+
readonly pricing: "fal pricing varies by scene";
|
|
1119
|
+
readonly sourceUrl: "https://fal.ai/models/fal-ai/sam-3/3d-align";
|
|
1120
|
+
};
|
|
1121
|
+
};
|
|
1122
|
+
declare const FAL_TOOLS_CHECKED_AT = "2026-05-12";
|
|
1123
|
+
declare const FAL_TOOL_IDS: Array<keyof typeof FAL_TOOLS>;
|
|
1124
|
+
type FalToolId = (typeof FAL_TOOL_IDS)[number];
|
|
1125
|
+
declare function isFalToolId(tool: string): tool is FalToolId;
|
|
1126
|
+
declare function buildFalToolRequest(options: FalToolRunOptions): FalToolRequest;
|
|
1127
|
+
|
|
1128
|
+
export { ASPECT_RATIOS, type AspectRatio, type BackgroundMode, type CustomImageSize, FAL_TOOLS, FAL_TOOLS_CHECKED_AT, FAL_TOOL_IDS, FORMAT_PRESETS, 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, MotifServer, type MotifServerConfig, 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, estimateCost, estimateVideoCost, getFalKeyFromEnv, isFalToolId, motifEnvSchema, parseMotifEnv };
|