@shop-os/modelkit 0.4.7 → 0.6.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 +71 -0
- package/README.md +43 -5
- package/dist/catalog.cjs +6291 -882
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +660 -34
- package/dist/catalog.d.ts +660 -34
- package/dist/catalog.js +6291 -882
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +11226 -3910
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +654 -25
- package/dist/index.d.ts +654 -25
- package/dist/index.js +11211 -3910
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/catalog.d.cts
CHANGED
|
@@ -31,6 +31,19 @@ type MediaRef = {
|
|
|
31
31
|
/** Measured length of a video/audio; the kit never measures it. */
|
|
32
32
|
durationSeconds?: number;
|
|
33
33
|
};
|
|
34
|
+
/** A click on the image for `mask` rows, in source pixels; `background` excludes the spot. */
|
|
35
|
+
interface MaskPoint {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
label?: "foreground" | "background";
|
|
39
|
+
}
|
|
40
|
+
/** A box around the object to mask, in source pixels. */
|
|
41
|
+
interface MaskBox {
|
|
42
|
+
xMin: number;
|
|
43
|
+
yMin: number;
|
|
44
|
+
xMax: number;
|
|
45
|
+
yMax: number;
|
|
46
|
+
}
|
|
34
47
|
/** Caller-driven Topaz upscale controls; see the topaz row and TopazImageInput. */
|
|
35
48
|
interface UpscaleOptions {
|
|
36
49
|
enhanceModel?: string;
|
|
@@ -39,13 +52,83 @@ interface UpscaleOptions {
|
|
|
39
52
|
faceEnhancementCreativity?: number;
|
|
40
53
|
faceEnhancementStrength?: number;
|
|
41
54
|
}
|
|
42
|
-
type ModelType = "text" | "image" | "video" | "audio"
|
|
43
|
-
/**
|
|
44
|
-
| "
|
|
55
|
+
type ModelType = "text" | "image" | "video" | "audio"
|
|
56
|
+
/** Sound effects (`generateAudio`): a text description, or a `sourceVideo` to score when the row requires one. */
|
|
57
|
+
| "sound-effect" | "upscale" | "bg-remove"
|
|
58
|
+
/** Image segmentation (`generateImage`): one image and a prompt in, one mask per match out. */
|
|
59
|
+
| "mask"
|
|
60
|
+
/** Video in, video out, no prompt: upscale, frame interpolation, SDR to HDR, background removal, subtitles. */
|
|
61
|
+
| "video-tool"
|
|
62
|
+
/** Text to speech (`generateSpeech`). */
|
|
63
|
+
| "speech"
|
|
64
|
+
/** Speech to speech in another voice (`changeVoice`). */
|
|
65
|
+
| "voice-change"
|
|
66
|
+
/** Speech translated into `targetLanguage` (`dub`), from a video or an audio file. */
|
|
67
|
+
| "dubbing"
|
|
68
|
+
/** A face driven by speech (`lipsync`): a `sourceVideo` re-timed or a still `image` animated. */
|
|
69
|
+
| "lipsync"
|
|
70
|
+
/** Speech to text (`transcribe`). */
|
|
71
|
+
| "transcription"
|
|
72
|
+
/** A prompt and/or photos of an object in, a GLB 3D model out. */
|
|
73
|
+
| "model3d";
|
|
74
|
+
/**
|
|
75
|
+
* How a `model3d` row's provider API is shaped. The adapter builds the request body and
|
|
76
|
+
* reads the result per family; everything a caller shows (inputs, views, options) is
|
|
77
|
+
* data on the row's `constraints.model3d`.
|
|
78
|
+
*/
|
|
79
|
+
type Model3dFamily = "trellis" | "hunyuan" | "tripo" | "rodin" | "meshy" | "hi3d" | "sam";
|
|
80
|
+
/**
|
|
81
|
+
* How a `model3d` row takes extra views of the object:
|
|
82
|
+
* - `none`: one image only.
|
|
83
|
+
* - `unordered`: a list of images in any order (Meshy, Rodin).
|
|
84
|
+
* - `ordered`: front, left, back, right, contiguous from the front (Tripo).
|
|
85
|
+
* - `named`: one slot per side (Hunyuan, Hi3D).
|
|
86
|
+
*/
|
|
87
|
+
type Model3dViews = "none" | "unordered" | "ordered" | "named";
|
|
88
|
+
type Model3dTexture = "none" | "standard" | "detailed";
|
|
89
|
+
/** fal paths a `model3d` row calls, by what the request carries. */
|
|
90
|
+
interface Model3dEndpoints {
|
|
91
|
+
/** A prompt and no image. */
|
|
92
|
+
text?: string;
|
|
93
|
+
/** One image. */
|
|
94
|
+
image?: string;
|
|
95
|
+
/** More than one image (the main image plus views). */
|
|
96
|
+
multiImage?: string;
|
|
97
|
+
}
|
|
98
|
+
/** What a `model3d` row takes and offers; see Model3dFamily. */
|
|
99
|
+
interface Model3dConstraints {
|
|
100
|
+
family: Model3dFamily;
|
|
101
|
+
endpoints: Model3dEndpoints;
|
|
102
|
+
/** Takes a text prompt (text-to-3D, or SAM's object name). */
|
|
103
|
+
text: boolean;
|
|
104
|
+
/** Needs an image whatever else is sent. */
|
|
105
|
+
imageRequired: boolean;
|
|
106
|
+
/** Needs a prompt whatever else is sent (SAM names the object to lift). */
|
|
107
|
+
promptRequired?: boolean;
|
|
108
|
+
views: Model3dViews;
|
|
109
|
+
/** Most images one request takes, the main image included. */
|
|
110
|
+
maxImages: number;
|
|
111
|
+
/** Texture choices; empty means the model has no texture switch. */
|
|
112
|
+
texture: Model3dTexture[];
|
|
113
|
+
pbr: boolean;
|
|
114
|
+
/** Takes a texture prompt and a texture image (Meshy). */
|
|
115
|
+
textureRef: boolean;
|
|
116
|
+
/** The provider takes a seed (for Meshy, only from a prompt). */
|
|
117
|
+
seed: boolean;
|
|
118
|
+
/** Largest seed the provider takes (Rodin: 65535); absent, any non-negative integer. */
|
|
119
|
+
seedMax?: number;
|
|
120
|
+
/** A quality or resolution choice the row prices by; absent when it has none. */
|
|
121
|
+
resolutions?: {
|
|
122
|
+
label: string;
|
|
123
|
+
options: string[];
|
|
124
|
+
default: string;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
45
127
|
/** What a `video-tool` row does to its source clip. */
|
|
46
|
-
type VideoToolKind = "upscale" | "interpolate" | "hdr";
|
|
128
|
+
type VideoToolKind = "upscale" | "interpolate" | "hdr" | "bg-remove" | "subtitles";
|
|
47
129
|
/** Container/codec a video-tool row can write. */
|
|
48
|
-
|
|
130
|
+
/** `exr`: a ZIP of 16-bit EXR frames in `VideoToolResult.frames`, with an MP4 preview as `video`. */
|
|
131
|
+
type VideoToolOutputFormat = "h265" | "prores" | "exr";
|
|
49
132
|
type Lifecycle = "active" | "deprecated" | "retired";
|
|
50
133
|
type Surface = "cowork" | "space_builder";
|
|
51
134
|
/** @deprecated use Surface[] */
|
|
@@ -75,6 +158,10 @@ interface ImageRequest {
|
|
|
75
158
|
temperature?: number;
|
|
76
159
|
/** Upscaler controls beyond `scaleFactor`/`outputFormat` (Topaz). */
|
|
77
160
|
upscale?: UpscaleOptions;
|
|
161
|
+
/** Mask rows with `supports: points`: spots that refine what the prompt selects. */
|
|
162
|
+
points?: MaskPoint[];
|
|
163
|
+
/** Mask rows with `supports: boxes`: boxes around the objects to mask. */
|
|
164
|
+
boxes?: MaskBox[];
|
|
78
165
|
}
|
|
79
166
|
/**
|
|
80
167
|
* What a caller passes to generateImage. Same field names as the AI SDK's
|
|
@@ -122,6 +209,12 @@ interface VideoRequest {
|
|
|
122
209
|
* adapter sends the prompt alone; `taskType: "extend"` still selects the extend path. */
|
|
123
210
|
previousInteractionId?: string;
|
|
124
211
|
mode?: "standard" | "pro";
|
|
212
|
+
/** Rows with `supports: ["insertWindow"]`: where the generated scene starts in the
|
|
213
|
+
* source clip and where the source footage resumes, in seconds. */
|
|
214
|
+
insertWindow?: {
|
|
215
|
+
startSeconds: number;
|
|
216
|
+
resumeSeconds: number;
|
|
217
|
+
};
|
|
125
218
|
}
|
|
126
219
|
/**
|
|
127
220
|
* What a caller passes to generateVideo. `duration` is the AI SDK spelling of
|
|
@@ -149,12 +242,38 @@ interface VideoToolRequest {
|
|
|
149
242
|
source: VideoToolSource;
|
|
150
243
|
/** Upscale rows. */
|
|
151
244
|
upscaleFactor?: number;
|
|
152
|
-
/**
|
|
245
|
+
/** Rows whose `constraints.tool.prompt` is set; ignored by every other row. */
|
|
153
246
|
prompt?: string;
|
|
154
247
|
/** Interpolate rows. */
|
|
155
248
|
targetFps?: number;
|
|
156
249
|
/** HDR rows; the row's first `outputFormats` entry when unset. */
|
|
157
250
|
outputFormat?: VideoToolOutputFormat;
|
|
251
|
+
/** Subtitles rows: caption style and language; the row's first preset when unset. */
|
|
252
|
+
subtitles?: SubtitleOptions;
|
|
253
|
+
}
|
|
254
|
+
/** Per-tier caption text overrides; an unset field keeps the preset's own. */
|
|
255
|
+
interface SubtitleTextStyle {
|
|
256
|
+
/** A Google Font name the provider supports. */
|
|
257
|
+
font?: string;
|
|
258
|
+
/** 100 to 900. */
|
|
259
|
+
weight?: number;
|
|
260
|
+
/** `#rgb` or `#rrggbb`. */
|
|
261
|
+
color?: string;
|
|
262
|
+
}
|
|
263
|
+
/** Burned-in caption options; every unset field keeps the preset's own. */
|
|
264
|
+
interface SubtitleOptions {
|
|
265
|
+
/** One of `constraints.tool.presets`. */
|
|
266
|
+
preset?: string;
|
|
267
|
+
/** The spoken language (one of `tool.languages`); the provider detects it when unset. */
|
|
268
|
+
language?: string;
|
|
269
|
+
/** Caption in this language instead (one of `tool.translationLanguages`). */
|
|
270
|
+
translationLanguage?: string;
|
|
271
|
+
position?: "top" | "center" | "bottom";
|
|
272
|
+
shadow?: "none" | "min" | "mid" | "max";
|
|
273
|
+
/** Every word. */
|
|
274
|
+
baseline?: SubtitleTextStyle;
|
|
275
|
+
/** The words the provider marks as key. */
|
|
276
|
+
highlighted?: SubtitleTextStyle;
|
|
158
277
|
}
|
|
159
278
|
/** The output a video-tool request will produce, from the request alone. */
|
|
160
279
|
interface VideoToolOutputSpec {
|
|
@@ -162,8 +281,11 @@ interface VideoToolOutputSpec {
|
|
|
162
281
|
height: number;
|
|
163
282
|
durationSeconds: number;
|
|
164
283
|
fps?: number;
|
|
284
|
+
/** HDR: the frames the row renders at `fps`, which the request sends. */
|
|
285
|
+
frames?: number;
|
|
165
286
|
resolution: VideoResolution;
|
|
166
|
-
|
|
287
|
+
/** `vp9` (WebM with alpha) is what a `bg-remove` row writes. */
|
|
288
|
+
format: "h264" | "vp9" | VideoToolOutputFormat;
|
|
167
289
|
}
|
|
168
290
|
interface VideoToolCallContext extends CallContext {
|
|
169
291
|
/** Where the provider posts the result when the job ends. */
|
|
@@ -191,10 +313,79 @@ interface VideoToolResult {
|
|
|
191
313
|
mime?: string;
|
|
192
314
|
bytes?: number;
|
|
193
315
|
};
|
|
316
|
+
/** The frame archive of an `exr` row; `video` is then its preview. */
|
|
317
|
+
frames?: {
|
|
318
|
+
url: string;
|
|
319
|
+
mime?: string;
|
|
320
|
+
bytes?: number;
|
|
321
|
+
};
|
|
194
322
|
output: VideoToolOutputSpec;
|
|
195
323
|
usage: UsageEvent;
|
|
196
324
|
raw?: unknown;
|
|
197
325
|
}
|
|
326
|
+
/** One 3D generation. Image URLs must be public; the provider fetches them. */
|
|
327
|
+
interface Model3dRequest {
|
|
328
|
+
model: string;
|
|
329
|
+
prompt?: string;
|
|
330
|
+
/** The main (front) image. */
|
|
331
|
+
image?: string;
|
|
332
|
+
/**
|
|
333
|
+
* Extra views of the same object; read only by rows whose `views` is not `none`. `top` is a
|
|
334
|
+
* fifth photo that only `unordered` rows send (all five fit Rodin's `maxImages` 5; Meshy sends
|
|
335
|
+
* the first 4 set); `named` and `ordered` rows have no slot for it and ignore it.
|
|
336
|
+
*/
|
|
337
|
+
views?: {
|
|
338
|
+
back?: string;
|
|
339
|
+
left?: string;
|
|
340
|
+
right?: string;
|
|
341
|
+
top?: string;
|
|
342
|
+
};
|
|
343
|
+
/** Rows with `textureRef`. */
|
|
344
|
+
texturePrompt?: string;
|
|
345
|
+
textureImage?: string;
|
|
346
|
+
/** The row's `texture` default when unset; ignored by rows without a texture switch. */
|
|
347
|
+
texture?: Model3dTexture;
|
|
348
|
+
/** Rows with `pbr`; only applied to a textured model. */
|
|
349
|
+
pbr?: boolean;
|
|
350
|
+
/** One of the row's `resolutions.options`; its default when unset. */
|
|
351
|
+
resolution?: string;
|
|
352
|
+
/** Rows with `seed`. */
|
|
353
|
+
seed?: number;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* A submitted 3D job. Plain JSON so a caller can store it and pass it back to
|
|
357
|
+
* `model3dStatus` / `model3dResult` / `cancelModel3d` from another process.
|
|
358
|
+
*/
|
|
359
|
+
interface Model3dSubmission {
|
|
360
|
+
model: string;
|
|
361
|
+
provider: "fal";
|
|
362
|
+
/** The fal path the job went to. */
|
|
363
|
+
endpoint: string;
|
|
364
|
+
/** The priced option combination (pro-backend credit_pricing_flat model key). */
|
|
365
|
+
sku: string;
|
|
366
|
+
requestId: string;
|
|
367
|
+
statusUrl: string;
|
|
368
|
+
responseUrl: string;
|
|
369
|
+
cancelUrl: string;
|
|
370
|
+
/** Epoch ms when the kit submitted the job; the result's usage `latencyMs` is measured from it. */
|
|
371
|
+
submittedAt?: number;
|
|
372
|
+
}
|
|
373
|
+
type Model3dStatus = "queued" | "running" | "completed";
|
|
374
|
+
interface Model3dResult {
|
|
375
|
+
/** The binary glTF the provider made. */
|
|
376
|
+
glb: {
|
|
377
|
+
url: string;
|
|
378
|
+
mime?: string;
|
|
379
|
+
bytes?: number;
|
|
380
|
+
};
|
|
381
|
+
/** The provider's still of the model, when it returns one. */
|
|
382
|
+
thumbnail?: {
|
|
383
|
+
url: string;
|
|
384
|
+
};
|
|
385
|
+
sku: string;
|
|
386
|
+
usage: UsageEvent;
|
|
387
|
+
raw?: unknown;
|
|
388
|
+
}
|
|
198
389
|
interface AudioRequest {
|
|
199
390
|
model: string;
|
|
200
391
|
prompt: string;
|
|
@@ -206,22 +397,118 @@ interface AudioRequest {
|
|
|
206
397
|
seed?: number;
|
|
207
398
|
/** Music models: no vocals. */
|
|
208
399
|
instrumental?: boolean;
|
|
400
|
+
/** Music rows with `supports: lyrics`: the words to sing, with [verse]/[chorus] tags. */
|
|
401
|
+
lyrics?: string;
|
|
402
|
+
/** One of the row's `constraints.outputFormats`; the row default when unset. */
|
|
403
|
+
outputFormat?: string;
|
|
209
404
|
/** Cancellation; combined with CallContext.signal before dispatch. */
|
|
210
405
|
abortSignal?: AbortSignal;
|
|
211
406
|
}
|
|
407
|
+
/** A provider file: a URL it hosts, or the bytes when it returns them inline. */
|
|
408
|
+
type MediaOutput = {
|
|
409
|
+
bytes: Uint8Array;
|
|
410
|
+
mime: string;
|
|
411
|
+
} | {
|
|
412
|
+
url: string;
|
|
413
|
+
mime?: string;
|
|
414
|
+
expiresAt?: Date;
|
|
415
|
+
};
|
|
212
416
|
interface AudioResult {
|
|
213
|
-
audio:
|
|
214
|
-
bytes: Uint8Array;
|
|
215
|
-
mime: string;
|
|
216
|
-
} | {
|
|
217
|
-
url: string;
|
|
218
|
-
expiresAt?: Date;
|
|
219
|
-
};
|
|
417
|
+
audio: MediaOutput;
|
|
220
418
|
/** Lyria returns lyrics as text parts next to the audio. */
|
|
221
419
|
text?: string;
|
|
222
420
|
usage: UsageEvent;
|
|
223
421
|
raw?: JsonValue;
|
|
224
422
|
}
|
|
423
|
+
/** `generateSpeech` on a `speech` row. Voice, language and format are ids the row lists. */
|
|
424
|
+
interface SpeechRequest {
|
|
425
|
+
model: string;
|
|
426
|
+
/** The script, spoken verbatim. */
|
|
427
|
+
text: string;
|
|
428
|
+
/** One of `constraints.voices[].id`; the row default when unset. */
|
|
429
|
+
voice?: string;
|
|
430
|
+
/** One of `constraints.languages[].code`; the provider detects it when unset. */
|
|
431
|
+
language?: string;
|
|
432
|
+
/** Rows with `supports: style`: how to speak it ("warm and slow"), kept out of the script. */
|
|
433
|
+
style?: string;
|
|
434
|
+
/** One of `constraints.outputFormats`; the row default when unset. */
|
|
435
|
+
outputFormat?: string;
|
|
436
|
+
abortSignal?: AbortSignal;
|
|
437
|
+
}
|
|
438
|
+
/** `changeVoice` on a `voice-change` row: the recording re-spoken in another voice. */
|
|
439
|
+
interface VoiceChangeRequest {
|
|
440
|
+
model: string;
|
|
441
|
+
/** Set `durationSeconds` so `constraints.references.audioSeconds` can be checked. */
|
|
442
|
+
sourceAudio: MediaRef;
|
|
443
|
+
voice?: string;
|
|
444
|
+
outputFormat?: string;
|
|
445
|
+
abortSignal?: AbortSignal;
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* `lipsync` on a `lipsync` row. The row's `requires` names the face input: `sourceVideo` (a
|
|
449
|
+
* video re-timed to the speech) or `firstFrame` (a still `image` animated).
|
|
450
|
+
*/
|
|
451
|
+
interface LipsyncRequest {
|
|
452
|
+
model: string;
|
|
453
|
+
sourceVideo?: MediaRef;
|
|
454
|
+
image?: MediaRef;
|
|
455
|
+
/** The speech. Set `durationSeconds` so `constraints.references.audioSeconds` can be checked. */
|
|
456
|
+
audio: MediaRef;
|
|
457
|
+
/** Rows that list `constraints.resolutions`; the row default when unset. */
|
|
458
|
+
resolution?: VideoResolution;
|
|
459
|
+
abortSignal?: AbortSignal;
|
|
460
|
+
}
|
|
461
|
+
interface LipsyncResult {
|
|
462
|
+
video: MediaOutput;
|
|
463
|
+
usage: UsageEvent;
|
|
464
|
+
raw?: unknown;
|
|
465
|
+
}
|
|
466
|
+
/** `dub` on a `dubbing` row: exactly one of `sourceVideo` / `sourceAudio`. */
|
|
467
|
+
interface DubbingRequest {
|
|
468
|
+
model: string;
|
|
469
|
+
sourceVideo?: MediaRef;
|
|
470
|
+
sourceAudio?: MediaRef;
|
|
471
|
+
/** One of `constraints.languages[].code`. */
|
|
472
|
+
targetLanguage: string;
|
|
473
|
+
/** One of `constraints.outputFormats` on rows that list them. */
|
|
474
|
+
outputFormat?: string;
|
|
475
|
+
abortSignal?: AbortSignal;
|
|
476
|
+
}
|
|
477
|
+
/** The dubbed media, of the same kind as the source. */
|
|
478
|
+
interface DubbingResult {
|
|
479
|
+
video?: MediaOutput;
|
|
480
|
+
audio?: MediaOutput;
|
|
481
|
+
usage: UsageEvent;
|
|
482
|
+
raw?: unknown;
|
|
483
|
+
}
|
|
484
|
+
interface TranscriptionRequest {
|
|
485
|
+
model: string;
|
|
486
|
+
/** The speech, audio or video. Set `durationSeconds` so limits and usage can use it. */
|
|
487
|
+
source: MediaRef;
|
|
488
|
+
/** One of `constraints.languages[].code`; the provider detects the language when unset. */
|
|
489
|
+
language?: string;
|
|
490
|
+
/** Also return `subtitles` (SRT) built from the word timings. */
|
|
491
|
+
timestamps?: boolean;
|
|
492
|
+
abortSignal?: AbortSignal;
|
|
493
|
+
}
|
|
494
|
+
interface TranscriptWord {
|
|
495
|
+
text: string;
|
|
496
|
+
/** `word`, `spacing` or `audio_event` (ElevenLabs Scribe). */
|
|
497
|
+
type: string;
|
|
498
|
+
start?: number;
|
|
499
|
+
end?: number;
|
|
500
|
+
speakerId?: string;
|
|
501
|
+
}
|
|
502
|
+
interface TranscriptionResult {
|
|
503
|
+
text: string;
|
|
504
|
+
/** SubRip (SRT) cues, when the request asked for `timestamps`. */
|
|
505
|
+
subtitles?: string;
|
|
506
|
+
/** The language the provider detected or was told. */
|
|
507
|
+
language?: string;
|
|
508
|
+
words: TranscriptWord[];
|
|
509
|
+
usage: UsageEvent;
|
|
510
|
+
raw?: JsonValue;
|
|
511
|
+
}
|
|
225
512
|
/** An AI SDK file part ready for generateText/generateObject, e.g. a video for understanding. */
|
|
226
513
|
interface MediaPart {
|
|
227
514
|
type: "file";
|
|
@@ -230,10 +517,18 @@ interface MediaPart {
|
|
|
230
517
|
/** Set when the bytes were uploaded to a provider file store (Gemini Files API). Call `cleanup` after the request. */
|
|
231
518
|
cleanup?: () => Promise<void>;
|
|
232
519
|
}
|
|
233
|
-
type RequiredInput = "firstFrame" | "sourceVideo" | "references";
|
|
520
|
+
type RequiredInput = "firstFrame" | "sourceVideo" | "references" | "sourceAudio";
|
|
234
521
|
type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "taskType" | "instrumental"
|
|
522
|
+
/** Music rows that sing `AudioRequest.lyrics`. */
|
|
523
|
+
| "lyrics"
|
|
524
|
+
/** Speech rows that take `SpeechRequest.style`, a delivery instruction. */
|
|
525
|
+
| "style"
|
|
235
526
|
/** Video rows that extend a clip in fixed segments up to a cumulative cap (see `ModelConstraints.extension`). */
|
|
236
|
-
| "videoExtension"
|
|
527
|
+
| "videoExtension"
|
|
528
|
+
/** Video rows that generate a scene inside a source clip (`VideoRequest.insertWindow`). */
|
|
529
|
+
| "insertWindow"
|
|
530
|
+
/** Mask rows: `ImageRequest.points` and `ImageRequest.boxes`. */
|
|
531
|
+
| "points" | "boxes";
|
|
237
532
|
interface VideoSecondsLimits {
|
|
238
533
|
/** Minimum length of each reference video, in seconds. */
|
|
239
534
|
min?: number;
|
|
@@ -265,6 +560,16 @@ interface ReferenceLimits {
|
|
|
265
560
|
audioFormats?: string[];
|
|
266
561
|
/** Largest reference audio file the provider takes, in bytes. */
|
|
267
562
|
audioMaxBytes?: number;
|
|
563
|
+
/**
|
|
564
|
+
* Video rows: the fewest references of each kind a request needs (Kling 3.0 Motion Control:
|
|
565
|
+
* one image and one video). `requires: ["references"]` needs one of any kind; this names
|
|
566
|
+
* the kinds. Kits before 0.5.0 ignore it.
|
|
567
|
+
*/
|
|
568
|
+
min?: {
|
|
569
|
+
images?: number;
|
|
570
|
+
videos?: number;
|
|
571
|
+
audios?: number;
|
|
572
|
+
};
|
|
268
573
|
}
|
|
269
574
|
interface VideoToolConstraints {
|
|
270
575
|
kind: VideoToolKind;
|
|
@@ -275,7 +580,7 @@ interface VideoToolConstraints {
|
|
|
275
580
|
};
|
|
276
581
|
/** Upscale: the output's long edge may not pass this, in pixels. */
|
|
277
582
|
maxOutputLongEdge?: number;
|
|
278
|
-
/** Upscale: the row takes an optional prompt that guides
|
|
583
|
+
/** Upscale and HDR: the row takes an optional prompt that guides the result. */
|
|
279
584
|
prompt?: boolean;
|
|
280
585
|
/** Interpolate: allowed target frame rate range. */
|
|
281
586
|
fps?: {
|
|
@@ -284,11 +589,45 @@ interface VideoToolConstraints {
|
|
|
284
589
|
};
|
|
285
590
|
/** HDR: the formats the row writes, first is the default. */
|
|
286
591
|
outputFormats?: VideoToolOutputFormat[];
|
|
592
|
+
/** The output's short edge is scaled down to this many pixels, keeping the aspect ratio. */
|
|
593
|
+
maxOutputShortEdge?: number;
|
|
594
|
+
/** The most frames the row renders (duration times frame rate). */
|
|
595
|
+
maxOutputFrames?: number;
|
|
596
|
+
/** HDR: the fewest frames the row renders; a shorter source is padded to it. */
|
|
597
|
+
minOutputFrames?: number;
|
|
598
|
+
/** HDR: the fastest output rate; a faster source renders at this rate. */
|
|
599
|
+
maxOutputFps?: number;
|
|
600
|
+
/** Subtitles: the caption styles, first is the default. */
|
|
601
|
+
presets?: string[];
|
|
602
|
+
/** Subtitles: spoken-language codes the provider transcribes. */
|
|
603
|
+
languages?: string[];
|
|
604
|
+
/** Subtitles: codes the provider can translate the captions into. */
|
|
605
|
+
translationLanguages?: string[];
|
|
606
|
+
/** Subtitles: the longest source above 1080p, in seconds (`sourceVideoSeconds.max` covers the rest). */
|
|
607
|
+
maxSecondsAbove1080p?: number;
|
|
287
608
|
}
|
|
288
609
|
/** Whether a video row's output has sound: always, switchable (`supports: generateAudio`), or silent. */
|
|
289
610
|
type AudioOutput = "always" | "optional" | "never";
|
|
290
611
|
/** How a prompt points at reference N: "image N" numbering, a caption beside each image, or prose. */
|
|
291
612
|
type ReferenceSyntax = "numbered" | "caption" | "descriptive";
|
|
613
|
+
type VoiceGender = "male" | "female" | "neutral";
|
|
614
|
+
/** A voice a row offers. `id` is the value sent to the provider. */
|
|
615
|
+
interface VoiceOption {
|
|
616
|
+
id: string;
|
|
617
|
+
name: string;
|
|
618
|
+
gender?: VoiceGender;
|
|
619
|
+
accent?: string;
|
|
620
|
+
/** Language codes the provider lists for the voice. */
|
|
621
|
+
languages?: string[];
|
|
622
|
+
description?: string;
|
|
623
|
+
/** An https sample of the voice. */
|
|
624
|
+
previewUrl?: string;
|
|
625
|
+
}
|
|
626
|
+
/** A language a row takes. `code` is the value sent to the provider. */
|
|
627
|
+
interface LanguageOption {
|
|
628
|
+
code: string;
|
|
629
|
+
name: string;
|
|
630
|
+
}
|
|
292
631
|
interface PromptConventions {
|
|
293
632
|
referenceSyntax: ReferenceSyntax;
|
|
294
633
|
/** Provider-documented prompt length limit, in characters. */
|
|
@@ -306,6 +645,8 @@ interface ModelConstraints {
|
|
|
306
645
|
durationPresets?: number[];
|
|
307
646
|
/** Curated quality choices for rows whose `supports` includes "quality". */
|
|
308
647
|
qualityOptions?: string[];
|
|
648
|
+
/** Upscale rows: the `scaleFactor` values the row offers; absent means any. */
|
|
649
|
+
scaleFactors?: number[];
|
|
309
650
|
/**
|
|
310
651
|
* Exact pixel size per aspect ratio for rows an app must size verbatim
|
|
311
652
|
* (gpt-image-2 keeps its historic WxH contract); callers pass it as `exactSize`.
|
|
@@ -313,9 +654,26 @@ interface ModelConstraints {
|
|
|
313
654
|
exactSizes?: Record<string, string>;
|
|
314
655
|
references?: ReferenceLimits;
|
|
315
656
|
requires?: RequiredInput[];
|
|
657
|
+
/**
|
|
658
|
+
* Video rows: at least one of these inputs must be present (`requires` needs all of its
|
|
659
|
+
* own). Kits before 0.5.0 ignore it.
|
|
660
|
+
*/
|
|
661
|
+
requiresOneOf?: RequiredInput[];
|
|
662
|
+
/**
|
|
663
|
+
* Video rows whose endpoint has no prompt field (MiniMax H3 Max Relight): the request needs
|
|
664
|
+
* no prompt, and a non-empty one is dropped with an `option_ignored` warning. Absent means
|
|
665
|
+
* the row takes a prompt. Kits before 0.5.0 ignore it.
|
|
666
|
+
*/
|
|
667
|
+
noPrompt?: boolean;
|
|
316
668
|
supports?: SupportedOption[];
|
|
317
669
|
/** Ratio is dropped, with a warning, when one of these inputs is present. */
|
|
318
670
|
ratioIgnoredWith?: ("firstFrame" | "sourceVideo")[];
|
|
671
|
+
/** Speech and voice-change rows: the voices offered; `defaults.voice` is one of their ids. */
|
|
672
|
+
voices?: VoiceOption[];
|
|
673
|
+
/** Speech, transcription and dubbing (target) rows: the languages taken. */
|
|
674
|
+
languages?: LanguageOption[];
|
|
675
|
+
/** Audio-output rows whose provider lets the caller pick a file format; `defaults.outputFormat` is one. */
|
|
676
|
+
outputFormats?: string[];
|
|
319
677
|
/** Length limits for the source video the row edits or extends. */
|
|
320
678
|
sourceVideoSeconds?: Omit<VideoSecondsLimits, "total"> & {
|
|
321
679
|
/** The provider sends the source as a reference video, so it counts toward `references.videoSeconds.total` (Seedance). */
|
|
@@ -332,6 +690,8 @@ interface ModelConstraints {
|
|
|
332
690
|
};
|
|
333
691
|
/** What a `video-tool` row accepts. Read it through `videoToolConstraints(row)`. */
|
|
334
692
|
tool?: VideoToolConstraints;
|
|
693
|
+
/** Required on `model3d` rows. */
|
|
694
|
+
model3d?: Model3dConstraints;
|
|
335
695
|
/** Whether the output has sound. Read it through `outputAudio(row)`, which tolerates bad data. */
|
|
336
696
|
audio?: AudioOutput;
|
|
337
697
|
/** Prompt conventions. Read them through `promptConventions(row)`, which fills the default. */
|
|
@@ -357,7 +717,8 @@ type ProviderOptions = {
|
|
|
357
717
|
[key: string]: ProviderOptionValue;
|
|
358
718
|
};
|
|
359
719
|
};
|
|
360
|
-
|
|
720
|
+
/** `requests`: one call billed at a flat price per request (a 3D job); the usage sink's `REQUESTS`. */
|
|
721
|
+
type UsageUnit = "tokens" | "images" | "seconds" | "reported_cost_usd" | "compute_seconds" | "requests";
|
|
361
722
|
type UsageModality = "TEXT" | "IMAGE" | "VIDEO" | "AUDIO";
|
|
362
723
|
type PricingKind = "token" | "image_size" | "video_per_second" | "flat";
|
|
363
724
|
/** What a model picker shows for a row. Free of any surface-specific ids. */
|
|
@@ -408,6 +769,15 @@ interface CatalogCapabilities {
|
|
|
408
769
|
vision?: boolean;
|
|
409
770
|
contextWindow?: number;
|
|
410
771
|
}
|
|
772
|
+
/** Row defaults the request types do not share. */
|
|
773
|
+
interface MediaNodeDefaults {
|
|
774
|
+
/** Image rows: png, jpeg or webp. Audio-output rows: one of `constraints.outputFormats`. */
|
|
775
|
+
outputFormat?: string;
|
|
776
|
+
/** One of `constraints.voices[].id`. */
|
|
777
|
+
voice?: string;
|
|
778
|
+
/** One of `constraints.languages[].code`. */
|
|
779
|
+
language?: string;
|
|
780
|
+
}
|
|
411
781
|
interface CatalogModel {
|
|
412
782
|
/** Canonical id. Equals the pricing key in pro-backend credit_pricing_* tables. */
|
|
413
783
|
id: string;
|
|
@@ -427,7 +797,7 @@ interface CatalogModel {
|
|
|
427
797
|
*/
|
|
428
798
|
exposure: Surface[];
|
|
429
799
|
constraints: ModelConstraints;
|
|
430
|
-
defaults: Partial<Omit<ImageRequest, "model" | "prompt"> & Omit<VideoRequest, "model" | "prompt"> & Omit<AudioRequest, "model" | "prompt"
|
|
800
|
+
defaults: Partial<Omit<ImageRequest, "model" | "prompt" | "outputFormat"> & Omit<VideoRequest, "model" | "prompt"> & Omit<AudioRequest, "model" | "prompt" | "outputFormat">> & MediaNodeDefaults;
|
|
431
801
|
/** Provider options merged under the caller's on every call. Chat-only tuning belongs in display.chat. */
|
|
432
802
|
providerOptions?: ProviderOptions;
|
|
433
803
|
/**
|
|
@@ -647,7 +1017,11 @@ declare function isListedOn(row: CatalogModel, surface: Surface): boolean;
|
|
|
647
1017
|
/** True when an active row is listed on at least one surface. */
|
|
648
1018
|
declare function isListed(row: CatalogModel): boolean;
|
|
649
1019
|
|
|
650
|
-
/**
|
|
1020
|
+
/**
|
|
1021
|
+
* Every row, aggregated from the exported per-type collections only, so a row added anywhere
|
|
1022
|
+
* else never reaches MODELS without its collection. Seeded from Cowork, Space Builder and
|
|
1023
|
+
* trigger-workflows. See catalog/*.ts.
|
|
1024
|
+
*/
|
|
651
1025
|
declare const MODELS: CatalogModel[];
|
|
652
1026
|
|
|
653
1027
|
declare const ADAPTER_IDS: readonly ["ai-sdk-text", "google-image", "openai-image", "google-genai", "ark", "fal", "replicate", "prodia", "higgsfield", "xai-video"];
|
|
@@ -675,9 +1049,17 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
675
1049
|
image: "image";
|
|
676
1050
|
video: "video";
|
|
677
1051
|
audio: "audio";
|
|
1052
|
+
"sound-effect": "sound-effect";
|
|
678
1053
|
upscale: "upscale";
|
|
679
1054
|
"bg-remove": "bg-remove";
|
|
1055
|
+
mask: "mask";
|
|
680
1056
|
"video-tool": "video-tool";
|
|
1057
|
+
speech: "speech";
|
|
1058
|
+
"voice-change": "voice-change";
|
|
1059
|
+
dubbing: "dubbing";
|
|
1060
|
+
lipsync: "lipsync";
|
|
1061
|
+
transcription: "transcription";
|
|
1062
|
+
model3d: "model3d";
|
|
681
1063
|
}>;
|
|
682
1064
|
adapter: z.ZodEnum<{
|
|
683
1065
|
"ai-sdk-text": "ai-sdk-text";
|
|
@@ -740,6 +1122,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
740
1122
|
}, z.core.$loose>, z.ZodArray<z.ZodNumber>]>>;
|
|
741
1123
|
durationPresets: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
742
1124
|
qualityOptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1125
|
+
scaleFactors: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
743
1126
|
exactSizes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
744
1127
|
references: z.ZodOptional<z.ZodObject<{
|
|
745
1128
|
images: z.ZodOptional<z.ZodNumber>;
|
|
@@ -761,12 +1144,25 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
761
1144
|
}, z.core.$loose>>;
|
|
762
1145
|
audioFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
763
1146
|
audioMaxBytes: z.ZodOptional<z.ZodNumber>;
|
|
1147
|
+
min: z.ZodOptional<z.ZodObject<{
|
|
1148
|
+
images: z.ZodOptional<z.ZodNumber>;
|
|
1149
|
+
videos: z.ZodOptional<z.ZodNumber>;
|
|
1150
|
+
audios: z.ZodOptional<z.ZodNumber>;
|
|
1151
|
+
}, z.core.$loose>>;
|
|
764
1152
|
}, z.core.$loose>>;
|
|
765
1153
|
requires: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
766
1154
|
references: "references";
|
|
767
1155
|
firstFrame: "firstFrame";
|
|
768
1156
|
sourceVideo: "sourceVideo";
|
|
1157
|
+
sourceAudio: "sourceAudio";
|
|
1158
|
+
}>>>;
|
|
1159
|
+
requiresOneOf: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1160
|
+
references: "references";
|
|
1161
|
+
firstFrame: "firstFrame";
|
|
1162
|
+
sourceVideo: "sourceVideo";
|
|
1163
|
+
sourceAudio: "sourceAudio";
|
|
769
1164
|
}>>>;
|
|
1165
|
+
noPrompt: z.ZodOptional<z.ZodBoolean>;
|
|
770
1166
|
supports: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
771
1167
|
upscale: "upscale";
|
|
772
1168
|
quality: "quality";
|
|
@@ -776,6 +1172,8 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
776
1172
|
scaleFactor: "scaleFactor";
|
|
777
1173
|
safetySettings: "safetySettings";
|
|
778
1174
|
temperature: "temperature";
|
|
1175
|
+
points: "points";
|
|
1176
|
+
boxes: "boxes";
|
|
779
1177
|
lastFrame: "lastFrame";
|
|
780
1178
|
generateAudio: "generateAudio";
|
|
781
1179
|
negativePrompt: "negativePrompt";
|
|
@@ -784,13 +1182,34 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
784
1182
|
watermark: "watermark";
|
|
785
1183
|
safetyChecker: "safetyChecker";
|
|
786
1184
|
taskType: "taskType";
|
|
1185
|
+
insertWindow: "insertWindow";
|
|
787
1186
|
instrumental: "instrumental";
|
|
1187
|
+
lyrics: "lyrics";
|
|
1188
|
+
style: "style";
|
|
788
1189
|
videoExtension: "videoExtension";
|
|
789
1190
|
}>>>;
|
|
790
1191
|
ratioIgnoredWith: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
791
1192
|
firstFrame: "firstFrame";
|
|
792
1193
|
sourceVideo: "sourceVideo";
|
|
793
1194
|
}>>>;
|
|
1195
|
+
voices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1196
|
+
id: z.ZodString;
|
|
1197
|
+
name: z.ZodString;
|
|
1198
|
+
gender: z.ZodOptional<z.ZodEnum<{
|
|
1199
|
+
male: "male";
|
|
1200
|
+
female: "female";
|
|
1201
|
+
neutral: "neutral";
|
|
1202
|
+
}>>;
|
|
1203
|
+
accent: z.ZodOptional<z.ZodString>;
|
|
1204
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1205
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1206
|
+
previewUrl: z.ZodOptional<z.ZodURL>;
|
|
1207
|
+
}, z.core.$loose>>>;
|
|
1208
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1209
|
+
code: z.ZodString;
|
|
1210
|
+
name: z.ZodString;
|
|
1211
|
+
}, z.core.$loose>>>;
|
|
1212
|
+
outputFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
794
1213
|
sourceVideoSeconds: z.ZodOptional<z.ZodObject<{
|
|
795
1214
|
max: z.ZodOptional<z.ZodNumber>;
|
|
796
1215
|
min: z.ZodOptional<z.ZodNumber>;
|
|
@@ -808,8 +1227,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
808
1227
|
tool: z.ZodOptional<z.ZodObject<{
|
|
809
1228
|
kind: z.ZodEnum<{
|
|
810
1229
|
upscale: "upscale";
|
|
1230
|
+
"bg-remove": "bg-remove";
|
|
811
1231
|
interpolate: "interpolate";
|
|
812
1232
|
hdr: "hdr";
|
|
1233
|
+
subtitles: "subtitles";
|
|
813
1234
|
}>;
|
|
814
1235
|
upscaleFactor: z.ZodOptional<z.ZodObject<{
|
|
815
1236
|
min: z.ZodNumber;
|
|
@@ -824,7 +1245,56 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
824
1245
|
outputFormats: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
825
1246
|
h265: "h265";
|
|
826
1247
|
prores: "prores";
|
|
1248
|
+
exr: "exr";
|
|
827
1249
|
}>>>;
|
|
1250
|
+
maxOutputShortEdge: z.ZodOptional<z.ZodNumber>;
|
|
1251
|
+
maxOutputFrames: z.ZodOptional<z.ZodNumber>;
|
|
1252
|
+
minOutputFrames: z.ZodOptional<z.ZodNumber>;
|
|
1253
|
+
maxOutputFps: z.ZodOptional<z.ZodNumber>;
|
|
1254
|
+
presets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1255
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1256
|
+
translationLanguages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1257
|
+
maxSecondsAbove1080p: z.ZodOptional<z.ZodNumber>;
|
|
1258
|
+
}, z.core.$loose>>;
|
|
1259
|
+
model3d: z.ZodOptional<z.ZodObject<{
|
|
1260
|
+
family: z.ZodEnum<{
|
|
1261
|
+
trellis: "trellis";
|
|
1262
|
+
hunyuan: "hunyuan";
|
|
1263
|
+
tripo: "tripo";
|
|
1264
|
+
rodin: "rodin";
|
|
1265
|
+
meshy: "meshy";
|
|
1266
|
+
hi3d: "hi3d";
|
|
1267
|
+
sam: "sam";
|
|
1268
|
+
}>;
|
|
1269
|
+
endpoints: z.ZodObject<{
|
|
1270
|
+
text: z.ZodOptional<z.ZodString>;
|
|
1271
|
+
image: z.ZodOptional<z.ZodString>;
|
|
1272
|
+
multiImage: z.ZodOptional<z.ZodString>;
|
|
1273
|
+
}, z.core.$loose>;
|
|
1274
|
+
text: z.ZodBoolean;
|
|
1275
|
+
imageRequired: z.ZodBoolean;
|
|
1276
|
+
promptRequired: z.ZodOptional<z.ZodBoolean>;
|
|
1277
|
+
views: z.ZodEnum<{
|
|
1278
|
+
none: "none";
|
|
1279
|
+
unordered: "unordered";
|
|
1280
|
+
ordered: "ordered";
|
|
1281
|
+
named: "named";
|
|
1282
|
+
}>;
|
|
1283
|
+
maxImages: z.ZodNumber;
|
|
1284
|
+
texture: z.ZodArray<z.ZodEnum<{
|
|
1285
|
+
none: "none";
|
|
1286
|
+
standard: "standard";
|
|
1287
|
+
detailed: "detailed";
|
|
1288
|
+
}>>;
|
|
1289
|
+
pbr: z.ZodBoolean;
|
|
1290
|
+
textureRef: z.ZodBoolean;
|
|
1291
|
+
seed: z.ZodBoolean;
|
|
1292
|
+
seedMax: z.ZodOptional<z.ZodNumber>;
|
|
1293
|
+
resolutions: z.ZodOptional<z.ZodObject<{
|
|
1294
|
+
label: z.ZodString;
|
|
1295
|
+
options: z.ZodArray<z.ZodString>;
|
|
1296
|
+
default: z.ZodString;
|
|
1297
|
+
}, z.core.$loose>>;
|
|
828
1298
|
}, z.core.$loose>>;
|
|
829
1299
|
audio: z.ZodOptional<z.ZodUnknown>;
|
|
830
1300
|
prompt: z.ZodOptional<z.ZodUnknown>;
|
|
@@ -876,11 +1346,11 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
876
1346
|
}>>;
|
|
877
1347
|
seed: z.ZodOptional<z.ZodNumber>;
|
|
878
1348
|
count: z.ZodOptional<z.ZodNumber>;
|
|
879
|
-
outputFormat: z.ZodOptional<z.ZodEnum<{
|
|
1349
|
+
outputFormat: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
880
1350
|
png: "png";
|
|
881
1351
|
jpeg: "jpeg";
|
|
882
1352
|
webp: "webp";
|
|
883
|
-
}>>;
|
|
1353
|
+
}>, z.ZodString]>>;
|
|
884
1354
|
scaleFactor: z.ZodOptional<z.ZodNumber>;
|
|
885
1355
|
safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
886
1356
|
category: z.ZodString;
|
|
@@ -894,6 +1364,20 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
894
1364
|
faceEnhancementCreativity: z.ZodOptional<z.ZodNumber>;
|
|
895
1365
|
faceEnhancementStrength: z.ZodOptional<z.ZodNumber>;
|
|
896
1366
|
}, z.core.$loose>>;
|
|
1367
|
+
points: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1368
|
+
x: z.ZodNumber;
|
|
1369
|
+
y: z.ZodNumber;
|
|
1370
|
+
label: z.ZodOptional<z.ZodEnum<{
|
|
1371
|
+
foreground: "foreground";
|
|
1372
|
+
background: "background";
|
|
1373
|
+
}>>;
|
|
1374
|
+
}, z.core.$loose>>>;
|
|
1375
|
+
boxes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1376
|
+
xMin: z.ZodNumber;
|
|
1377
|
+
yMin: z.ZodNumber;
|
|
1378
|
+
xMax: z.ZodNumber;
|
|
1379
|
+
yMax: z.ZodNumber;
|
|
1380
|
+
}, z.core.$loose>>>;
|
|
897
1381
|
firstFrame: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
898
1382
|
url: z.ZodString;
|
|
899
1383
|
label: z.ZodOptional<z.ZodString>;
|
|
@@ -974,6 +1458,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
974
1458
|
}>>;
|
|
975
1459
|
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
976
1460
|
safetyChecker: z.ZodOptional<z.ZodBoolean>;
|
|
1461
|
+
insertWindow: z.ZodOptional<z.ZodObject<{
|
|
1462
|
+
startSeconds: z.ZodNumber;
|
|
1463
|
+
resumeSeconds: z.ZodNumber;
|
|
1464
|
+
}, z.core.$loose>>;
|
|
977
1465
|
taskType: z.ZodOptional<z.ZodEnum<{
|
|
978
1466
|
reference: "reference";
|
|
979
1467
|
edit: "edit";
|
|
@@ -984,6 +1472,9 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
984
1472
|
pro: "pro";
|
|
985
1473
|
}>>;
|
|
986
1474
|
instrumental: z.ZodOptional<z.ZodBoolean>;
|
|
1475
|
+
lyrics: z.ZodOptional<z.ZodString>;
|
|
1476
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
1477
|
+
language: z.ZodOptional<z.ZodString>;
|
|
987
1478
|
}, z.core.$loose>;
|
|
988
1479
|
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<ProviderOptionValue, unknown, z.core.$ZodTypeInternals<ProviderOptionValue, unknown>>>>>;
|
|
989
1480
|
usage: z.ZodObject<{
|
|
@@ -993,6 +1484,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
993
1484
|
seconds: "seconds";
|
|
994
1485
|
reported_cost_usd: "reported_cost_usd";
|
|
995
1486
|
compute_seconds: "compute_seconds";
|
|
1487
|
+
requests: "requests";
|
|
996
1488
|
}>;
|
|
997
1489
|
slug: z.ZodOptional<z.ZodString>;
|
|
998
1490
|
providerLabel: z.ZodOptional<z.ZodString>;
|
|
@@ -1113,6 +1605,64 @@ type VideoToolPlan = {
|
|
|
1113
1605
|
*/
|
|
1114
1606
|
declare function planVideoTool(row: CatalogModel, req: Omit<VideoToolRequest, "model">): VideoToolPlan;
|
|
1115
1607
|
|
|
1608
|
+
/**
|
|
1609
|
+
* 3D generation on fal: the newest model of each 3D family. A request's price depends on
|
|
1610
|
+
* its options (texture, PBR, views, resolution), so each row bills one flat price per
|
|
1611
|
+
* option combination: `model3dSkus(row)` lists them and pro-backend keeps a
|
|
1612
|
+
* credit_pricing_flat row for each.
|
|
1613
|
+
*/
|
|
1614
|
+
declare const MODEL3D_MODELS: CatalogModel[];
|
|
1615
|
+
|
|
1616
|
+
/** A `model3d` row's spec, or undefined for any other row. */
|
|
1617
|
+
declare function model3dConstraints(row: CatalogModel): Model3dConstraints | undefined;
|
|
1618
|
+
/** Which inputs a request carries (or a canvas node has wired). */
|
|
1619
|
+
interface Model3dWired {
|
|
1620
|
+
prompt: boolean;
|
|
1621
|
+
image: boolean;
|
|
1622
|
+
back: boolean;
|
|
1623
|
+
left: boolean;
|
|
1624
|
+
right: boolean;
|
|
1625
|
+
/** The fifth photo (`views.top`); only `unordered` rows read it. */
|
|
1626
|
+
top?: boolean;
|
|
1627
|
+
}
|
|
1628
|
+
/**
|
|
1629
|
+
* The image slots the fal adapter's request mapping (`model3dCall`) fills for each kind of
|
|
1630
|
+
* views, in the order it sends them. A row's `maxImages` may not exceed its kind's count.
|
|
1631
|
+
*/
|
|
1632
|
+
declare const MODEL3D_IMAGE_SLOTS: {
|
|
1633
|
+
readonly none: readonly ["image"];
|
|
1634
|
+
readonly named: readonly ["image", "back", "left", "right"];
|
|
1635
|
+
readonly ordered: readonly ["image", "left", "back", "right"];
|
|
1636
|
+
readonly unordered: readonly ["image", "back", "left", "right", "top"];
|
|
1637
|
+
};
|
|
1638
|
+
type Model3dInputRefusal = "model3d_needs_image" | "model3d_needs_prompt" | "model3d_needs_input" | "model3d_views_need_image" | "model3d_views_out_of_order";
|
|
1639
|
+
/** Why a row cannot run with these inputs, or null when it can. */
|
|
1640
|
+
declare function model3dInputRefusal(spec: Model3dConstraints, wired: Model3dWired): Model3dInputRefusal | null;
|
|
1641
|
+
/** Whether the row's provider takes this seed: a non-negative integer up to its `seedMax`. */
|
|
1642
|
+
declare function model3dSeedFits(spec: Model3dConstraints, seed: number): boolean;
|
|
1643
|
+
/** The texture a request gets: its own when the row offers it, else the row's default. */
|
|
1644
|
+
declare function model3dTexture(spec: Model3dConstraints, requested: Model3dTexture | undefined): Model3dTexture;
|
|
1645
|
+
/** The resolution a request gets: its own when the row offers it, else the row's default. */
|
|
1646
|
+
declare function model3dResolution(spec: Model3dConstraints, requested: string | undefined): string | undefined;
|
|
1647
|
+
/** The options a request sets that change its price. */
|
|
1648
|
+
interface Model3dPricedOptions {
|
|
1649
|
+
texture?: Model3dTexture;
|
|
1650
|
+
pbr?: boolean;
|
|
1651
|
+
resolution?: string;
|
|
1652
|
+
}
|
|
1653
|
+
/**
|
|
1654
|
+
* What the request carries that changes its price: an image (Tripo prices text lower)
|
|
1655
|
+
* and side views (Hunyuan adds for them). A quote that cannot tell passes both true.
|
|
1656
|
+
*/
|
|
1657
|
+
interface Model3dPricedInputs {
|
|
1658
|
+
image: boolean;
|
|
1659
|
+
views: boolean;
|
|
1660
|
+
}
|
|
1661
|
+
/** The pro-backend credit_pricing_flat key one request bills under. */
|
|
1662
|
+
declare function model3dPricingSku(row: CatalogModel, options: Model3dPricedOptions, inputs: Model3dPricedInputs): string;
|
|
1663
|
+
/** Every SKU a row can bill under; pro-backend needs a price for each. */
|
|
1664
|
+
declare function model3dSkus(row: CatalogModel): string[];
|
|
1665
|
+
|
|
1116
1666
|
declare const TEXT_MODELS: CatalogModel[];
|
|
1117
1667
|
|
|
1118
1668
|
declare const OTHER_MODELS: CatalogModel[];
|
|
@@ -1134,6 +1684,93 @@ declare function resolveImageOptions(model: CatalogModel, request: ImageRequest,
|
|
|
1134
1684
|
declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
|
|
1135
1685
|
declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
|
|
1136
1686
|
|
|
1687
|
+
/** `generateSpeech` on a `speech` row. */
|
|
1688
|
+
declare function resolveSpeechOptions(model: CatalogModel, request: SpeechRequest, onUnsupported?: OnUnsupported): ResolveResult<SpeechRequest>;
|
|
1689
|
+
/** `changeVoice` on a `voice-change` row. */
|
|
1690
|
+
declare function resolveVoiceChangeOptions(model: CatalogModel, request: VoiceChangeRequest, onUnsupported?: OnUnsupported): ResolveResult<VoiceChangeRequest>;
|
|
1691
|
+
/** `lipsync` on a `lipsync` row: the face input is the one its `requires` names. */
|
|
1692
|
+
declare function resolveLipsyncOptions(model: CatalogModel, request: LipsyncRequest, onUnsupported?: OnUnsupported): ResolveResult<LipsyncRequest>;
|
|
1693
|
+
/** `dub` on a `dubbing` row: one source, a target language the row lists. */
|
|
1694
|
+
declare function resolveDubbingOptions(model: CatalogModel, request: DubbingRequest, onUnsupported?: OnUnsupported): ResolveResult<DubbingRequest>;
|
|
1695
|
+
/** `transcribe` on a `transcription` row. */
|
|
1696
|
+
declare function resolveTranscriptionOptions(model: CatalogModel, request: TranscriptionRequest, onUnsupported?: OnUnsupported): ResolveResult<TranscriptionRequest>;
|
|
1697
|
+
|
|
1698
|
+
/** The client methods that execute a catalog row (text rows run through the text helpers). */
|
|
1699
|
+
type MediaMethod = "generateImage" | "generateVideo" | "generateAudio" | "generateSpeech" | "changeVoice" | "lipsync" | "dub" | "transcribe" | "submitVideoTool";
|
|
1700
|
+
/** Typed as a full `Record` so a new `ModelType` does not compile until it is routed here. */
|
|
1701
|
+
declare const MEDIA_METHODS: Record<ModelType, readonly MediaMethod[]>;
|
|
1702
|
+
/** A request tagged with the client method it is meant for. */
|
|
1703
|
+
type ResolveCall = {
|
|
1704
|
+
method: "generateImage";
|
|
1705
|
+
request: ImageRequest;
|
|
1706
|
+
} | {
|
|
1707
|
+
method: "generateVideo";
|
|
1708
|
+
request: VideoRequest;
|
|
1709
|
+
} | {
|
|
1710
|
+
method: "generateAudio";
|
|
1711
|
+
request: AudioRequest;
|
|
1712
|
+
} | {
|
|
1713
|
+
method: "generateSpeech";
|
|
1714
|
+
request: SpeechRequest;
|
|
1715
|
+
} | {
|
|
1716
|
+
method: "changeVoice";
|
|
1717
|
+
request: VoiceChangeRequest;
|
|
1718
|
+
} | {
|
|
1719
|
+
method: "lipsync";
|
|
1720
|
+
request: LipsyncRequest;
|
|
1721
|
+
} | {
|
|
1722
|
+
method: "dub";
|
|
1723
|
+
request: DubbingRequest;
|
|
1724
|
+
} | {
|
|
1725
|
+
method: "transcribe";
|
|
1726
|
+
request: TranscriptionRequest;
|
|
1727
|
+
} | {
|
|
1728
|
+
method: "submitVideoTool";
|
|
1729
|
+
request: VideoToolRequest;
|
|
1730
|
+
};
|
|
1731
|
+
type ResolvedCall = {
|
|
1732
|
+
method: "generateImage";
|
|
1733
|
+
request: ImageRequest;
|
|
1734
|
+
warnings: Warning[];
|
|
1735
|
+
} | {
|
|
1736
|
+
method: "generateVideo";
|
|
1737
|
+
request: VideoRequest;
|
|
1738
|
+
warnings: Warning[];
|
|
1739
|
+
} | {
|
|
1740
|
+
method: "generateAudio";
|
|
1741
|
+
request: AudioRequest;
|
|
1742
|
+
warnings: Warning[];
|
|
1743
|
+
} | {
|
|
1744
|
+
method: "generateSpeech";
|
|
1745
|
+
request: SpeechRequest;
|
|
1746
|
+
warnings: Warning[];
|
|
1747
|
+
} | {
|
|
1748
|
+
method: "changeVoice";
|
|
1749
|
+
request: VoiceChangeRequest;
|
|
1750
|
+
warnings: Warning[];
|
|
1751
|
+
} | {
|
|
1752
|
+
method: "lipsync";
|
|
1753
|
+
request: LipsyncRequest;
|
|
1754
|
+
warnings: Warning[];
|
|
1755
|
+
} | {
|
|
1756
|
+
method: "dub";
|
|
1757
|
+
request: DubbingRequest;
|
|
1758
|
+
warnings: Warning[];
|
|
1759
|
+
} | {
|
|
1760
|
+
method: "transcribe";
|
|
1761
|
+
request: TranscriptionRequest;
|
|
1762
|
+
warnings: Warning[];
|
|
1763
|
+
} | {
|
|
1764
|
+
method: "submitVideoTool";
|
|
1765
|
+
request: VideoToolRequest;
|
|
1766
|
+
warnings: Warning[];
|
|
1767
|
+
output: VideoToolOutputSpec;
|
|
1768
|
+
};
|
|
1769
|
+
/** Resolves a request exactly as the client method it names would before calling the provider. */
|
|
1770
|
+
declare function resolveOptions(model: CatalogModel, call: ResolveCall, onUnsupported?: OnUnsupported): ResolvedCall;
|
|
1771
|
+
|
|
1772
|
+
declare const MEDIA_NODE_MODELS: CatalogModel[];
|
|
1773
|
+
|
|
1137
1774
|
declare const AUDIO_OUTPUTS: ("always" | "optional" | "never")[];
|
|
1138
1775
|
declare const REFERENCE_SYNTAXES: ("numbered" | "caption" | "descriptive")[];
|
|
1139
1776
|
declare function outputAudio(row: {
|
|
@@ -1180,15 +1817,4 @@ declare class ModelKitError extends Error {
|
|
|
1180
1817
|
}
|
|
1181
1818
|
declare function isModelKitError(err: unknown): err is ModelKitError;
|
|
1182
1819
|
|
|
1183
|
-
|
|
1184
|
-
* Browser-safe catalog subpath (`@shop-os/modelkit/catalog`).
|
|
1185
|
-
*
|
|
1186
|
-
* Catalog rows, the option resolver and error types only. No adapters, no
|
|
1187
|
-
* client, no key handling, no text helpers and no provider SDKs, so the
|
|
1188
|
-
* bundle is safe to ship to browsers (Space Builder pickers, vibe-shared).
|
|
1189
|
-
*/
|
|
1190
|
-
|
|
1191
|
-
/** Resolve caller options against a catalog row, dispatching on `model.type`. */
|
|
1192
|
-
declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
|
|
1193
|
-
|
|
1194
|
-
export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeyTier, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type Warning, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows, videoLengthViolation, videoToolConstraints };
|
|
1820
|
+
export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveCall, type ResolveResult, type ResolvedCall, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceChangeRequest, type VoiceGender, type VoiceOption, type Warning, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, sortCatalogRows, videoLengthViolation, videoToolConstraints };
|