@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 +13 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -744,7 +744,7 @@ var VIDEO_MODELS = [
|
|
|
744
744
|
durations: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
745
745
|
references: { images: 9, videos: 3, audios: 3, audioOnly: false },
|
|
746
746
|
ratioIgnoredWith: ["firstFrame"],
|
|
747
|
-
supports: ["generateAudio", "seed"]
|
|
747
|
+
supports: ["generateAudio", "seed", "lastFrame"]
|
|
748
748
|
},
|
|
749
749
|
defaults: {
|
|
750
750
|
durationSeconds: 5,
|
|
@@ -769,7 +769,7 @@ var VIDEO_MODELS = [
|
|
|
769
769
|
durations: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
770
770
|
references: { images: 9, videos: 3, audios: 3, audioOnly: false },
|
|
771
771
|
ratioIgnoredWith: ["firstFrame"],
|
|
772
|
-
supports: ["generateAudio", "seed"]
|
|
772
|
+
supports: ["generateAudio", "seed", "lastFrame"]
|
|
773
773
|
},
|
|
774
774
|
defaults: {
|
|
775
775
|
durationSeconds: 5,
|
|
@@ -795,7 +795,7 @@ var VIDEO_MODELS = [
|
|
|
795
795
|
durations: { min: 4, max: 30 },
|
|
796
796
|
references: { images: 30, videos: 10, audios: 10 },
|
|
797
797
|
ratioIgnoredWith: ["firstFrame"],
|
|
798
|
-
supports: ["generateAudio", "seed"]
|
|
798
|
+
supports: ["generateAudio", "seed", "lastFrame"]
|
|
799
799
|
},
|
|
800
800
|
defaults: {
|
|
801
801
|
durationSeconds: 5,
|
|
@@ -897,7 +897,7 @@ var VIDEO_MODELS = [
|
|
|
897
897
|
resolutions: ["720p", "1080p"],
|
|
898
898
|
durations: { min: 3, max: 15 },
|
|
899
899
|
references: { images: 7 },
|
|
900
|
-
supports: ["generateAudio"]
|
|
900
|
+
supports: ["generateAudio", "lastFrame"]
|
|
901
901
|
},
|
|
902
902
|
defaults: { durationSeconds: 5, aspectRatio: "16:9", generateAudio: false, mode: "pro" },
|
|
903
903
|
usage: { unit: "compute_seconds", modality: "VIDEO" },
|
|
@@ -2464,6 +2464,7 @@ async function generateSeedanceVideo(req, ctx) {
|
|
|
2464
2464
|
};
|
|
2465
2465
|
if (!hasFrameAnchor && req.aspectRatio !== void 0) body.ratio = req.aspectRatio;
|
|
2466
2466
|
if (req.generateAudio !== void 0) body.generate_audio = req.generateAudio;
|
|
2467
|
+
if (req.seed !== void 0) body.seed = req.seed;
|
|
2467
2468
|
const submit = await withRetry(async () => {
|
|
2468
2469
|
const res = await ctx.fetch(
|
|
2469
2470
|
`${ARK_BASE_URL}${SUBMIT_PATH}`,
|
|
@@ -3864,6 +3865,7 @@ function toProviderError(cause, ctx) {
|
|
|
3864
3865
|
});
|
|
3865
3866
|
}
|
|
3866
3867
|
const info = describeThrown(cause);
|
|
3868
|
+
if (info.status === void 0) return transportError("google-image", cause, ctx.model.id);
|
|
3867
3869
|
return classifyHttpError(info.status, info.body, "google-image", ctx.model.id);
|
|
3868
3870
|
}
|
|
3869
3871
|
function createGoogleImageAdapter(deps = defaultGoogleImageDeps) {
|
|
@@ -5325,7 +5327,13 @@ async function generateReplicateAudio(req, ctx, deps) {
|
|
|
5325
5327
|
const input = id.includes("mmaudio") ? mmaudioInput(req, ctx) : id.includes("elevenlabs") ? elevenLabsMusicInput(req, ctx) : lyriaAudioInput(req, ctx);
|
|
5326
5328
|
const { url, predictTime, raw } = await runPrediction(ctx, input, deps);
|
|
5327
5329
|
const usage2 = audioUsage(ctx, req);
|
|
5328
|
-
|
|
5330
|
+
if (ctx.model.usage.unit === "seconds") {
|
|
5331
|
+
const seconds = elevenLabsMusicDuration(req.durationSeconds);
|
|
5332
|
+
usage2.quantity = seconds;
|
|
5333
|
+
usage2.durationSeconds = seconds;
|
|
5334
|
+
} else {
|
|
5335
|
+
usage2.quantity = predictTime;
|
|
5336
|
+
}
|
|
5329
5337
|
return { audio: { url }, usage: usage2, raw: predictionRaw(raw) };
|
|
5330
5338
|
}
|
|
5331
5339
|
|