@shop-os/modelkit 0.7.8 → 0.7.10

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 CHANGED
@@ -9,6 +9,17 @@ header in the release PR.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.7.10] - Unreleased
13
+
14
+ Kling V3 Omni moves from Replicate to fal at half the provider cost.
15
+
16
+ ### Changed
17
+ - `kling-v3-omni-video` runs on fal Kling O3 (`adapter: "fal"`, `providerModelId: "fal-ai/kling-video/o3"`) instead of Replicate `kwaivgi/kling-v3-omni-video`. The id, aliases, ratios, resolutions, durations, defaults and the `mode` to resolution rule stay. The tier picks the endpoint path (`standard` 720p, `pro` 1080p, `4k`), and the inputs pick the task: reference images go to `reference-to-video`, frames alone to `image-to-video`, a prompt alone to `text-to-video`. A lone end frame still goes as the start frame. fal cost per second: standard $0.084 silent / $0.112 sound, pro $0.112 / $0.14, 4k $0.42 (Replicate: $0.168 / $0.224, $0.224 / $0.28, $0.42).
18
+ - The row's usage unit is `seconds` (was Replicate `compute_seconds`): usage events now carry provider `fal`, the requested length and the rendered resolution.
19
+ - The row declares `videos: 0, audios: 0` (was no video slot and a dormant `imagesWithVideo: 4`). The Replicate adapter never sent a reference video, so nothing that worked is lost; the resolver now trims one with `references_trimmed` instead of passing it through. Frames and reference images share fal's cap of 7, as on `kling-o3`. The display description no longer claims editing or reference video.
20
+ - The Replicate `kwaivgi/kling-v3-omni-video` mapper stays. `seed-model-catalog` never updates an existing row, so each deployed `model_catalog` row keeps running on Replicate after the bump, until it is switched to this row's `adapter`, `providerModelId`, `references` and `usage` (pro-admin, per env). Reverting that edit rolls back.
21
+ - Consumers that branch on `adapter === "replicate"` for this row (shopos-ui vibe-triggers, the trigger-workflows wire test) must handle the fal row before an env is switched.
22
+
12
23
  ## [0.7.8] - Unreleased
13
24
 
14
25
  ENG-3324: Ray 3.2 offers 10 s clips.
package/dist/catalog.cjs CHANGED
@@ -5736,38 +5736,38 @@ var VIDEO_MODELS = [
5736
5736
  capabilities: { ...FRAMES_EXCLUDE_REFERENCES }
5737
5737
  },
5738
5738
  {
5739
- // mode standard/pro/4k selects 720p/1080p/4K; the endpoint takes no separate resolution.
5740
- // Replicate: "Max 7 [images] without video, 4 with video"; 4K does not support
5741
- // reference_video. No `videos` limit yet: the adapter sends no reference video,
5742
- // so `imagesWithVideo` stays dormant until one is wired through.
5739
+ // fal Kling O3 (adapters/fal-kling-omni.ts): mode standard/pro/4k selects 720p/1080p/4K
5740
+ // in the endpoint path. Moved off Replicate kwaivgi/kling-v3-omni-video, which fal sells
5741
+ // at half the price; the id and inputs stay. The Replicate mapper stays for deployed
5742
+ // model_catalog rows not yet switched. Frames and reference images share fal's cap of 7.
5743
+ // Reference video, multi-shot and keep-sound were never wired, so stay off.
5743
5744
  id: "kling-v3-omni-video",
5744
5745
  aliases: ["kwaivgi/kling-v3-omni-video", "kling-v3-omni"],
5745
5746
  label: "Kling V3 Omni",
5746
5747
  type: "video",
5747
- adapter: "replicate",
5748
- providerModelId: "kwaivgi/kling-v3-omni-video",
5748
+ adapter: "fal",
5749
+ providerModelId: "fal-ai/kling-video/o3",
5749
5750
  lifecycle: "active",
5750
5751
  exposure: ["cowork", "space_builder"],
5751
5752
  constraints: {
5752
5753
  aspectRatios: [...KLING_OMNI_RATIOS],
5753
5754
  resolutions: ["720p", "1080p", "4k"],
5754
5755
  durations: { min: 3, max: 15 },
5755
- references: { images: 7, imagesWithVideo: 4 },
5756
+ references: { images: 7, videos: 0, audios: 0 },
5756
5757
  supports: ["generateAudio", "lastFrame"],
5757
5758
  prompt: KLING_PROMPT2,
5758
5759
  audio: "optional"
5759
5760
  },
5760
5761
  defaults: { durationSeconds: 5, aspectRatio: "16:9", generateAudio: true, mode: "pro" },
5761
- usage: { unit: "compute_seconds" },
5762
+ usage: { ...VIDEO_USAGE3 },
5762
5763
  pricingKind: "video_per_second",
5763
5764
  display: {
5764
5765
  provider: "kuaishou",
5765
5766
  logo: "https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@1.97.0/light/kling-color.png",
5766
- description: "Kuaishou Kling Video 3.0 Omni unified generation and editing from text, start/end images, up to 7 reference images, and reference video; up to 15 seconds at up to 4K."
5767
+ description: "Kuaishou Kling Video 3.0 Omni generation from text, start/end images and up to 7 reference images, with optional native audio; up to 15 seconds at up to 4K."
5767
5768
  }
5768
- // end_image "Requires start_image", but no lastFrameRequiresFirstFrame: SpaceLab resolves
5769
- // replicate rows in error mode, so the flag would refuse its end-frame-only nodes, which
5770
- // the adapter sends as start_image.
5769
+ // No lastFrameRequiresFirstFrame: fal image-to-video needs a start frame, so the adapter
5770
+ // sends a lone end frame as the start frame, as the Replicate model took it.
5771
5771
  },
