@picsart/ai-sdk 5.8.0 → 5.10.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 CHANGED
@@ -251,6 +251,11 @@ type ModelInputById = {
251
251
  imageUrls?: string[];
252
252
  thinking?: "off" | "low" | "medium" | "high";
253
253
  };
254
+ "gemini-3.7-flash": {
255
+ prompt: string;
256
+ imageUrls?: string[];
257
+ thinking?: "off" | "low" | "medium" | "high";
258
+ };
254
259
  "gemini-omni-flash-preview": {
255
260
  prompt: string;
256
261
  aspectRatio?: "16:9" | "9:16";
@@ -305,6 +310,14 @@ type ModelInputById = {
305
310
  count?: 1 | 2 | 4;
306
311
  imageUrls?: string[];
307
312
  };
313
+ "grok-imagine-image-2.0": {
314
+ prompt: string;
315
+ 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";
316
+ resolution?: "1k" | "2k";
317
+ quality?: "low" | "medium";
318
+ count?: 1 | 2 | 4;
319
+ imageUrls?: string[];
320
+ };
308
321
  "grok-imagine-image-quality": {
309
322
  prompt: string;
310
323
  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";
@@ -1515,7 +1528,7 @@ type ModelInputById = {
1515
1528
  type TypedModelId = keyof ModelInputById;
1516
1529
  type ModelInput<M extends TypedModelId> = ModelInputById[M];
1517
1530
  /** IDs of text-generation (LLM) models — narrows generateText(). */
1518
- type TextModelId = "claude-haiku-4-5" | "claude-opus-4-8" | "claude-sonnet-4-6" | "gemini-3-pro" | "gemini-3.5-flash-lite" | "gemini-3.6-flash" | "gpt-5.5";
1531
+ type TextModelId = "claude-haiku-4-5" | "claude-opus-4-8" | "claude-sonnet-4-6" | "gemini-3-pro" | "gemini-3.5-flash-lite" | "gemini-3.6-flash" | "gemini-3.7-flash" | "gpt-5.5";
1519
1532
  type TextModelInputById = Pick<ModelInputById, TextModelId>;
1520
1533
 
1521
1534
  /**
@@ -2458,6 +2471,7 @@ declare const Models: {
2458
2471
  readonly Gemini31FlashLiteImage: "gemini-3.1-flash-lite-image";
2459
2472
  readonly Gemini35FlashLite: "gemini-3.5-flash-lite";
2460
2473
  readonly Gemini36Flash: "gemini-3.6-flash";
2474
+ readonly Gemini37Flash: "gemini-3.7-flash";
2461
2475
  readonly GeminiOmniFlashPreview: "gemini-omni-flash-preview";
2462
2476
  readonly Gpt55: "gpt-5.5";
2463
2477
  readonly GptImage1: "gpt-image-1";
@@ -2466,6 +2480,7 @@ declare const Models: {
2466
2480
  readonly GrokEditVideo: "grok-edit-video";
2467
2481
  readonly GrokExtendVideo: "grok-extend-video";
2468
2482
  readonly GrokImagineImage: "grok-imagine-image";
2483
+ readonly GrokImagineImage20: "grok-imagine-image-2.0";
2469
2484
  readonly GrokImagineImageQuality: "grok-imagine-image-quality";
2470
2485
  readonly GrokImagineVideo: "grok-imagine-video";
2471
2486
  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,
@@ -8215,6 +8264,23 @@ var { MODELS: GEMINI_LLM } = defineModels("google", [
8215
8264
  ...thinkingParam(["low", "high"])
8216
8265
  }
8217
8266
  },
8267
+ {
8268
+ id: "gemini-3.7-flash",
8269
+ name: "Gemini 3.7 Flash",
8270
+ workflow: "chat-completions",
8271
+ addedAt: "2026-08-19",
8272
+ estimatedTime: 5,
8273
+ mode: "text",
8274
+ inputType: "i2t",
8275
+ badge: ["fast"],
8276
+ description: "Latest fast Gemini model \u2014 low-latency multimodal text generation.",
8277
+ features: [feat("Vision", "input"), feat("Thinking", "characteristic")],
8278
+ paramConfig: {
8279
+ ...params.prompt(),
8280
+ ...params.imageInput(8, "Images"),
8281
+ ...thinkingParam(["low", "medium", "high"])
8282
+ }
8283
+ },
8218
8284
  {
8219
8285
  id: "gemini-3.6-flash",
8220
8286
  name: "Gemini 3.6 Flash",
@@ -8308,6 +8374,7 @@ registerPayloads(MODELS36, {
8308
8374
  "gemini-3-pro": buildGeminiPayload("gemini-3-pro-preview"),
8309
8375
  // Flash models route through chat-completions (OpenAI-shaped), not the
8310
8376
  // native `gemini` workflow. flash-lite has no thinking param → reasoning_effort omitted.
8377
+ "gemini-3.7-flash": buildOpenAiPayload("gemini-3.7-flash"),
8311
8378
  "gemini-3.6-flash": buildOpenAiPayload("gemini-3.6-flash"),
8312
8379
  "gemini-3.5-flash-lite": buildOpenAiPayload("gemini-3.5-flash-lite")
8313
8380
  });
@@ -10447,6 +10514,7 @@ var Gemini31FlashImage = "gemini-3.1-flash-image";
10447
10514
  var Gemini31FlashLiteImage = "gemini-3.1-flash-lite-image";
10448
10515
  var Gemini35FlashLite = "gemini-3.5-flash-lite";
10449
10516
  var Gemini36Flash = "gemini-3.6-flash";
10517
+ var Gemini37Flash = "gemini-3.7-flash";
10450
10518
  var GeminiOmniFlashPreview = "gemini-omni-flash-preview";
10451
10519
  var Gpt55 = "gpt-5.5";
10452
10520
  var GptImage1 = "gpt-image-1";
@@ -10455,6 +10523,7 @@ var GptImage2 = "gpt-image-2";
10455
10523
  var GrokEditVideo = "grok-edit-video";
10456
10524
  var GrokExtendVideo = "grok-extend-video";
10457
10525
  var GrokImagineImage = "grok-imagine-image";
10526
+ var GrokImagineImage20 = "grok-imagine-image-2.0";
10458
10527
  var GrokImagineImageQuality = "grok-imagine-image-quality";
10459
10528
  var GrokImagineVideo = "grok-imagine-video";
10460
10529
  var GrokImagineVideo15 = "grok-imagine-video-1.5";
@@ -10655,6 +10724,7 @@ var Models = {
10655
10724
  Gemini31FlashLiteImage,
10656
10725
  Gemini35FlashLite,
10657
10726
  Gemini36Flash,
10727
+ Gemini37Flash,
10658
10728
  GeminiOmniFlashPreview,
10659
10729
  Gpt55,
10660
10730
  GptImage1,
@@ -10663,6 +10733,7 @@ var Models = {
10663
10733
  GrokEditVideo,
10664
10734
  GrokExtendVideo,
10665
10735
  GrokImagineImage,
10736
+ GrokImagineImage20,
10666
10737
  GrokImagineImageQuality,
10667
10738
  GrokImagineVideo,
10668
10739
  GrokImagineVideo15,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "5.8.0",
3
+ "version": "5.10.0",
4
4
  "type": "module",
5
5
  "description": "Type-safe SDK for 100+ AI models — image, video, audio, and text generation with Picsart",
6
6
  "license": "MIT",