@picsart/ai-sdk 5.8.0 → 5.9.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/_vendor/workflows-types/index.d.ts +1428 -1348
- package/index.d.ts +9 -0
- package/index.js +51 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -305,6 +305,14 @@ type ModelInputById = {
|
|
|
305
305
|
count?: 1 | 2 | 4;
|
|
306
306
|
imageUrls?: string[];
|
|
307
307
|
};
|
|
308
|
+
"grok-imagine-image-2.0": {
|
|
309
|
+
prompt: string;
|
|
310
|
+
aspectRatio?: "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "3:2" | "2:3" | "2:1" | "1:2" | "19.5:9" | "9:19.5" | "20:9" | "9:20";
|
|
311
|
+
resolution?: "1k" | "2k";
|
|
312
|
+
quality?: "low" | "medium";
|
|
313
|
+
count?: 1 | 2 | 4;
|
|
314
|
+
imageUrls?: string[];
|
|
315
|
+
};
|
|
308
316
|
"grok-imagine-image-quality": {
|
|
309
317
|
prompt: string;
|
|
310
318
|
aspectRatio?: "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "3:2" | "2:3" | "2:1" | "1:2" | "19.5:9" | "9:19.5" | "20:9" | "9:20";
|
|
@@ -2466,6 +2474,7 @@ declare const Models: {
|
|
|
2466
2474
|
readonly GrokEditVideo: "grok-edit-video";
|
|
2467
2475
|
readonly GrokExtendVideo: "grok-extend-video";
|
|
2468
2476
|
readonly GrokImagineImage: "grok-imagine-image";
|
|
2477
|
+
readonly GrokImagineImage20: "grok-imagine-image-2.0";
|
|
2469
2478
|
readonly GrokImagineImageQuality: "grok-imagine-image-quality";
|
|
2470
2479
|
readonly GrokImagineVideo: "grok-imagine-video";
|
|
2471
2480
|
readonly GrokImagineVideo15: "grok-imagine-video-1.5";
|
package/index.js
CHANGED
|
@@ -4890,6 +4890,28 @@ var { MODELS: MODELS17 } = defineModels("grok", [
|
|
|
4890
4890
|
...params.imageInput(1, "Source Image")
|
|
4891
4891
|
}
|
|
4892
4892
|
},
|
|
4893
|
+
{
|
|
4894
|
+
id: "grok-imagine-image-2.0",
|
|
4895
|
+
name: "Grok Imagine 2.0",
|
|
4896
|
+
addedAt: "2026-08-19",
|
|
4897
|
+
workflow: "x-ai/v1/images/generations",
|
|
4898
|
+
editWorkflow: "x-ai/v1/images/edits",
|
|
4899
|
+
estimatedTime: 16,
|
|
4900
|
+
mode: "image",
|
|
4901
|
+
inputType: "t2i",
|
|
4902
|
+
description: "Latest Grok Imagine generation \u2014 sharper detail with a low/medium quality tier.",
|
|
4903
|
+
features: [feat("Image Input", "input"), feat("2k", "resolution")],
|
|
4904
|
+
paramConfig: {
|
|
4905
|
+
...params.prompt(),
|
|
4906
|
+
...params.aspectRatio(GROK_IMAGE_AR, "1:1"),
|
|
4907
|
+
...params.resolution(GROK_IMAGE_RESOLUTIONS, "1k"),
|
|
4908
|
+
// Vendor-side default is medium; only supported by grok-imagine-image-2.0
|
|
4909
|
+
// (generations only — the edits command has no quality field).
|
|
4910
|
+
...p.quality(["low", "medium"], "medium"),
|
|
4911
|
+
...params.count([1, 2, 4]),
|
|
4912
|
+
...params.imageInput(1, "Source Image")
|
|
4913
|
+
}
|
|
4914
|
+
},
|
|
4893
4915
|
// ── Audio ─────────────────────────────────────────
|
|
4894
4916
|
{
|
|
4895
4917
|
id: "grok-tts",
|
|
@@ -4911,6 +4933,33 @@ var { MODELS: MODELS17 } = defineModels("grok", [
|
|
|
4911
4933
|
}
|
|
4912
4934
|
]);
|
|
4913
4935
|
|
|
4936
|
+
// src/vendors/catalog/grok.payloads.ts
|
|
4937
|
+
var buildGrokImage2Payload = (input) => ({
|
|
4938
|
+
model: "grok-imagine-image-2.0",
|
|
4939
|
+
prompt: input.prompt,
|
|
4940
|
+
n: input.count ?? 1,
|
|
4941
|
+
...input.aspectRatio ? { aspect_ratio: input.aspectRatio } : {},
|
|
4942
|
+
...input.resolution ? { resolution: input.resolution } : {},
|
|
4943
|
+
...input.quality ? { quality: input.quality } : {}
|
|
4944
|
+
});
|
|
4945
|
+
var buildGrokImage2EditPayload = (input) => {
|
|
4946
|
+
const urls = input.imageUrls ?? [];
|
|
4947
|
+
const imagePart2 = urls.length > 1 ? { images: urls.map((url) => ({ url })) } : urls.length === 1 ? { image: { url: urls[0] } } : {};
|
|
4948
|
+
return {
|
|
4949
|
+
model: "grok-imagine-image-2.0",
|
|
4950
|
+
prompt: input.prompt,
|
|
4951
|
+
n: input.count ?? 1,
|
|
4952
|
+
...input.resolution ? { resolution: input.resolution } : {},
|
|
4953
|
+
...imagePart2
|
|
4954
|
+
};
|
|
4955
|
+
};
|
|
4956
|
+
registerPayloads(MODELS17, {
|
|
4957
|
+
"grok-imagine-image-2.0": buildGrokImage2Payload
|
|
4958
|
+
});
|
|
4959
|
+
registerEditPayloads(MODELS17, {
|
|
4960
|
+
"grok-imagine-image-2.0": buildGrokImage2EditPayload
|
|
4961
|
+
});
|
|
4962
|
+
|
|
4914
4963
|
// src/vendors/catalog/pika.ts
|
|
4915
4964
|
var PIKA_RATIO_MAP = {
|
|
4916
4965
|
"16:9": 1.77,
|
|
@@ -10455,6 +10504,7 @@ var GptImage2 = "gpt-image-2";
|
|
|
10455
10504
|
var GrokEditVideo = "grok-edit-video";
|
|
10456
10505
|
var GrokExtendVideo = "grok-extend-video";
|
|
10457
10506
|
var GrokImagineImage = "grok-imagine-image";
|
|
10507
|
+
var GrokImagineImage20 = "grok-imagine-image-2.0";
|
|
10458
10508
|
var GrokImagineImageQuality = "grok-imagine-image-quality";
|
|
10459
10509
|
var GrokImagineVideo = "grok-imagine-video";
|
|
10460
10510
|
var GrokImagineVideo15 = "grok-imagine-video-1.5";
|
|
@@ -10663,6 +10713,7 @@ var Models = {
|
|
|
10663
10713
|
GrokEditVideo,
|
|
10664
10714
|
GrokExtendVideo,
|
|
10665
10715
|
GrokImagineImage,
|
|
10716
|
+
GrokImagineImage20,
|
|
10666
10717
|
GrokImagineImageQuality,
|
|
10667
10718
|
GrokImagineVideo,
|
|
10668
10719
|
GrokImagineVideo15,
|