5772
5772
  {
5773
5773
  id: "minimax-h3",
@@ -8522,6 +8522,7 @@ var KLING_TIERS = [
8522
8522
  { mode: "pro", resolution: "1080p" },
8523
8523
  { mode: "4k", resolution: "4k" }
8524
8524
  ];
8525
+ var KLING_O3_OMNI = "fal-ai/kling-video/o3";
8525
8526
  function klingTier(req) {
8526
8527
  return KLING_TIERS.find((tier) => tier.resolution === req.resolution) ?? KLING_TIERS.find((tier) => tier.mode === req.mode) ?? KLING_TIERS[0];
8527
8528
  }
@@ -8670,6 +8671,7 @@ var RULES = /* @__PURE__ */ new Map([
8670
8671
  [MOTION_PRO, motionControl],
8671
8672
  [MOTION_STANDARD, motionControl],
8672
8673
  [O3_REFERENCE, o3Reference],
8674
+ [KLING_O3_OMNI, o3Reference],
8673
8675
  [O3_EDIT, (req) => needsSource(req) ?? needsPrompt(req)],
8674
8676
  [H3_TURBO, h3Turbo],
8675
8677
  [MINIMAX_H3_INSERT, h3Insert],
@@ -8699,13 +8701,14 @@ function h3EndFrameRatioWarning(model, ratio) {
8699
8701
  message: `${model.id} follows the end frame's aspect ratio`
8700
8702
  };
8701
8703
  }
8702
- function isReplicateKling(model) {
8704
+ function takesKlingMode(model) {
8705
+ if (model.adapter === "fal") return model.providerModelId.toLowerCase() === KLING_O3_OMNI;
8703
8706
  if (model.adapter !== "replicate") return false;
8704
8707
  const kind = videoKind(model.providerModelId);
8705
8708
  return kind === "kling" || kind === "kling-omni";
8706
8709
  }
8707
- function fillReplicateKlingResolution(model, req) {
8708
- if (isReplicateKling(model) && req.resolution === void 0) {
8710
+ function fillKlingModeResolution(model, req) {
8711
+ if (takesKlingMode(model) && req.resolution === void 0) {
8709
8712
  req.resolution = klingTier(req).resolution;
8710
8713
  }
8711
8714
  }
@@ -9098,10 +9101,10 @@ function resolveVideoOptions(model, request, onUnsupported = "error") {
9098
9101
  warnings
9099
9102
  );
9100
9103
  if (aspectRatio !== void 0) merged.aspectRatio = aspectRatio;
9101
- fillReplicateKlingResolution(model, merged);
9104
+ fillKlingModeResolution(model, merged);
9102
9105
  const resolution = resolveVideoResolution(merged.resolution, model, onUnsupported, warnings);
9103
9106
  if (resolution !== void 0) merged.resolution = resolution;
9104
- if (isReplicateKling(model)) delete merged.mode;
9107
+ if (takesKlingMode(model)) delete merged.mode;
9105
9108
  const duration = resolveDuration(
9106
9109
  merged.durationSeconds,
9107
9110
  c.durations,