@picsart/ai-sdk 6.48.1 → 6.49.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/index.d.ts +13 -0
- package/index.js +61 -9
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1234,6 +1234,18 @@ type ModelInputById = {
|
|
|
1234
1234
|
prompt: string;
|
|
1235
1235
|
imageUrls?: string[];
|
|
1236
1236
|
};
|
|
1237
|
+
"macaron-cookie": {
|
|
1238
|
+
prompt: string;
|
|
1239
|
+
aspectRatio?: "16:9" | "9:16";
|
|
1240
|
+
resolution?: "360p" | "720p" | "1080p" | "4k";
|
|
1241
|
+
duration?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
|
1242
|
+
startFrame?: string;
|
|
1243
|
+
endFrame?: string;
|
|
1244
|
+
imageUrls?: string[];
|
|
1245
|
+
videoUrl?: string;
|
|
1246
|
+
videoUrls?: string[];
|
|
1247
|
+
task?: "edit" | "extend";
|
|
1248
|
+
};
|
|
1237
1249
|
"minimax-h3": {
|
|
1238
1250
|
prompt: string;
|
|
1239
1251
|
startFrame?: string;
|
|
@@ -3720,6 +3732,7 @@ declare const Models: {
|
|
|
3720
3732
|
readonly Lyria3Clip: "lyria-3-clip";
|
|
3721
3733
|
readonly Lyria3Pro: "lyria-3-pro";
|
|
3722
3734
|
readonly Lyria35: "lyria-3.5";
|
|
3735
|
+
readonly MacaronCookie: "macaron-cookie";
|
|
3723
3736
|
readonly MinimaxH3: "minimax-h3";
|
|
3724
3737
|
readonly MinimaxH3ContextIr: "minimax-h3-context-ir";
|
|
3725
3738
|
readonly MinimaxH3Max: "minimax-h3-max";
|
package/index.js
CHANGED
|
@@ -7252,6 +7252,41 @@ var { MODELS: MODELS22 } = defineModels("google", [
|
|
|
7252
7252
|
...params.videoInput("Source Video", "asset", false, 30),
|
|
7253
7253
|
...params.videoInputs(3, "Reference Videos")
|
|
7254
7254
|
}
|
|
7255
|
+
},
|
|
7256
|
+
{
|
|
7257
|
+
id: "macaron-cookie",
|
|
7258
|
+
name: "Gemini Omni (Macaron)",
|
|
7259
|
+
addedAt: "2026-10-19",
|
|
7260
|
+
release: "preview",
|
|
7261
|
+
workflow: "gemini-omni/video",
|
|
7262
|
+
estimatedTime: { "360p": 30, "720p": 40, "1080p": 60, "4k": 90 },
|
|
7263
|
+
mode: "video",
|
|
7264
|
+
inputType: "t2v",
|
|
7265
|
+
description: "Gemini Omni (Macaron) \u2014 multimodal video with frame interpolation, extension, reference-guided generation, and up to 4K output.",
|
|
7266
|
+
features: [feat("Start/End Frame", "input"), feat("Reference Images & Videos", "input"), feat("Video Extension", "input"), feat("4K", "resolution"), feat("3\u201310 sec", "duration")],
|
|
7267
|
+
paramConfig: {
|
|
7268
|
+
...params.prompt(),
|
|
7269
|
+
...params.aspectRatio(["16:9", "9:16"], "16:9"),
|
|
7270
|
+
...params.resolution(["360p", "720p", "1080p", "4k"], "720p"),
|
|
7271
|
+
...params.duration([3, 4, 5, 6, 7, 8, 9, 10], 8),
|
|
7272
|
+
...params.startFrame("Start Frame"),
|
|
7273
|
+
...params.endFrame("End Frame"),
|
|
7274
|
+
...params.imageInput(5, "Reference Images", false, "reference"),
|
|
7275
|
+
// Source video drives the edit/extend tasks; input must be under 30s.
|
|
7276
|
+
...params.videoInput("Source Video", "asset", false, 30),
|
|
7277
|
+
...params.videoInputs(3, "Reference Videos"),
|
|
7278
|
+
// With a source video the worker auto-derives `extend`; this toggle lets
|
|
7279
|
+
// the caller choose video editing instead. Only sent when a video is present.
|
|
7280
|
+
...p.enum("task", ["edit", "extend"], "edit", { label: "Mode" })
|
|
7281
|
+
},
|
|
7282
|
+
// edit/extend only apply to a source video — disable the toggle until one
|
|
7283
|
+
// is provided (matches the payload builder, which omits `task` without it).
|
|
7284
|
+
constraints: [
|
|
7285
|
+
{
|
|
7286
|
+
when: { videoUrl: { exists: false } },
|
|
7287
|
+
then: { task: { disabled: true, reason: "Add a source video to choose edit or extend." } }
|
|
7288
|
+
}
|
|
7289
|
+
]
|
|
7255
7290
|
}
|
|
7256
7291
|
]);
|
|
7257
7292
|
|
|
@@ -7274,6 +7309,21 @@ var buildOmniFlash11Payload = (input) => ({
|
|
|
7274
7309
|
...input.videoUrl ? { video: { url: input.videoUrl } } : {},
|
|
7275
7310
|
...input.videoUrls?.length ? { referenceVideos: input.videoUrls.map((url) => ({ url })) } : {}
|
|
7276
7311
|
});
|
|
7312
|
+
var buildMacaronCookiePayload = (input) => ({
|
|
7313
|
+
prompt: input.prompt,
|
|
7314
|
+
model: "macaron-cookie",
|
|
7315
|
+
aspectRatio: input.aspectRatio ?? "16:9",
|
|
7316
|
+
durationSeconds: input.duration ?? 8,
|
|
7317
|
+
resolution: input.resolution ?? "720p",
|
|
7318
|
+
...input.startFrame ? { image: toImage(input.startFrame) } : {},
|
|
7319
|
+
...input.endFrame ? { lastFrame: toImage(input.endFrame) } : {},
|
|
7320
|
+
...input.imageUrls?.length ? { referenceImages: input.imageUrls.map(toImage) } : {},
|
|
7321
|
+
// A source video runs edit or extend; the worker auto-derives `extend`, so
|
|
7322
|
+
// forward the explicit task (default 'edit') to pick editing. Omitted without
|
|
7323
|
+
// a video so text/image/reference inputs keep their own derived tasks.
|
|
7324
|
+
...input.videoUrl ? { video: { url: input.videoUrl }, task: input.task ?? "edit" } : {},
|
|
7325
|
+
...input.videoUrls?.length ? { referenceVideos: input.videoUrls.map((url) => ({ url })) } : {}
|
|
7326
|
+
});
|
|
7277
7327
|
var STYLE_MAX = 500;
|
|
7278
7328
|
var TEXT_MAX = 6e3;
|
|
7279
7329
|
var invalid = (message) => new ApiError(message, { status: 400, code: "validation_error" });
|
|
@@ -7359,6 +7409,7 @@ var buildTts38Payload = (model) => (input) => {
|
|
|
7359
7409
|
};
|
|
7360
7410
|
registerPayloads(MODELS22, {
|
|
7361
7411
|
"gemini-omni-1.1-flash-preview": buildOmniFlash11Payload,
|
|
7412
|
+
"macaron-cookie": buildMacaronCookiePayload,
|
|
7362
7413
|
"gemini-2.5-flash-tts": buildTts25Payload("gemini-2.5-flash-tts"),
|
|
7363
7414
|
"gemini-2.5-pro-tts": buildTts25Payload("gemini-2.5-pro-tts"),
|
|
7364
7415
|
"gemini-3.8-flash-tts": buildTts38Payload("gemini-3.8-flash-tts"),
|
|
@@ -11878,13 +11929,12 @@ var extractUrl = (result) => {
|
|
|
11878
11929
|
if (typeof obj.url === "string") return obj.url;
|
|
11879
11930
|
if (typeof obj.videoUrl === "string") return obj.videoUrl;
|
|
11880
11931
|
if (typeof obj.video_url === "string") return obj.video_url;
|
|
11881
|
-
|
|
11882
|
-
const
|
|
11883
|
-
if (typeof
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
if (typeof a.url === "string") return a.url;
|
|
11932
|
+
for (const key of ["video", "audio"]) {
|
|
11933
|
+
const media = Array.isArray(obj[key]) ? obj[key][0] : obj[key];
|
|
11934
|
+
if (media && typeof media === "object") {
|
|
11935
|
+
const m = media;
|
|
11936
|
+
if (typeof m.url === "string") return m.url;
|
|
11937
|
+
}
|
|
11888
11938
|
}
|
|
11889
11939
|
if (obj.assets && typeof obj.assets === "object") {
|
|
11890
11940
|
const a = obj.assets;
|
|
@@ -11995,7 +12045,7 @@ var extractText = (result) => {
|
|
|
11995
12045
|
}
|
|
11996
12046
|
return void 0;
|
|
11997
12047
|
};
|
|
11998
|
-
var RESULT_ARRAY_KEYS = ["items", "images", "imageUrls", "urls", "data", "previews"];
|
|
12048
|
+
var RESULT_ARRAY_KEYS = ["items", "images", "imageUrls", "urls", "data", "previews", "audio", "video"];
|
|
11999
12049
|
var extractAllResults = (result) => {
|
|
12000
12050
|
if (!result || typeof result !== "object") return void 0;
|
|
12001
12051
|
const obj = result;
|
|
@@ -13836,7 +13886,7 @@ function parseResult(completed, model, contract) {
|
|
|
13836
13886
|
}
|
|
13837
13887
|
const obj = parsed && typeof parsed === "object" ? parsed : void 0;
|
|
13838
13888
|
let source = parsed;
|
|
13839
|
-
for (const key of ["images", "items", "imageUrls", "data", "previews"]) {
|
|
13889
|
+
for (const key of ["images", "items", "imageUrls", "data", "previews", "audio", "video"]) {
|
|
13840
13890
|
const arr = obj?.[key];
|
|
13841
13891
|
if (Array.isArray(arr) && arr.length > 0) {
|
|
13842
13892
|
source = arr[0];
|
|
@@ -15432,6 +15482,7 @@ var LumaUni1Max = "luma-uni-1-max";
|
|
|
15432
15482
|
var Lyria3Clip = "lyria-3-clip";
|
|
15433
15483
|
var Lyria3Pro = "lyria-3-pro";
|
|
15434
15484
|
var Lyria35 = "lyria-3.5";
|
|
15485
|
+
var MacaronCookie = "macaron-cookie";
|
|
15435
15486
|
var MinimaxH3 = "minimax-h3";
|
|
15436
15487
|
var MinimaxH3ContextIr = "minimax-h3-context-ir";
|
|
15437
15488
|
var MinimaxH3Max = "minimax-h3-max";
|
|
@@ -15706,6 +15757,7 @@ var Models = {
|
|
|
15706
15757
|
Lyria3Clip,
|
|
15707
15758
|
Lyria3Pro,
|
|
15708
15759
|
Lyria35,
|
|
15760
|
+
MacaronCookie,
|
|
15709
15761
|
MinimaxH3,
|
|
15710
15762
|
MinimaxH3ContextIr,
|
|
15711
15763
|
MinimaxH3Max,
|