@shop-os/modelkit 0.7.0 → 0.7.2

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.
@@ -1687,6 +1687,41 @@ declare function resolveImageOptions(model: CatalogModel, request: ImageRequest,
1687
1687
  declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
1688
1688
  declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
1689
1689
 
1690
+ /** Provider body or the lifted detail (Gemini blockReason, fal body.detail). */
1691
+ type ProviderErrorBody = string | JsonValue;
1692
+ type ModelKitErrorCode = "unknown_model" | "unsupported_option" | "missing_input" | "content_blocked" | "provider_rejected"
1693
+ /** The provider account is out of credit or quota (HTTP 402 and its body spellings). Never retried. */
1694
+ | "provider_billing" | "timeout" | "auth" | "network" | "rate_limited";
1695
+ interface ModelKitErrorInit {
1696
+ code: ModelKitErrorCode;
1697
+ message: string;
1698
+ provider?: string;
1699
+ model?: string;
1700
+ status?: number;
1701
+ body?: ProviderErrorBody;
1702
+ cause?: unknown;
1703
+ retryable?: boolean;
1704
+ }
1705
+ declare class ModelKitError extends Error {
1706
+ readonly code: ModelKitErrorCode;
1707
+ readonly provider: string | undefined;
1708
+ readonly model: string | undefined;
1709
+ readonly status: number | undefined;
1710
+ readonly body: ProviderErrorBody | undefined;
1711
+ readonly retryable: boolean;
1712
+ constructor(init: ModelKitErrorInit);
1713
+ }
1714
+ declare function isModelKitError(err: unknown): err is ModelKitError;
1715
+
1716
+ /**
1717
+ * A row whose aspect ratio is the frame it renders its source into (Ray 3.2 Reframe): it
1718
+ * requires a source video and lists ratios without "adaptive", so the ratio is a target. Every
1719
+ * other edit row keeps the source's framing.
1720
+ */
1721
+ declare function takesTargetAspectRatio(model: Pick<CatalogModel, "constraints">): boolean;
1722
+ /** Whether a Luma reframe asks for a vertical target at 1080p, which Luma does not render. */
1723
+ declare function lumaReframeTooTall(req: Pick<VideoRequest, "aspectRatio" | "resolution">): boolean;
1724
+
1690
1725
  /** `generateSpeech` on a `speech` row. */
1691
1726
  declare function resolveSpeechOptions(model: CatalogModel, request: SpeechRequest, onUnsupported?: OnUnsupported): ResolveResult<SpeechRequest>;
1692
1727
  /** `changeVoice` on a `voice-change` row. */
@@ -1794,30 +1829,4 @@ declare function promptConventions(row: {
1794
1829
  constraints: unknown;
1795
1830
  }): PromptConventions;
1796
1831
 
1797
- /** Provider body or the lifted detail (Gemini blockReason, fal body.detail). */
1798
- type ProviderErrorBody = string | JsonValue;
1799
- type ModelKitErrorCode = "unknown_model" | "unsupported_option" | "missing_input" | "content_blocked" | "provider_rejected"
1800
- /** The provider account is out of credit or quota (HTTP 402 and its body spellings). Never retried. */
1801
- | "provider_billing" | "timeout" | "auth" | "network" | "rate_limited";
1802
- interface ModelKitErrorInit {
1803
- code: ModelKitErrorCode;
1804
- message: string;
1805
- provider?: string;
1806
- model?: string;
1807
- status?: number;
1808
- body?: ProviderErrorBody;
1809
- cause?: unknown;
1810
- retryable?: boolean;
1811
- }
1812
- declare class ModelKitError extends Error {
1813
- readonly code: ModelKitErrorCode;
1814
- readonly provider: string | undefined;
1815
- readonly model: string | undefined;
1816
- readonly status: number | undefined;
1817
- readonly body: ProviderErrorBody | undefined;
1818
- readonly retryable: boolean;
1819
- constructor(init: ModelKitErrorInit);
1820
- }
1821
- declare function isModelKitError(err: unknown): err is ModelKitError;
1822
-
1823
- 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 };
1832
+ 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, lumaReframeTooTall, 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, takesTargetAspectRatio, videoLengthViolation, videoToolConstraints };
package/dist/catalog.d.ts CHANGED
@@ -1687,6 +1687,41 @@ declare function resolveImageOptions(model: CatalogModel, request: ImageRequest,
1687
1687
  declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
1688
1688
  declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
1689
1689
 
1690
+ /** Provider body or the lifted detail (Gemini blockReason, fal body.detail). */
1691
+ type ProviderErrorBody = string | JsonValue;
1692
+ type ModelKitErrorCode = "unknown_model" | "unsupported_option" | "missing_input" | "content_blocked" | "provider_rejected"
1693
+ /** The provider account is out of credit or quota (HTTP 402 and its body spellings). Never retried. */
1694
+ | "provider_billing" | "timeout" | "auth" | "network" | "rate_limited";
1695
+ interface ModelKitErrorInit {
1696
+ code: ModelKitErrorCode;
1697
+ message: string;
1698
+ provider?: string;
1699
+ model?: string;
1700
+ status?: number;
1701
+ body?: ProviderErrorBody;
1702
+ cause?: unknown;
1703
+ retryable?: boolean;
1704
+ }
1705
+ declare class ModelKitError extends Error {
1706
+ readonly code: ModelKitErrorCode;
1707
+ readonly provider: string | undefined;
1708
+ readonly model: string | undefined;
1709
+ readonly status: number | undefined;
1710
+ readonly body: ProviderErrorBody | undefined;
1711
+ readonly retryable: boolean;
1712
+ constructor(init: ModelKitErrorInit);
1713
+ }
1714
+ declare function isModelKitError(err: unknown): err is ModelKitError;
1715
+
1716
+ /**
1717
+ * A row whose aspect ratio is the frame it renders its source into (Ray 3.2 Reframe): it
1718
+ * requires a source video and lists ratios without "adaptive", so the ratio is a target. Every
1719
+ * other edit row keeps the source's framing.
1720
+ */
1721
+ declare function takesTargetAspectRatio(model: Pick<CatalogModel, "constraints">): boolean;
1722
+ /** Whether a Luma reframe asks for a vertical target at 1080p, which Luma does not render. */
1723
+ declare function lumaReframeTooTall(req: Pick<VideoRequest, "aspectRatio" | "resolution">): boolean;
1724
+
1690
1725
  /** `generateSpeech` on a `speech` row. */
1691
1726
  declare function resolveSpeechOptions(model: CatalogModel, request: SpeechRequest, onUnsupported?: OnUnsupported): ResolveResult<SpeechRequest>;
1692
1727
  /** `changeVoice` on a `voice-change` row. */
@@ -1794,30 +1829,4 @@ declare function promptConventions(row: {
1794
1829
  constraints: unknown;
1795
1830
  }): PromptConventions;
1796
1831
 
1797
- /** Provider body or the lifted detail (Gemini blockReason, fal body.detail). */
1798
- type ProviderErrorBody = string | JsonValue;
1799
- type ModelKitErrorCode = "unknown_model" | "unsupported_option" | "missing_input" | "content_blocked" | "provider_rejected"
1800
- /** The provider account is out of credit or quota (HTTP 402 and its body spellings). Never retried. */
1801
- | "provider_billing" | "timeout" | "auth" | "network" | "rate_limited";
1802
- interface ModelKitErrorInit {
1803
- code: ModelKitErrorCode;
1804
- message: string;
1805
- provider?: string;
1806
- model?: string;
1807
- status?: number;
1808
- body?: ProviderErrorBody;
1809
- cause?: unknown;
1810
- retryable?: boolean;
1811
- }
1812
- declare class ModelKitError extends Error {
1813
- readonly code: ModelKitErrorCode;
1814
- readonly provider: string | undefined;
1815
- readonly model: string | undefined;
1816
- readonly status: number | undefined;
1817
- readonly body: ProviderErrorBody | undefined;
1818
- readonly retryable: boolean;
1819
- constructor(init: ModelKitErrorInit);
1820
- }
1821
- declare function isModelKitError(err: unknown): err is ModelKitError;
1822
-
1823
- 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 };
1832
+ 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, lumaReframeTooTall, 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, takesTargetAspectRatio, videoLengthViolation, videoToolConstraints };
package/dist/catalog.js CHANGED
@@ -6126,14 +6126,17 @@ var VIDEO_TOOL_MODELS = [
6126
6126
  {
6127
6127
  // https://fal.ai/models/fal-ai/flashvsr/upscale/video/api: upscale_factor 1-4, X264 MP4
6128
6128
  // by default; fal bills $0.0005 per output megapixel-frame (width x height x frames).
6129
+ // Retired (ENG-3314): the price rows tier by short edge, which under-prices square, wide
6130
+ // and above-4k outputs.
6129
6131
  id: "flashvsr",
6130
6132
  aliases: ["flashvsr-upscale"],
6131
6133
  label: "FlashVSR",
6132
6134
  type: "video-tool",
6133
6135
  adapter: "fal",
6134
6136
  providerModelId: "fal-ai/flashvsr/upscale/video",
6135
- lifecycle: "active",
6136
- exposure: ["cowork", "space_builder"],
6137
+ lifecycle: "retired",
6138
+ replacedBy: "flux-video-upscale-precise",
6139
+ exposure: [],
6137
6140
  constraints: {
6138
6141
  supports: [],
6139
6142
  tool: { kind: "upscale", upscaleFactor: { min: 1, max: 4 } }
@@ -6336,6 +6339,57 @@ function applyXaiVideoRules(model, req, onUnsupported, warnings) {
6336
6339
  });
6337
6340
  req.resolution = XAI_REFERENCE_MAX_RESOLUTION;
6338
6341
  }
6342
+ function takesTargetAspectRatio(model) {
6343
+ const ratios = model.constraints.aspectRatios ?? [];
6344
+ return (model.constraints.requires ?? []).includes("sourceVideo") && ratios.length > 0 && !ratios.includes("adaptive");
6345
+ }
6346
+ var LUMA_REFRAME_VERTICAL_MAX_RESOLUTION = "720p";
6347
+ function lumaReframeTooTall(req) {
6348
+ const vertical = req.aspectRatio === "9:16" || req.aspectRatio === "3:4";
6349
+ return vertical && req.resolution === "1080p";
6350
+ }
6351
+ function applyLumaVideoRules(model, req, onUnsupported, warnings) {
6352
+ if (model.adapter !== "luma" || !takesTargetAspectRatio(model)) return;
6353
+ if (req.aspectRatio === void 0 || req.aspectRatio === "adaptive") {
6354
+ const listed2 = model.constraints.aspectRatios ?? [];
6355
+ const fallback = model.defaults.aspectRatio !== void 0 && model.defaults.aspectRatio !== "adaptive" ? model.defaults.aspectRatio : listed2[0];
6356
+ const message2 = `${model.id} needs a target aspect ratio: ${listed2.join(", ")}`;
6357
+ if (onUnsupported === "error" || fallback === void 0) {
6358
+ throw new ModelKitError({
6359
+ code: "unsupported_option",
6360
+ message: message2,
6361
+ model: model.id,
6362
+ retryable: false
6363
+ });
6364
+ }
6365
+ warnings.push({
6366
+ code: "ratio_coerced",
6367
+ field: "aspectRatio",
6368
+ from: req.aspectRatio ?? "adaptive",
6369
+ to: fallback,
6370
+ message: message2
6371
+ });
6372
+ req.aspectRatio = fallback;
6373
+ }
6374
+ if (!lumaReframeTooTall(req)) return;
6375
+ const message = `${model.id} renders 9:16 and 3:4 reframes at up to ${LUMA_REFRAME_VERTICAL_MAX_RESOLUTION}`;
6376
+ if (onUnsupported === "error") {
6377
+ throw new ModelKitError({
6378
+ code: "unsupported_option",
6379
+ message,
6380
+ model: model.id,
6381
+ retryable: false
6382
+ });
6383
+ }
6384
+ warnings.push({
6385
+ code: "resolution_coerced",
6386
+ field: "resolution",
6387
+ from: req.resolution,
6388
+ to: LUMA_REFRAME_VERTICAL_MAX_RESOLUTION,
6389
+ message
6390
+ });
6391
+ req.resolution = LUMA_REFRAME_VERTICAL_MAX_RESOLUTION;
6392
+ }
6339
6393
  var MINIMAX_H3_INSERT = "minimax/h3-max/insert-video";
6340
6394
  var INSERT_MIN = 1.625;
6341
6395
  var INSERT_MAX = 60;
@@ -9049,6 +9103,7 @@ function resolveVideoOptions(model, request, onUnsupported = "error") {
9049
9103
  delete merged.previousInteractionId;
9050
9104
  }
9051
9105
  applyXaiVideoRules(model, merged, onUnsupported, warnings);
9106
+ applyLumaVideoRules(model, merged, onUnsupported, warnings);
9052
9107
  checkVideoRequired(model, merged);
9053
9108
  applyFalVideoRules(model, merged, request.aspectRatio, warnings);
9054
9109
  return { request: merged, warnings };
@@ -9494,6 +9549,7 @@ export {
9494
9549
  isModelKitError,
9495
9550
  liveCatalog,
9496
9551
  liveState,
9552
+ lumaReframeTooTall,
9497
9553
  model3dConstraints,
9498
9554
  model3dInputRefusal,
9499
9555
  model3dPricingSku,
@@ -9519,6 +9575,7 @@ export {
9519
9575
  resolveVideoOptions,
9520
9576
  resolveVoiceChangeOptions,
9521
9577
  sortCatalogRows,
9578
+ takesTargetAspectRatio,
9522
9579
  videoLengthViolation,
9523
9580
  videoToolConstraints
9524
9581
  };