@shop-os/modelkit 0.13.0 → 0.15.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 +20 -0
- package/dist/catalog.cjs +82 -3
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +33 -2
- package/dist/catalog.d.ts +33 -2
- package/dist/catalog.js +82 -3
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +87 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -2
- package/dist/index.d.ts +33 -2
- package/dist/index.js +86 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -132,7 +132,7 @@ interface Model3dConstraints {
|
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
/** What a `video-tool` row does to its source clip. */
|
|
135
|
-
type VideoToolKind = "upscale" | "interpolate" | "hdr" | "bg-remove" | "subtitles";
|
|
135
|
+
type VideoToolKind = "upscale" | "interpolate" | "hdr" | "bg-remove" | "subtitles" | "depth";
|
|
136
136
|
/** Container/codec a video-tool row can write. */
|
|
137
137
|
/** `exr`: a ZIP of 16-bit EXR frames in `VideoToolResult.frames`, with an MP4 preview as `video`. */
|
|
138
138
|
type VideoToolOutputFormat = "h265" | "prores" | "exr";
|
|
@@ -601,6 +601,11 @@ type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "gen
|
|
|
601
601
|
| "insertWindow"
|
|
602
602
|
/** Mask rows: `ImageRequest.points` and `ImageRequest.boxes`. */
|
|
603
603
|
| "points" | "boxes";
|
|
604
|
+
/** Smallest frame a provider takes for an input video, in pixels (fal: "Min width: 700px"). */
|
|
605
|
+
interface VideoPixelLimits {
|
|
606
|
+
minWidth?: number;
|
|
607
|
+
minHeight?: number;
|
|
608
|
+
}
|
|
604
609
|
interface VideoSecondsLimits {
|
|
605
610
|
/** Minimum length of each reference video, in seconds. */
|
|
606
611
|
min?: number;
|
|
@@ -622,6 +627,8 @@ interface ReferenceLimits {
|
|
|
622
627
|
audioOnly?: boolean;
|
|
623
628
|
/** Per-video length caps (min/max each) and combined total for reference videos. */
|
|
624
629
|
videoSeconds?: VideoSecondsLimits;
|
|
630
|
+
/** Smallest frame each reference video may have (Kling 4.0: 700 px). Kits before 0.15.0 ignore it. */
|
|
631
|
+
videoPixels?: VideoPixelLimits;
|
|
625
632
|
/** Per-clip length caps (min/max each) and combined total for reference audio, in seconds. */
|
|
626
633
|
audioSeconds?: {
|
|
627
634
|
min?: number;
|
|
@@ -751,6 +758,8 @@ interface ModelConstraints {
|
|
|
751
758
|
languages?: LanguageOption[];
|
|
752
759
|
/** Audio-output rows whose provider lets the caller pick a file format; `defaults.outputFormat` is one. */
|
|
753
760
|
outputFormats?: string[];
|
|
761
|
+
/** Smallest frame the source video may have (Kling 4.0 Edit: 700 px). Kits before 0.15.0 ignore it. */
|
|
762
|
+
sourceVideoPixels?: VideoPixelLimits;
|
|
754
763
|
/** Length limits for the source video the row edits or extends. */
|
|
755
764
|
sourceVideoSeconds?: Omit<VideoSecondsLimits, "total"> & {
|
|
756
765
|
/** The provider sends the source as a reference video, so it counts toward `references.videoSeconds.total` (Seedance). */
|
|
@@ -1253,6 +1262,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
1253
1262
|
total: z.ZodOptional<z.ZodNumber>;
|
|
1254
1263
|
editMin: z.ZodOptional<z.ZodNumber>;
|
|
1255
1264
|
}, z.core.$loose>>;
|
|
1265
|
+
videoPixels: z.ZodOptional<z.ZodObject<{
|
|
1266
|
+
minWidth: z.ZodOptional<z.ZodNumber>;
|
|
1267
|
+
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
1268
|
+
}, z.core.$loose>>;
|
|
1256
1269
|
audioSeconds: z.ZodOptional<z.ZodObject<{
|
|
1257
1270
|
min: z.ZodOptional<z.ZodNumber>;
|
|
1258
1271
|
max: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1330,6 +1343,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
1330
1343
|
name: z.ZodString;
|
|
1331
1344
|
}, z.core.$loose>>>;
|
|
1332
1345
|
outputFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1346
|
+
sourceVideoPixels: z.ZodOptional<z.ZodObject<{
|
|
1347
|
+
minWidth: z.ZodOptional<z.ZodNumber>;
|
|
1348
|
+
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
1349
|
+
}, z.core.$loose>>;
|
|
1333
1350
|
sourceVideoSeconds: z.ZodOptional<z.ZodObject<{
|
|
1334
1351
|
max: z.ZodOptional<z.ZodNumber>;
|
|
1335
1352
|
min: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1351,6 +1368,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
1351
1368
|
interpolate: "interpolate";
|
|
1352
1369
|
hdr: "hdr";
|
|
1353
1370
|
subtitles: "subtitles";
|
|
1371
|
+
depth: "depth";
|
|
1354
1372
|
}>;
|
|
1355
1373
|
upscaleFactor: z.ZodOptional<z.ZodObject<{
|
|
1356
1374
|
min: z.ZodNumber;
|
|
@@ -1857,6 +1875,19 @@ declare function videoLengthViolation(model: CatalogModel, input: {
|
|
|
1857
1875
|
sourceVideo?: number;
|
|
1858
1876
|
taskType?: VideoRequest["taskType"];
|
|
1859
1877
|
}): string | undefined;
|
|
1878
|
+
type MeasuredFrame = {
|
|
1879
|
+
width?: number;
|
|
1880
|
+
height?: number;
|
|
1881
|
+
} | undefined;
|
|
1882
|
+
/**
|
|
1883
|
+
* First frame-size violation for the videos a request sends, as a user-facing message, from
|
|
1884
|
+
* their measured pixel sizes (`references.videoPixels`, `sourceVideoPixels`). An unmeasured
|
|
1885
|
+
* video passes: the provider still has the last word.
|
|
1886
|
+
*/
|
|
1887
|
+
declare function videoSizeViolation(model: CatalogModel, input: {
|
|
1888
|
+
referenceVideos?: MeasuredFrame[];
|
|
1889
|
+
sourceVideo?: MeasuredFrame;
|
|
1890
|
+
}): string | undefined;
|
|
1860
1891
|
declare function resolveImageOptions(model: CatalogModel, request: ImageRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest>;
|
|
1861
1892
|
declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
|
|
1862
1893
|
declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
|
|
@@ -2262,4 +2293,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
|
|
|
2262
2293
|
/** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
|
|
2263
2294
|
declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
|
|
2264
2295
|
|
|
2265
|
-
export { ADAPTER_IDS, ADAPTER_KEYS, ARRAY_INPUT_SPEC_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, type ArrayInputSpecKey, type AspectRatio, type AudioNodeMethods, 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 CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type DubbingOutcome, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type FalWebhookBody, type GeneratedImage, IMAGE_INPUT_SPEC_KEYS, INPUT_SPEC_SUPPORTS_KEYS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecDimensions, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type KeyTier, type LanguageModelHandle, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaJobCallContext, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dCall, 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 ModelKit, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, type ModelkitGenerateObjectOptions, type ModelkitGenerateTextOptions, type ModelkitStreamObjectOptions, type ModelkitStreamTextOptions, type ObjectOutput, type ObjectResult, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, 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 VoiceCandidate, type VoiceChangeRequest, type VoiceCloneRequest, type VoiceCloneResult, type VoiceCloneState, type VoiceDeleteRequest, type VoiceDesignRequest, type VoiceDesignResult, type VoiceGender, type VoiceOption, type VoiceSample, type Warning, adapterServesType, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, elevenLabsAdapter, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, fishAdapter, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, lumaReframeTooTall, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
|
|
2296
|
+
export { ADAPTER_IDS, ADAPTER_KEYS, ARRAY_INPUT_SPEC_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, type ArrayInputSpecKey, type AspectRatio, type AudioNodeMethods, 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 CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type DubbingOutcome, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type FalWebhookBody, type GeneratedImage, IMAGE_INPUT_SPEC_KEYS, INPUT_SPEC_SUPPORTS_KEYS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecDimensions, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type KeyTier, type LanguageModelHandle, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaJobCallContext, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dCall, 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 ModelKit, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, type ModelkitGenerateObjectOptions, type ModelkitGenerateTextOptions, type ModelkitStreamObjectOptions, type ModelkitStreamTextOptions, type ObjectOutput, type ObjectResult, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoPixelLimits, 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 VoiceCandidate, type VoiceChangeRequest, type VoiceCloneRequest, type VoiceCloneResult, type VoiceCloneState, type VoiceDeleteRequest, type VoiceDesignRequest, type VoiceDesignResult, type VoiceGender, type VoiceOption, type VoiceSample, type Warning, adapterServesType, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, elevenLabsAdapter, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, fishAdapter, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, lumaReframeTooTall, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoSizeViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
|
package/dist/index.d.ts
CHANGED
|
@@ -132,7 +132,7 @@ interface Model3dConstraints {
|
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
/** What a `video-tool` row does to its source clip. */
|
|
135
|
-
type VideoToolKind = "upscale" | "interpolate" | "hdr" | "bg-remove" | "subtitles";
|
|
135
|
+
type VideoToolKind = "upscale" | "interpolate" | "hdr" | "bg-remove" | "subtitles" | "depth";
|
|
136
136
|
/** Container/codec a video-tool row can write. */
|
|
137
137
|
/** `exr`: a ZIP of 16-bit EXR frames in `VideoToolResult.frames`, with an MP4 preview as `video`. */
|
|
138
138
|
type VideoToolOutputFormat = "h265" | "prores" | "exr";
|
|
@@ -601,6 +601,11 @@ type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "gen
|
|
|
601
601
|
| "insertWindow"
|
|
602
602
|
/** Mask rows: `ImageRequest.points` and `ImageRequest.boxes`. */
|
|
603
603
|
| "points" | "boxes";
|
|
604
|
+
/** Smallest frame a provider takes for an input video, in pixels (fal: "Min width: 700px"). */
|
|
605
|
+
interface VideoPixelLimits {
|
|
606
|
+
minWidth?: number;
|
|
607
|
+
minHeight?: number;
|
|
608
|
+
}
|
|
604
609
|
interface VideoSecondsLimits {
|
|
605
610
|
/** Minimum length of each reference video, in seconds. */
|
|
606
611
|
min?: number;
|
|
@@ -622,6 +627,8 @@ interface ReferenceLimits {
|
|
|
622
627
|
audioOnly?: boolean;
|
|
623
628
|
/** Per-video length caps (min/max each) and combined total for reference videos. */
|
|
624
629
|
videoSeconds?: VideoSecondsLimits;
|
|
630
|
+
/** Smallest frame each reference video may have (Kling 4.0: 700 px). Kits before 0.15.0 ignore it. */
|
|
631
|
+
videoPixels?: VideoPixelLimits;
|
|
625
632
|
/** Per-clip length caps (min/max each) and combined total for reference audio, in seconds. */
|
|
626
633
|
audioSeconds?: {
|
|
627
634
|
min?: number;
|
|
@@ -751,6 +758,8 @@ interface ModelConstraints {
|
|
|
751
758
|
languages?: LanguageOption[];
|
|
752
759
|
/** Audio-output rows whose provider lets the caller pick a file format; `defaults.outputFormat` is one. */
|
|
753
760
|
outputFormats?: string[];
|
|
761
|
+
/** Smallest frame the source video may have (Kling 4.0 Edit: 700 px). Kits before 0.15.0 ignore it. */
|
|
762
|
+
sourceVideoPixels?: VideoPixelLimits;
|
|
754
763
|
/** Length limits for the source video the row edits or extends. */
|
|
755
764
|
sourceVideoSeconds?: Omit<VideoSecondsLimits, "total"> & {
|
|
756
765
|
/** The provider sends the source as a reference video, so it counts toward `references.videoSeconds.total` (Seedance). */
|
|
@@ -1253,6 +1262,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
1253
1262
|
total: z.ZodOptional<z.ZodNumber>;
|
|
1254
1263
|
editMin: z.ZodOptional<z.ZodNumber>;
|
|
1255
1264
|
}, z.core.$loose>>;
|
|
1265
|
+
videoPixels: z.ZodOptional<z.ZodObject<{
|
|
1266
|
+
minWidth: z.ZodOptional<z.ZodNumber>;
|
|
1267
|
+
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
1268
|
+
}, z.core.$loose>>;
|
|
1256
1269
|
audioSeconds: z.ZodOptional<z.ZodObject<{
|
|
1257
1270
|
min: z.ZodOptional<z.ZodNumber>;
|
|
1258
1271
|
max: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1330,6 +1343,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
1330
1343
|
name: z.ZodString;
|
|
1331
1344
|
}, z.core.$loose>>>;
|
|
1332
1345
|
outputFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1346
|
+
sourceVideoPixels: z.ZodOptional<z.ZodObject<{
|
|
1347
|
+
minWidth: z.ZodOptional<z.ZodNumber>;
|
|
1348
|
+
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
1349
|
+
}, z.core.$loose>>;
|
|
1333
1350
|
sourceVideoSeconds: z.ZodOptional<z.ZodObject<{
|
|
1334
1351
|
max: z.ZodOptional<z.ZodNumber>;
|
|
1335
1352
|
min: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1351,6 +1368,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
1351
1368
|
interpolate: "interpolate";
|
|
1352
1369
|
hdr: "hdr";
|
|
1353
1370
|
subtitles: "subtitles";
|
|
1371
|
+
depth: "depth";
|
|
1354
1372
|
}>;
|
|
1355
1373
|
upscaleFactor: z.ZodOptional<z.ZodObject<{
|
|
1356
1374
|
min: z.ZodNumber;
|
|
@@ -1857,6 +1875,19 @@ declare function videoLengthViolation(model: CatalogModel, input: {
|
|
|
1857
1875
|
sourceVideo?: number;
|
|
1858
1876
|
taskType?: VideoRequest["taskType"];
|
|
1859
1877
|
}): string | undefined;
|
|
1878
|
+
type MeasuredFrame = {
|
|
1879
|
+
width?: number;
|
|
1880
|
+
height?: number;
|
|
1881
|
+
} | undefined;
|
|
1882
|
+
/**
|
|
1883
|
+
* First frame-size violation for the videos a request sends, as a user-facing message, from
|
|
1884
|
+
* their measured pixel sizes (`references.videoPixels`, `sourceVideoPixels`). An unmeasured
|
|
1885
|
+
* video passes: the provider still has the last word.
|
|
1886
|
+
*/
|
|
1887
|
+
declare function videoSizeViolation(model: CatalogModel, input: {
|
|
1888
|
+
referenceVideos?: MeasuredFrame[];
|
|
1889
|
+
sourceVideo?: MeasuredFrame;
|
|
1890
|
+
}): string | undefined;
|
|
1860
1891
|
declare function resolveImageOptions(model: CatalogModel, request: ImageRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest>;
|
|
1861
1892
|
declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
|
|
1862
1893
|
declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
|
|
@@ -2262,4 +2293,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
|
|
|
2262
2293
|
/** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
|
|
2263
2294
|
declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
|
|
2264
2295
|
|
|
2265
|
-
export { ADAPTER_IDS, ADAPTER_KEYS, ARRAY_INPUT_SPEC_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, type ArrayInputSpecKey, type AspectRatio, type AudioNodeMethods, 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 CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type DubbingOutcome, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type FalWebhookBody, type GeneratedImage, IMAGE_INPUT_SPEC_KEYS, INPUT_SPEC_SUPPORTS_KEYS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecDimensions, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type KeyTier, type LanguageModelHandle, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaJobCallContext, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dCall, 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 ModelKit, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, type ModelkitGenerateObjectOptions, type ModelkitGenerateTextOptions, type ModelkitStreamObjectOptions, type ModelkitStreamTextOptions, type ObjectOutput, type ObjectResult, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, 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 VoiceCandidate, type VoiceChangeRequest, type VoiceCloneRequest, type VoiceCloneResult, type VoiceCloneState, type VoiceDeleteRequest, type VoiceDesignRequest, type VoiceDesignResult, type VoiceGender, type VoiceOption, type VoiceSample, type Warning, adapterServesType, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, elevenLabsAdapter, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, fishAdapter, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, lumaReframeTooTall, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
|
|
2296
|
+
export { ADAPTER_IDS, ADAPTER_KEYS, ARRAY_INPUT_SPEC_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, type ArrayInputSpecKey, type AspectRatio, type AudioNodeMethods, 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 CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type DubbingOutcome, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type FalWebhookBody, type GeneratedImage, IMAGE_INPUT_SPEC_KEYS, INPUT_SPEC_SUPPORTS_KEYS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecDimensions, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type KeyTier, type LanguageModelHandle, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaJobCallContext, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dCall, 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 ModelKit, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, type ModelkitGenerateObjectOptions, type ModelkitGenerateTextOptions, type ModelkitStreamObjectOptions, type ModelkitStreamTextOptions, type ObjectOutput, type ObjectResult, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoPixelLimits, 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 VoiceCandidate, type VoiceChangeRequest, type VoiceCloneRequest, type VoiceCloneResult, type VoiceCloneState, type VoiceDeleteRequest, type VoiceDesignRequest, type VoiceDesignResult, type VoiceGender, type VoiceOption, type VoiceSample, type Warning, adapterServesType, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, elevenLabsAdapter, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, fishAdapter, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, lumaAdapter, lumaReframeTooTall, mergeTextProviderOptions, missingTierKeys, model3dCall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, resolveVoiceCloneOptions, resolveVoiceDesignOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, takesTargetAspectRatio, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoSizeViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
|
package/dist/index.js
CHANGED
|
@@ -5093,6 +5093,7 @@ function klingMotionControl(tier) {
|
|
|
5093
5093
|
videos: 1,
|
|
5094
5094
|
audios: 0,
|
|
5095
5095
|
videoSeconds: { min: 3, max: 30.05 },
|
|
5096
|
+
videoPixels: { minWidth: 340, minHeight: 340 },
|
|
5096
5097
|
min: { images: 1, videos: 1 }
|
|
5097
5098
|
},
|
|
5098
5099
|
requires: ["references"],
|
|
@@ -5159,6 +5160,7 @@ var VIDEO_FAMILY_MODELS = [
|
|
|
5159
5160
|
references: { ...NO_REFERENCES, images: 4 },
|
|
5160
5161
|
requires: ["sourceVideo"],
|
|
5161
5162
|
sourceVideoSeconds: { min: 3, max: 15.05 },
|
|
5163
|
+
sourceVideoPixels: { minWidth: 720, minHeight: 720 },
|
|
5162
5164
|
// generateAudio keeps (true) or drops (false) the source soundtrack.
|
|
5163
5165
|
supports: ["generateAudio"],
|
|
5164
5166
|
prompt: KLING_PROMPT,
|
|
@@ -5199,7 +5201,8 @@ var VIDEO_FAMILY_MODELS = [
|
|
|
5199
5201
|
...NO_REFERENCES,
|
|
5200
5202
|
images: 10,
|
|
5201
5203
|
videos: 5,
|
|
5202
|
-
videoSeconds: { min: 3, max: 30.05, total: 30 }
|
|
5204
|
+
videoSeconds: { min: 3, max: 30.05, total: 30 },
|
|
5205
|
+
videoPixels: { minWidth: 700, minHeight: 700 }
|
|
5203
5206
|
},
|
|
5204
5207
|
supports: ["lastFrame"],
|
|
5205
5208
|
prompt: KLING_V4_PROMPT,
|
|
@@ -5233,6 +5236,7 @@ var VIDEO_FAMILY_MODELS = [
|
|
|
5233
5236
|
references: { ...NO_REFERENCES, images: 10 },
|
|
5234
5237
|
requires: ["sourceVideo"],
|
|
5235
5238
|
sourceVideoSeconds: { min: 3, max: 30.05 },
|
|
5239
|
+
sourceVideoPixels: { minWidth: 700, minHeight: 700 },
|
|
5236
5240
|
supports: [],
|
|
5237
5241
|
prompt: KLING_V4_PROMPT,
|
|
5238
5242
|
audio: KLING_V4_AUDIO
|
|
@@ -6569,6 +6573,33 @@ var VIDEO_TOOL_MODELS = [
|
|
|
6569
6573
|
description: "Topaz Hyperion 2.5 SDR to HDR: a 10-bit HDR master in H.265 (HDR10) or ProRes 422 HQ, at the source's size and frame rate."
|
|
6570
6574
|
}
|
|
6571
6575
|
},
|
|
6576
|
+
{
|
|
6577
|
+
// https://fal.ai/models/fal-ai/depth-anything-video/api: greyscale depth (white = near)
|
|
6578
|
+
// at the source's frame rate, short edge capped at 1080 px (a 2160x3840 source came
|
|
6579
|
+
// back 1080x1920), at most 2400 frames; one fal price of $0.04 per second for every
|
|
6580
|
+
// model size. The adapter always sends VDA-Small, the only Apache-2.0 size. 100 s is
|
|
6581
|
+
// 2400 frames at 24 fps; the frame check refuses faster clips sooner.
|
|
6582
|
+
id: "depth-anything-video",
|
|
6583
|
+
aliases: [],
|
|
6584
|
+
label: "Video Depth Anything",
|
|
6585
|
+
type: "video-tool",
|
|
6586
|
+
adapter: "fal",
|
|
6587
|
+
providerModelId: "fal-ai/depth-anything-video",
|
|
6588
|
+
lifecycle: "active",
|
|
6589
|
+
exposure: ["cowork"],
|
|
6590
|
+
constraints: {
|
|
6591
|
+
supports: [],
|
|
6592
|
+
sourceVideoSeconds: { max: 100 },
|
|
6593
|
+
tool: { kind: "depth", maxOutputShortEdge: 1080, maxOutputFrames: 2400 }
|
|
6594
|
+
},
|
|
6595
|
+
defaults: {},
|
|
6596
|
+
usage: SECONDS_USAGE,
|
|
6597
|
+
pricingKind: "video_per_second",
|
|
6598
|
+
display: {
|
|
6599
|
+
provider: "depth-anything",
|
|
6600
|
+
description: "Video Depth Anything: a greyscale depth map of the clip (near is white), frame for frame, for motion and camera control."
|
|
6601
|
+
}
|
|
6602
|
+
},
|
|
6572
6603
|
{
|
|
6573
6604
|
id: "flux-video-upscale-precise",
|
|
6574
6605
|
aliases: [],
|
|
@@ -7750,6 +7781,10 @@ var VideoSecondsLimitsSchema = z3.looseObject({
|
|
|
7750
7781
|
total: z3.number().optional(),
|
|
7751
7782
|
editMin: z3.number().optional()
|
|
7752
7783
|
});
|
|
7784
|
+
var VideoPixelLimitsSchema = z3.looseObject({
|
|
7785
|
+
minWidth: z3.number().int().positive().optional(),
|
|
7786
|
+
minHeight: z3.number().int().positive().optional()
|
|
7787
|
+
});
|
|
7753
7788
|
var ReferenceLimitsSchema = z3.looseObject({
|
|
7754
7789
|
images: z3.number().optional(),
|
|
7755
7790
|
imagesWithVideo: z3.number().optional(),
|
|
@@ -7758,6 +7793,7 @@ var ReferenceLimitsSchema = z3.looseObject({
|
|
|
7758
7793
|
total: z3.number().optional(),
|
|
7759
7794
|
audioOnly: z3.boolean().optional(),
|
|
7760
7795
|
videoSeconds: VideoSecondsLimitsSchema.optional(),
|
|
7796
|
+
videoPixels: VideoPixelLimitsSchema.optional(),
|
|
7761
7797
|
audioSeconds: z3.looseObject({
|
|
7762
7798
|
min: z3.number().optional(),
|
|
7763
7799
|
max: z3.number().optional(),
|
|
@@ -7786,7 +7822,7 @@ var LanguageOptionSchema = z3.looseObject({
|
|
|
7786
7822
|
name: z3.string().min(1)
|
|
7787
7823
|
});
|
|
7788
7824
|
var VideoToolConstraintsSchema = z3.looseObject({
|
|
7789
|
-
kind: z3.enum(["upscale", "interpolate", "hdr", "bg-remove", "subtitles"]),
|
|
7825
|
+
kind: z3.enum(["upscale", "interpolate", "hdr", "bg-remove", "subtitles", "depth"]),
|
|
7790
7826
|
upscaleFactor: RangeSchema.optional(),
|
|
7791
7827
|
maxOutputLongEdge: z3.number().positive().optional(),
|
|
7792
7828
|
prompt: z3.boolean().optional(),
|
|
@@ -7847,6 +7883,7 @@ var ModelConstraintsSchema = z3.looseObject({
|
|
|
7847
7883
|
}).optional(),
|
|
7848
7884
|
languages: z3.array(LanguageOptionSchema).optional(),
|
|
7849
7885
|
outputFormats: z3.array(z3.string().min(1)).min(1).optional(),
|
|
7886
|
+
sourceVideoPixels: VideoPixelLimitsSchema.optional(),
|
|
7850
7887
|
sourceVideoSeconds: VideoSecondsLimitsSchema.omit({ total: true }).extend({ inReferenceTotal: z3.boolean().optional() }).optional(),
|
|
7851
7888
|
// segmentSeconds/maxTotalSeconds stay required: a kit before 0.3.0 drops a row whose
|
|
7852
7889
|
// extension lacks them, so every extension block keeps them.
|
|
@@ -9556,7 +9593,7 @@ function checkedQueueUrl(ctx, url, what) {
|
|
|
9556
9593
|
import { z as z12 } from "zod";
|
|
9557
9594
|
var RangeSchema2 = z12.object({ min: z12.number(), max: z12.number() });
|
|
9558
9595
|
var ToolSchema = z12.object({
|
|
9559
|
-
kind: z12.enum(["upscale", "interpolate", "hdr", "bg-remove", "subtitles"]),
|
|
9596
|
+
kind: z12.enum(["upscale", "interpolate", "hdr", "bg-remove", "subtitles", "depth"]),
|
|
9560
9597
|
upscaleFactor: RangeSchema2.optional(),
|
|
9561
9598
|
maxOutputLongEdge: z12.number().positive().optional(),
|
|
9562
9599
|
prompt: z12.boolean().optional(),
|
|
@@ -9694,6 +9731,25 @@ function planVideoTool(row2, req) {
|
|
|
9694
9731
|
}
|
|
9695
9732
|
};
|
|
9696
9733
|
}
|
|
9734
|
+
if (tool.kind === "depth") {
|
|
9735
|
+
const limit = tool.maxOutputFrames;
|
|
9736
|
+
if (limit !== void 0) {
|
|
9737
|
+
if (fps === void 0) return fail("The source video's frame rate is required");
|
|
9738
|
+
if (durationSeconds * fps > limit) {
|
|
9739
|
+
return fail(`${row2.label} renders up to ${limit} frames (${seconds(limit, fps)}).`);
|
|
9740
|
+
}
|
|
9741
|
+
}
|
|
9742
|
+
const out2 = shrinkToShortEdge(width, height, tool.maxOutputShortEdge);
|
|
9743
|
+
return {
|
|
9744
|
+
ok: true,
|
|
9745
|
+
output: {
|
|
9746
|
+
...base,
|
|
9747
|
+
...out2,
|
|
9748
|
+
resolution: resolutionTier(out2.width, out2.height),
|
|
9749
|
+
format: "h264"
|
|
9750
|
+
}
|
|
9751
|
+
};
|
|
9752
|
+
}
|
|
9697
9753
|
if (tool.kind === "subtitles") {
|
|
9698
9754
|
const resolution = resolutionTier(width, height);
|
|
9699
9755
|
const problem = subtitleProblem(
|
|
@@ -9790,12 +9846,15 @@ function toolInput(ctx, req, output) {
|
|
|
9790
9846
|
input["output_codec"] = "vp9";
|
|
9791
9847
|
} else if (tool?.kind === "subtitles") {
|
|
9792
9848
|
Object.assign(input, subtitleFields(tool, req.subtitles));
|
|
9849
|
+
} else if (tool?.kind === "depth") {
|
|
9850
|
+
input["model"] = "VDA-Small";
|
|
9851
|
+
input["colormap"] = "grayscale";
|
|
9793
9852
|
} else if (output.format === "exr") {
|
|
9794
9853
|
const prompt = tool?.prompt === true ? req.prompt?.trim() : void 0;
|
|
9795
9854
|
input["prompt"] = prompt || EXR_DEFAULT_PROMPT;
|
|
9796
9855
|
if (output.fps !== void 0) input["frames_per_second"] = output.fps;
|
|
9797
9856
|
if (output.frames !== void 0) input["num_frames"] = output.frames;
|
|
9798
|
-
} else {
|
|
9857
|
+
} else if (tool?.kind === "hdr") {
|
|
9799
9858
|
input["output_format"] = output.format === "prores" ? "prores" : "mp4";
|
|
9800
9859
|
}
|
|
9801
9860
|
return input;
|
|
@@ -17567,6 +17626,28 @@ function videoLengthViolation(model, input) {
|
|
|
17567
17626
|
return `${model.label} takes a source video of at least ${String(sourceMin)} s; this one is ${seconds2(source2, sourceMin)} s.`;
|
|
17568
17627
|
return void 0;
|
|
17569
17628
|
}
|
|
17629
|
+
function undersizedSide(frame, limits) {
|
|
17630
|
+
if (!frame || !limits) return void 0;
|
|
17631
|
+
const { width, height } = frame;
|
|
17632
|
+
if (limits.minWidth !== void 0 && width !== void 0 && width > 0 && width < limits.minWidth)
|
|
17633
|
+
return { side: "wide", min: limits.minWidth, actual: width };
|
|
17634
|
+
if (limits.minHeight !== void 0 && height !== void 0 && height > 0 && height < limits.minHeight)
|
|
17635
|
+
return { side: "tall", min: limits.minHeight, actual: height };
|
|
17636
|
+
return void 0;
|
|
17637
|
+
}
|
|
17638
|
+
function videoSizeViolation(model, input) {
|
|
17639
|
+
const refLimits = model.constraints.references?.videoPixels;
|
|
17640
|
+
const refs = input.referenceVideos ?? [];
|
|
17641
|
+
for (let i = 0; i < refs.length; i++) {
|
|
17642
|
+
const under2 = undersizedSide(refs[i], refLimits);
|
|
17643
|
+
if (under2)
|
|
17644
|
+
return `${model.label} takes reference videos at least ${String(under2.min)} px ${under2.side}; video ${i + 1} is ${String(under2.actual)} px.`;
|
|
17645
|
+
}
|
|
17646
|
+
const under = undersizedSide(input.sourceVideo, model.constraints.sourceVideoPixels);
|
|
17647
|
+
if (under)
|
|
17648
|
+
return `${model.label} takes a source video at least ${String(under.min)} px ${under.side}; this one is ${String(under.actual)} px.`;
|
|
17649
|
+
return void 0;
|
|
17650
|
+
}
|
|
17570
17651
|
function resolveImageOptions(model, request, onUnsupported = "error") {
|
|
17571
17652
|
const warnings = [];
|
|
17572
17653
|
const c = model.constraints;
|
|
@@ -19686,6 +19767,7 @@ export {
|
|
|
19686
19767
|
toGeneratedImage,
|
|
19687
19768
|
validateInputSpec,
|
|
19688
19769
|
videoLengthViolation,
|
|
19770
|
+
videoSizeViolation,
|
|
19689
19771
|
videoToolConstraints,
|
|
19690
19772
|
withRetry,
|
|
19691
19773
|
xaiVideoAdapter
|