@picsart/ai-sdk 6.22.0 → 6.23.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 +11 -1
- package/index.js +95 -51
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -778,7 +778,8 @@ type ModelInputById = {
|
|
|
778
778
|
prompt: string;
|
|
779
779
|
imageUrls?: string[];
|
|
780
780
|
mask?: string;
|
|
781
|
-
|
|
781
|
+
aspectRatio?: "auto" | "source" | "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "3:2" | "2:3" | "5:4" | "4:5" | "8:5" | "5:8" | "2:1" | "1:2" | "3:1" | "1:3";
|
|
782
|
+
resolution?: "1K" | "2K";
|
|
782
783
|
magicPrompt?: "auto" | "on" | "off";
|
|
783
784
|
quality?: "very_low" | "low" | "medium" | "high";
|
|
784
785
|
count?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
@@ -1907,6 +1908,14 @@ type ModelInputById = {
|
|
|
1907
1908
|
imageUrls?: string[];
|
|
1908
1909
|
negativePrompt?: string;
|
|
1909
1910
|
};
|
|
1911
|
+
"spicy-mayo": {
|
|
1912
|
+
prompt: string;
|
|
1913
|
+
aspectRatio?: "1:1" | "16:9" | "9:16" | "3:4" | "4:3" | "2:3" | "21:9" | "auto";
|
|
1914
|
+
count?: 1 | 2 | 4 | 6 | 8 | 10;
|
|
1915
|
+
seed?: number;
|
|
1916
|
+
thinkingLevel?: "minimal" | "medium" | "high";
|
|
1917
|
+
imageUrls?: string[];
|
|
1918
|
+
};
|
|
1910
1919
|
"topaz-upscale-image": {
|
|
1911
1920
|
imageUrls: [string, ...string[]];
|
|
1912
1921
|
model?: "Standard V2" | "Standard MAX" | "Low Resolution V2" | "High Fidelity V2" | "CGI" | "Text Refine" | "Redefine" | "Recovery" | "Recovery V2" | "Wonder" | "Wonder 3";
|
|
@@ -3523,6 +3532,7 @@ declare const Models: {
|
|
|
3523
3532
|
readonly Seedream50Flash: "seedream-5.0-flash";
|
|
3524
3533
|
readonly Seedream50Lite: "seedream-5.0-lite";
|
|
3525
3534
|
readonly Seedream50Pro: "seedream-5.0-pro";
|
|
3535
|
+
readonly SpicyMayo: "spicy-mayo";
|
|
3526
3536
|
readonly TopazUpscaleImage: "topaz-upscale-image";
|
|
3527
3537
|
readonly TopazUpscaleVideo: "topaz-upscale-video";
|
|
3528
3538
|
readonly VeedFabricV1: "veed-fabric-v1";
|
package/index.js
CHANGED
|
@@ -6583,6 +6583,16 @@ var buildGemini31FlashLiteImagePayload = (ctx) => ({
|
|
|
6583
6583
|
imageSize: ctx.resolution ?? "1K",
|
|
6584
6584
|
...buildThinkingConfig(ctx)
|
|
6585
6585
|
});
|
|
6586
|
+
var buildSpicyMayoPayload = (ctx) => ({
|
|
6587
|
+
prompt: ctx.prompt,
|
|
6588
|
+
model: "spicy-mayo",
|
|
6589
|
+
count: ctx.count ?? 1,
|
|
6590
|
+
...ctx.seed != null ? { seed: ctx.seed } : {},
|
|
6591
|
+
...ctx.imageUrls?.length ? { imageUrls: ctx.imageUrls } : {},
|
|
6592
|
+
aspectRatio: ctx.aspectRatio ?? "1:1",
|
|
6593
|
+
imageSize: "1K",
|
|
6594
|
+
...buildThinkingConfig(ctx)
|
|
6595
|
+
});
|
|
6586
6596
|
function inferMimeType2(url) {
|
|
6587
6597
|
return url.match(/\.png(\?|$)/i) ? "image/png" : "image/jpeg";
|
|
6588
6598
|
}
|
|
@@ -6661,8 +6671,52 @@ var thinkingBudgetParam = {
|
|
|
6661
6671
|
descriptor: { kind: "range", min: 128, max: 24576, step: 128, default: 128 }
|
|
6662
6672
|
}
|
|
6663
6673
|
};
|
|
6674
|
+
var spicyMayoThinkingParam = {
|
|
6675
|
+
thinkingLevel: {
|
|
6676
|
+
label: "Thinking",
|
|
6677
|
+
descriptor: {
|
|
6678
|
+
kind: "enum",
|
|
6679
|
+
valueType: "string",
|
|
6680
|
+
options: [
|
|
6681
|
+
{ id: "minimal", label: "Minimal (faster)" },
|
|
6682
|
+
{ id: "medium", label: "Medium (balanced)" },
|
|
6683
|
+
{ id: "high", label: "High (more reasoning)" }
|
|
6684
|
+
],
|
|
6685
|
+
default: "minimal"
|
|
6686
|
+
}
|
|
6687
|
+
}
|
|
6688
|
+
};
|
|
6664
6689
|
var { MODELS: MODELS22 } = defineModels("google", [
|
|
6665
6690
|
// ── Image ─────────────────────────────────────────────────────────
|
|
6691
|
+
{
|
|
6692
|
+
id: "spicy-mayo",
|
|
6693
|
+
name: "Spicy Mayo",
|
|
6694
|
+
addedAt: "2026-10-02",
|
|
6695
|
+
// Confidential early access at the vendor, authorized for named projects
|
|
6696
|
+
// only — stage until the co-launch clears it for prod.
|
|
6697
|
+
release: "preview",
|
|
6698
|
+
workflow: "gemini/v2/images",
|
|
6699
|
+
buildPayload: buildSpicyMayoPayload,
|
|
6700
|
+
// Measured end-to-end against stage at 1K/1:1: 9s to generate, 13s to edit
|
|
6701
|
+
// with two reference images. Rounded up — vendor testing capacity is capped.
|
|
6702
|
+
estimatedTime: 15,
|
|
6703
|
+
mode: "image",
|
|
6704
|
+
inputType: "t2i",
|
|
6705
|
+
modelId: "spicy-mayo",
|
|
6706
|
+
badge: ["fast"],
|
|
6707
|
+
description: "Fast Google image generation and editing with multi-image references.",
|
|
6708
|
+
// Only the 1K tier is priced, so no `resolution` param: the builder pins
|
|
6709
|
+
// imageSize and anything else is a 400 from the worker.
|
|
6710
|
+
features: [feat("Multi-Image Input", "input"), feat("1K", "resolution")],
|
|
6711
|
+
paramConfig: {
|
|
6712
|
+
...params.prompt(),
|
|
6713
|
+
...params.aspectRatio([...GEMINI_AR_WIDE], "1:1"),
|
|
6714
|
+
...params.count(),
|
|
6715
|
+
...params.seed(),
|
|
6716
|
+
...spicyMayoThinkingParam,
|
|
6717
|
+
...params.imageInput(14, "Source Images")
|
|
6718
|
+
}
|
|
6719
|
+
},
|
|
6666
6720
|
{
|
|
6667
6721
|
id: "gemini-3.1-flash-image",
|
|
6668
6722
|
addedAt: "2026-02-26",
|
|
@@ -8019,45 +8073,24 @@ var IDEOGRAM_45_IMAGE_BOUNDS = {
|
|
|
8019
8073
|
minAspectRatio: 1 / 6,
|
|
8020
8074
|
maxAspectRatio: 6
|
|
8021
8075
|
};
|
|
8022
|
-
var
|
|
8023
|
-
"
|
|
8024
|
-
"
|
|
8025
|
-
"
|
|
8026
|
-
"
|
|
8027
|
-
"
|
|
8028
|
-
"
|
|
8029
|
-
"
|
|
8030
|
-
"
|
|
8031
|
-
"
|
|
8032
|
-
"
|
|
8033
|
-
"
|
|
8034
|
-
"
|
|
8035
|
-
"
|
|
8036
|
-
"
|
|
8037
|
-
"
|
|
8038
|
-
"
|
|
8039
|
-
"
|
|
8040
|
-
"1248x3328",
|
|
8041
|
-
"3328x1248",
|
|
8042
|
-
"1280x3072",
|
|
8043
|
-
"3072x1280",
|
|
8044
|
-
"1024x3072",
|
|
8045
|
-
"3072x1024",
|
|
8046
|
-
"1024x1024",
|
|
8047
|
-
"896x1120",
|
|
8048
|
-
"1120x896",
|
|
8049
|
-
"864x1152",
|
|
8050
|
-
"1152x864",
|
|
8051
|
-
"832x1248",
|
|
8052
|
-
"1248x832",
|
|
8053
|
-
"800x1280",
|
|
8054
|
-
"1280x800",
|
|
8055
|
-
"720x1280",
|
|
8056
|
-
"1280x720",
|
|
8057
|
-
"720x1440",
|
|
8058
|
-
"1440x720",
|
|
8059
|
-
"512x1536",
|
|
8060
|
-
"1536x512"
|
|
8076
|
+
var IDEOGRAM_45_ASPECT_RATIOS = [
|
|
8077
|
+
"auto",
|
|
8078
|
+
"source",
|
|
8079
|
+
"1:1",
|
|
8080
|
+
"16:9",
|
|
8081
|
+
"9:16",
|
|
8082
|
+
"4:3",
|
|
8083
|
+
"3:4",
|
|
8084
|
+
"3:2",
|
|
8085
|
+
"2:3",
|
|
8086
|
+
"5:4",
|
|
8087
|
+
"4:5",
|
|
8088
|
+
"8:5",
|
|
8089
|
+
"5:8",
|
|
8090
|
+
"2:1",
|
|
8091
|
+
"1:2",
|
|
8092
|
+
"3:1",
|
|
8093
|
+
"1:3"
|
|
8061
8094
|
];
|
|
8062
8095
|
var ideogram45MaskParam = p.file("mask", "image", {
|
|
8063
8096
|
label: "Mask",
|
|
@@ -8083,15 +8116,22 @@ var IDEOGRAM_45_COUNTS = [1, 2, 3, 4, 5, 6, 7, 8];
|
|
|
8083
8116
|
var IDEOGRAM_45_QUALITIES = ["very_low", "low", "medium", "high"];
|
|
8084
8117
|
var ideogram45Constraints = [
|
|
8085
8118
|
{ when: { imageUrls: { exists: false } }, then: {
|
|
8086
|
-
|
|
8119
|
+
aspectRatio: {
|
|
8120
|
+
allowed: IDEOGRAM_45_ASPECT_RATIOS.filter((ar) => ar !== "source"),
|
|
8121
|
+
reason: '"Source" keeps the size of a source image.'
|
|
8122
|
+
},
|
|
8087
8123
|
mask: { disabled: true, reason: "A mask needs a source image." },
|
|
8088
8124
|
quality: { allowed: ["low", "medium", "high"], reason: "Very low quality needs a source image." }
|
|
8089
8125
|
} },
|
|
8090
|
-
{ when: { imageUrls: { exists: true } }, then: {
|
|
8091
|
-
size: { allowed: ["auto", "source"], reason: 'With input images the size is "auto" or the source image size.' }
|
|
8092
|
-
} },
|
|
8093
8126
|
{ when: { mask: { exists: true } }, then: {
|
|
8094
|
-
|
|
8127
|
+
aspectRatio: { disabled: true, reason: "A masked edit keeps the source image size." },
|
|
8128
|
+
resolution: { disabled: true, reason: "A masked edit keeps the source image size." }
|
|
8129
|
+
} },
|
|
8130
|
+
{ when: { aspectRatio: { is: "auto" } }, then: {
|
|
8131
|
+
resolution: { disabled: true, reason: "Auto picks a 2K size." }
|
|
8132
|
+
} },
|
|
8133
|
+
{ when: { aspectRatio: { is: "source" } }, then: {
|
|
8134
|
+
resolution: { disabled: true, reason: "The output keeps the source image size." }
|
|
8095
8135
|
} }
|
|
8096
8136
|
];
|
|
8097
8137
|
var { MODELS: MODELS26 } = defineModels("ideogram", [
|
|
@@ -8112,7 +8152,8 @@ var { MODELS: MODELS26 } = defineModels("ideogram", [
|
|
|
8112
8152
|
// With a mask the vendor allows at most 4 images.
|
|
8113
8153
|
...params.imageInput(5, "Images", false, "reference", IDEOGRAM_45_IMAGE_BOUNDS),
|
|
8114
8154
|
...ideogram45MaskParam,
|
|
8115
|
-
...
|
|
8155
|
+
...params.aspectRatio(IDEOGRAM_45_ASPECT_RATIOS, "auto"),
|
|
8156
|
+
...params.resolution(["1K", "2K"], "2K"),
|
|
8116
8157
|
...ideogram45MagicPromptParam,
|
|
8117
8158
|
...p.quality(IDEOGRAM_45_QUALITIES, "high"),
|
|
8118
8159
|
...params.count(IDEOGRAM_45_COUNTS, 1),
|
|
@@ -8347,22 +8388,23 @@ function assertMaskedImageLimit(model, count, max, what) {
|
|
|
8347
8388
|
function invalid2(message) {
|
|
8348
8389
|
return new ApiError(message, { status: 400, code: "validation_error" });
|
|
8349
8390
|
}
|
|
8350
|
-
function
|
|
8351
|
-
|
|
8352
|
-
if (
|
|
8353
|
-
|
|
8391
|
+
function ideogram45Shape(input, hasImages, hasMask) {
|
|
8392
|
+
const aspectRatio = input.aspectRatio;
|
|
8393
|
+
if (!aspectRatio || hasMask) return {};
|
|
8394
|
+
if (aspectRatio === "source" && !hasImages) return {};
|
|
8395
|
+
if (aspectRatio === "auto" || aspectRatio === "source") return { aspect_ratio: aspectRatio };
|
|
8396
|
+
return { aspect_ratio: aspectRatio, ...input.resolution ? { resolution: input.resolution } : {} };
|
|
8354
8397
|
}
|
|
8355
8398
|
var buildIdeogram45Payload = (input) => {
|
|
8356
8399
|
const images = input.imageUrls?.length ? input.imageUrls : void 0;
|
|
8357
8400
|
const mask = images && input.mask ? input.mask : void 0;
|
|
8358
8401
|
if (mask) assertMaskedImageLimit("Ideogram 4.5", images.length, GENERATE_MAX_IMAGES_WITH_MASK, "images");
|
|
8359
|
-
const size = ideogram45Size(input.size, !!images, !!mask);
|
|
8360
8402
|
if (input.quality === "very_low" && !images) throw invalid2("Ideogram 4.5: very_low quality needs a source image.");
|
|
8361
8403
|
return {
|
|
8362
8404
|
prompt: input.prompt,
|
|
8363
8405
|
...images ? { images } : {},
|
|
8364
8406
|
...mask ? { mask } : {},
|
|
8365
|
-
...
|
|
8407
|
+
...ideogram45Shape(input, !!images, !!mask),
|
|
8366
8408
|
...input.magicPrompt ? { magic_prompt: input.magicPrompt } : {},
|
|
8367
8409
|
// Vendor default: medium with source images, high without.
|
|
8368
8410
|
quality: input.quality ?? (images ? "medium" : "high"),
|
|
@@ -13682,6 +13724,7 @@ var Seedream47 = "seedream-4.7";
|
|
|
13682
13724
|
var Seedream50Flash = "seedream-5.0-flash";
|
|
13683
13725
|
var Seedream50Lite = "seedream-5.0-lite";
|
|
13684
13726
|
var Seedream50Pro = "seedream-5.0-pro";
|
|
13727
|
+
var SpicyMayo = "spicy-mayo";
|
|
13685
13728
|
var TopazUpscaleImage = "topaz-upscale-image";
|
|
13686
13729
|
var TopazUpscaleVideo = "topaz-upscale-video";
|
|
13687
13730
|
var VeedFabricV1 = "veed-fabric-v1";
|
|
@@ -13940,6 +13983,7 @@ var Models = {
|
|
|
13940
13983
|
Seedream50Flash,
|
|
13941
13984
|
Seedream50Lite,
|
|
13942
13985
|
Seedream50Pro,
|
|
13986
|
+
SpicyMayo,
|
|
13943
13987
|
TopazUpscaleImage,
|
|
13944
13988
|
TopazUpscaleVideo,
|
|
13945
13989
|
VeedFabricV1,
|