@shop-os/modelkit 0.1.1 → 0.1.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.
package/dist/index.cjs CHANGED
@@ -826,7 +826,7 @@ var VIDEO_MODELS = [
826
826
  durations: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
827
827
  references: { images: 9, videos: 3, audios: 3, audioOnly: false },
828
828
  ratioIgnoredWith: ["firstFrame"],
829
- supports: ["generateAudio", "seed"]
829
+ supports: ["generateAudio", "seed", "lastFrame"]
830
830
  },
831
831
  defaults: {
832
832
  durationSeconds: 5,
@@ -851,7 +851,7 @@ var VIDEO_MODELS = [
851
851
  durations: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
852
852
  references: { images: 9, videos: 3, audios: 3, audioOnly: false },
853
853
  ratioIgnoredWith: ["firstFrame"],
854
- supports: ["generateAudio", "seed"]
854
+ supports: ["generateAudio", "seed", "lastFrame"]
855
855
  },
856
856
  defaults: {
857
857
  durationSeconds: 5,
@@ -877,7 +877,7 @@ var VIDEO_MODELS = [
877
877
  durations: { min: 4, max: 30 },
878
878
  references: { images: 30, videos: 10, audios: 10 },
879
879
  ratioIgnoredWith: ["firstFrame"],
880
- supports: ["generateAudio", "seed"]
880
+ supports: ["generateAudio", "seed", "lastFrame"]
881
881
  },
882
882
  defaults: {
883
883
  durationSeconds: 5,
@@ -979,7 +979,7 @@ var VIDEO_MODELS = [
979
979
  resolutions: ["720p", "1080p"],
980
980
  durations: { min: 3, max: 15 },
981
981
  references: { images: 7 },
982
- supports: ["generateAudio"]
982
+ supports: ["generateAudio", "lastFrame"]
983
983
  },
984
984
  defaults: { durationSeconds: 5, aspectRatio: "16:9", generateAudio: false, mode: "pro" },
985
985
  usage: { unit: "compute_seconds", modality: "VIDEO" },
@@ -2539,6 +2539,7 @@ async function generateSeedanceVideo(req, ctx) {
2539
2539
  };
2540
2540
  if (!hasFrameAnchor && req.aspectRatio !== void 0) body.ratio = req.aspectRatio;
2541
2541
  if (req.generateAudio !== void 0) body.generate_audio = req.generateAudio;
2542
+ if (req.seed !== void 0) body.seed = req.seed;
2542
2543
  const submit = await withRetry(async () => {
2543
2544
  const res = await ctx.fetch(
2544
2545
  `${ARK_BASE_URL}${SUBMIT_PATH}`,
@@ -3937,6 +3938,7 @@ function toProviderError(cause, ctx) {
3937
3938
  });
3938
3939
  }
3939
3940
  const info = describeThrown(cause);
3941
+ if (info.status === void 0) return transportError("google-image", cause, ctx.model.id);
3940
3942
  return classifyHttpError(info.status, info.body, "google-image", ctx.model.id);
3941
3943
  }
3942
3944
  function createGoogleImageAdapter(deps = defaultGoogleImageDeps) {
@@ -5398,7 +5400,13 @@ async function generateReplicateAudio(req, ctx, deps) {
5398
5400
  const input = id.includes("mmaudio") ? mmaudioInput(req, ctx) : id.includes("elevenlabs") ? elevenLabsMusicInput(req, ctx) : lyriaAudioInput(req, ctx);
5399
5401
  const { url, predictTime, raw } = await runPrediction(ctx, input, deps);
5400
5402
  const usage2 = audioUsage(ctx, req);
5401
- usage2.quantity = ctx.model.usage.unit === "seconds" ? elevenLabsMusicDuration(req.durationSeconds) : predictTime;
5403
+ if (ctx.model.usage.unit === "seconds") {
5404
+ const seconds = elevenLabsMusicDuration(req.durationSeconds);
5405
+ usage2.quantity = seconds;
5406
+ usage2.durationSeconds = seconds;
5407
+ } else {
5408
+ usage2.quantity = predictTime;
5409
+ }
5402
5410
  return { audio: { url }, usage: usage2, raw: predictionRaw(raw) };
5403
5411
  }
5404
5412