@picsart/ai-sdk 6.22.1 → 6.24.1

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.
Files changed (3) hide show
  1. package/index.d.ts +11 -32
  2. package/index.js +59 -120
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -342,8 +342,8 @@ type ModelInputById = {
342
342
  };
343
343
  "flux-3-image": {
344
344
  prompt: string;
345
- aspectRatio?: "auto" | "21:9" | "2:1" | "16:9" | "3:2" | "7:5" | "4:3" | "5:4" | "1:1" | "4:5" | "3:4" | "5:7" | "2:3" | "9:16" | "1:2";
346
- resolution?: "512sq" | "768sq" | "1k" | "2k" | "4k";
345
+ aspectRatio?: "auto" | "21:9" | "2:1" | "16:9" | "3:2" | "7:5" | "4:3" | "5:4" | "1:1" | "4:5" | "3:4" | "5:7" | "2:3" | "9:16" | "9:21" | "1:2";
346
+ resolution?: "768sq" | "1k" | "1.5k" | "2k" | "4k";
347
347
  count?: 1 | 2 | 4 | 6 | 8 | 10;
348
348
  imageUrls?: string[];
349
349
  safetyTolerance?: number;
@@ -1073,19 +1073,6 @@ type ModelInputById = {
1073
1073
  startFrame?: string;
1074
1074
  endFrame?: string;
1075
1075
  };
1076
- "luma-ray-2": {
1077
- prompt: string;
1078
- aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "9:21";
1079
- resolution?: "540p" | "720p" | "1080p" | "4k";
1080
- duration?: 5 | 9;
1081
- startFrame?: string;
1082
- endFrame?: string;
1083
- };
1084
- "luma-ray-2-reframe-video": {
1085
- prompt?: string;
1086
- aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "9:21";
1087
- videoUrl: string;
1088
- };
1089
1076
  "luma-ray-3.2": {
1090
1077
  prompt: string;
1091
1078
  aspectRatio?: "9:16" | "3:4" | "1:1" | "4:3" | "16:9" | "21:9";
@@ -1112,19 +1099,6 @@ type ModelInputById = {
1112
1099
  videoUrl: string;
1113
1100
  resolution?: "540p" | "720p" | "1080p";
1114
1101
  };
1115
- "luma-ray-flash-2": {
1116
- prompt: string;
1117
- aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "9:21";
1118
- resolution?: "540p" | "720p" | "1080p" | "4k";
1119
- duration?: 5 | 9;
1120
- startFrame: string;
1121
- endFrame?: string;
1122
- };
1123
- "luma-ray-flash-2-reframe-video": {
1124
- prompt?: string;
1125
- aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "9:21";
1126
- videoUrl: string;
1127
- };
1128
1102
  "luma-uni-1": {
1129
1103
  prompt: string;
1130
1104
  aspectRatio?: "3:1" | "2:1" | "16:9" | "3:2" | "1:1" | "2:3" | "9:16" | "1:2" | "1:3";
@@ -1908,6 +1882,14 @@ type ModelInputById = {
1908
1882
  imageUrls?: string[];
1909
1883
  negativePrompt?: string;
1910
1884
  };
1885
+ "spicy-mayo": {
1886
+ prompt: string;
1887
+ aspectRatio?: "1:1" | "16:9" | "9:16" | "3:4" | "4:3" | "2:3" | "21:9" | "auto";
1888
+ count?: 1 | 2 | 4 | 6 | 8 | 10;
1889
+ seed?: number;
1890
+ thinkingLevel?: "minimal" | "medium" | "high";
1891
+ imageUrls?: string[];
1892
+ };
1911
1893
  "topaz-upscale-image": {
1912
1894
  imageUrls: [string, ...string[]];
1913
1895
  model?: "Standard V2" | "Standard MAX" | "Low Resolution V2" | "High Fidelity V2" | "CGI" | "Text Refine" | "Redefine" | "Recovery" | "Recovery V2" | "Wonder" | "Wonder 3";
@@ -3415,13 +3397,9 @@ declare const Models: {
3415
3397
  readonly LtxV23Retake: "ltx-v2.3-retake";
3416
3398
  readonly LtxV25Fast: "ltx-v2.5-fast";
3417
3399
  readonly LtxV25Pro: "ltx-v2.5-pro";
3418
- readonly LumaRay2: "luma-ray-2";
3419
- readonly LumaRay2ReframeVideo: "luma-ray-2-reframe-video";
3420
3400
  readonly LumaRay32: "luma-ray-3.2";
3421
3401
  readonly LumaRay32Edit: "luma-ray-3.2-edit";
3422
3402
  readonly LumaRay32ReframeVideo: "luma-ray-3.2-reframe-video";
3423
- readonly LumaRayFlash2: "luma-ray-flash-2";
3424
- readonly LumaRayFlash2ReframeVideo: "luma-ray-flash-2-reframe-video";
3425
3403
  readonly LumaUni1: "luma-uni-1";
3426
3404
  readonly LumaUni1Max: "luma-uni-1-max";
3427
3405
  readonly Lyria3Clip: "lyria-3-clip";
@@ -3524,6 +3502,7 @@ declare const Models: {
3524
3502
  readonly Seedream50Flash: "seedream-5.0-flash";
3525
3503
  readonly Seedream50Lite: "seedream-5.0-lite";
3526
3504
  readonly Seedream50Pro: "seedream-5.0-pro";
3505
+ readonly SpicyMayo: "spicy-mayo";
3527
3506
  readonly TopazUpscaleImage: "topaz-upscale-image";
3528
3507
  readonly TopazUpscaleVideo: "topaz-upscale-video";
3529
3508
  readonly VeedFabricV1: "veed-fabric-v1";
package/index.js CHANGED
@@ -3881,52 +3881,7 @@ registerPayloads(MODELS11, {
3881
3881
  });
3882
3882
 
3883
3883
  // src/vendors/catalog/luma.ts
3884
- var buildLumaRay2Payload = (ctx) => {
3885
- const keyframes = {};
3886
- if (ctx.startFrame) keyframes.frame0 = { type: "image", url: ctx.startFrame };
3887
- if (ctx.endFrame) keyframes.frame1 = { type: "image", url: ctx.endFrame };
3888
- return {
3889
- prompt: ctx.prompt,
3890
- model: "ray-2",
3891
- ...Object.keys(keyframes).length ? { keyframes } : {},
3892
- aspect_ratio: ctx.aspectRatio ?? "16:9",
3893
- resolution: ctx.resolution ?? "720p",
3894
- duration: `${ctx.duration ?? 5}s`
3895
- };
3896
- };
3897
- var buildLumaFlash2I2VPayload = (ctx) => {
3898
- const keyframes = {};
3899
- if (ctx.startFrame) keyframes.frame0 = { type: "image", url: ctx.startFrame };
3900
- if (ctx.endFrame) keyframes.frame1 = { type: "image", url: ctx.endFrame };
3901
- return {
3902
- prompt: ctx.prompt,
3903
- model: "ray-flash-2",
3904
- ...Object.keys(keyframes).length ? { keyframes } : {},
3905
- aspect_ratio: ctx.aspectRatio ?? "16:9",
3906
- resolution: ctx.resolution ?? "720p",
3907
- duration: `${ctx.duration ?? 5}s`
3908
- };
3909
- };
3910
- var WORKFLOW = "luma-image-to-video-generation";
3911
- var REFRAME_WORKFLOW = "luma-media-reframe";
3912
- var makeReframeVideoPayload = (model) => (ctx) => ({
3913
- generation_type: "reframe_video",
3914
- model,
3915
- media: { url: ctx.videoUrl ?? "" },
3916
- aspect_ratio: ctx.aspectRatio ?? "16:9",
3917
- ...ctx.prompt ? { prompt: ctx.prompt } : {}
3918
- });
3919
- var buildLumaRay2ReframeVideoPayload = makeReframeVideoPayload("ray-2");
3920
- var buildLumaRayFlash2ReframeVideoPayload = makeReframeVideoPayload("ray-flash-2");
3921
- var LUMA_AR = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21"];
3922
- var LUMA_RESOLUTIONS = ["540p", "720p", "1080p", "4k"];
3923
3884
  var LUMA_PROMPT_MAX = 5e3;
3924
- var lumaParamConfig = {
3925
- ...params.prompt({ maxLength: LUMA_PROMPT_MAX }),
3926
- ...params.aspectRatio(LUMA_AR),
3927
- ...params.resolution(LUMA_RESOLUTIONS, "720p"),
3928
- ...params.duration([5, 9], 5)
3929
- };
3930
3885
  var LUMA_UNI1_AR = ["3:1", "2:1", "16:9", "3:2", "1:1", "2:3", "9:16", "1:2", "1:3"];
3931
3886
  var LUMA_UNI1_STYLES = [
3932
3887
  { id: "auto", label: "Auto" },
@@ -4025,71 +3980,6 @@ var ray32EditConstraints = [
4025
3980
  } }
4026
3981
  ];
4027
3982
  var { MODELS: MODELS12 } = defineModels("luma", [
4028
- {
4029
- id: "luma-ray-2",
4030
- name: "Luma Ray 2",
4031
- addedAt: "2026-02-06",
4032
- workflow: WORKFLOW,
4033
- editWorkflow: WORKFLOW,
4034
- buildPayload: buildLumaRay2Payload,
4035
- estimatedTime: 18,
4036
- editEstimatedTime: 24,
4037
- mode: "video",
4038
- inputType: "t2v",
4039
- description: "Smooth video with a dreamy, polished aesthetic \u2014 up to 4K resolution.",
4040
- features: [feat("Image Input", "input"), feat("Start/End Frame", "frame"), feat("Up to 4K", "resolution"), feat("5/9 sec", "duration")],
4041
- paramConfig: { ...lumaParamConfig, ...params.startFrame(), ...params.endFrame() }
4042
- },
4043
- {
4044
- id: "luma-ray-flash-2",
4045
- name: "Luma Flash 2",
4046
- addedAt: "2026-02-06",
4047
- workflow: WORKFLOW,
4048
- buildPayload: buildLumaFlash2I2VPayload,
4049
- estimatedTime: 9,
4050
- mode: "video",
4051
- inputType: "i2v",
4052
- description: "Quick image-to-video with smooth, stylized motion \u2014 up to 4K.",
4053
- features: [feat("Image Input", "input"), feat("Start/End Frame", "frame"), feat("Up to 4K", "resolution"), feat("5/9 sec", "duration")],
4054
- paramConfig: { ...lumaParamConfig, ...params.startFrame("Start Frame", true), ...params.endFrame() }
4055
- },
4056
- // ── Reframe video (ray-2 + ray-flash-2; image reframe not supported) ──
4057
- {
4058
- id: "luma-ray-2-reframe-video",
4059
- name: "Luma Ray 2 Reframe",
4060
- modelId: "luma-ray-2",
4061
- addedAt: "2026-05-21",
4062
- workflow: REFRAME_WORKFLOW,
4063
- buildPayload: buildLumaRay2ReframeVideoPayload,
4064
- estimatedTime: 20,
4065
- mode: "video",
4066
- inputType: "v2v",
4067
- description: "Reframe a video to a new aspect ratio using Luma Ray 2.",
4068
- features: [feat("Video Input", "input"), feat("Reframe", "characteristic")],
4069
- paramConfig: {
4070
- ...params.prompt({ required: false, maxLength: LUMA_PROMPT_MAX }),
4071
- ...params.aspectRatio(LUMA_AR, "16:9"),
4072
- ...params.videoInput("Source Video")
4073
- }
4074
- },
4075
- {
4076
- id: "luma-ray-flash-2-reframe-video",
4077
- name: "Luma Flash 2 Reframe",
4078
- modelId: "luma-ray-flash-2",
4079
- addedAt: "2026-05-21",
4080
- workflow: REFRAME_WORKFLOW,
4081
- buildPayload: buildLumaRayFlash2ReframeVideoPayload,
4082
- estimatedTime: 12,
4083
- mode: "video",
4084
- inputType: "v2v",
4085
- description: "Reframe a video to a new aspect ratio using Luma Flash 2.",
4086
- features: [feat("Video Input", "input"), feat("Reframe", "characteristic")],
4087
- paramConfig: {
4088
- ...params.prompt({ required: false, maxLength: LUMA_PROMPT_MAX }),
4089
- ...params.aspectRatio(LUMA_AR, "16:9"),
4090
- ...params.videoInput("Source Video")
4091
- }
4092
- },
4093
3983
  {
4094
3984
  id: "luma-uni-1",
4095
3985
  name: "Luma UNI-1",
@@ -6231,9 +6121,10 @@ var flux3ImageAspectRatios = [
6231
6121
  "5:7",
6232
6122
  "2:3",
6233
6123
  "9:16",
6124
+ "9:21",
6234
6125
  "1:2"
6235
6126
  ];
6236
- var flux3ImageResolutions = ["512sq", "768sq", "1k", "2k", "4k"];
6127
+ var flux3ImageResolutions = ["768sq", "1k", "1.5k", "2k", "4k"];
6237
6128
  var buildFluxV2Payload = (modelId) => (ctx) => ({
6238
6129
  prompt: ctx.prompt,
6239
6130
  model: modelId,
@@ -6402,7 +6293,7 @@ var { MODELS: MODELS21 } = defineModels("flux", [
6402
6293
  // count (up to 10) samples further into the tail. Stage has seen 4+ minutes,
6403
6294
  // and one 512sq run took 287s. Over-estimating only makes the bar finish
6404
6295
  // early; under-estimating parks it at 99%.
6405
- estimatedTime: { "512sq": 90, "768sq": 110, "1k": 150, "2k": 240, "4k": 360 },
6296
+ estimatedTime: { "768sq": 110, "1k": 150, "1.5k": 195, "2k": 240, "4k": 360 },
6406
6297
  description: "Generate and edit images with up to 10 references \u2014 multi-reference composition, precise local edits and text rendering, natively up to 4K.",
6407
6298
  features: [
6408
6299
  feat("Multi-Image Input", "input"),
@@ -6583,6 +6474,16 @@ var buildGemini31FlashLiteImagePayload = (ctx) => ({
6583
6474
  imageSize: ctx.resolution ?? "1K",
6584
6475
  ...buildThinkingConfig(ctx)
6585
6476
  });
6477
+ var buildSpicyMayoPayload = (ctx) => ({
6478
+ prompt: ctx.prompt,
6479
+ model: "spicy-mayo",
6480
+ count: ctx.count ?? 1,
6481
+ ...ctx.seed != null ? { seed: ctx.seed } : {},
6482
+ ...ctx.imageUrls?.length ? { imageUrls: ctx.imageUrls } : {},
6483
+ aspectRatio: ctx.aspectRatio ?? "1:1",
6484
+ imageSize: "1K",
6485
+ ...buildThinkingConfig(ctx)
6486
+ });
6586
6487
  function inferMimeType2(url) {
6587
6488
  return url.match(/\.png(\?|$)/i) ? "image/png" : "image/jpeg";
6588
6489
  }
@@ -6661,8 +6562,52 @@ var thinkingBudgetParam = {
6661
6562
  descriptor: { kind: "range", min: 128, max: 24576, step: 128, default: 128 }
6662
6563
  }
6663
6564
  };
6565
+ var spicyMayoThinkingParam = {
6566
+ thinkingLevel: {
6567
+ label: "Thinking",
6568
+ descriptor: {
6569
+ kind: "enum",
6570
+ valueType: "string",
6571
+ options: [
6572
+ { id: "minimal", label: "Minimal (faster)" },
6573
+ { id: "medium", label: "Medium (balanced)" },
6574
+ { id: "high", label: "High (more reasoning)" }
6575
+ ],
6576
+ default: "minimal"
6577
+ }
6578
+ }
6579
+ };
6664
6580
  var { MODELS: MODELS22 } = defineModels("google", [
6665
6581
  // ── Image ─────────────────────────────────────────────────────────
6582
+ {
6583
+ id: "spicy-mayo",
6584
+ name: "Spicy Mayo",
6585
+ addedAt: "2026-10-02",
6586
+ // Confidential early access at the vendor, authorized for named projects
6587
+ // only — stage until the co-launch clears it for prod.
6588
+ release: "preview",
6589
+ workflow: "gemini/v2/images",
6590
+ buildPayload: buildSpicyMayoPayload,
6591
+ // Measured end-to-end against stage at 1K/1:1: 9s to generate, 13s to edit
6592
+ // with two reference images. Rounded up — vendor testing capacity is capped.
6593
+ estimatedTime: 15,
6594
+ mode: "image",
6595
+ inputType: "t2i",
6596
+ modelId: "spicy-mayo",
6597
+ badge: ["fast"],
6598
+ description: "Fast Google image generation and editing with multi-image references.",
6599
+ // Only the 1K tier is priced, so no `resolution` param: the builder pins
6600
+ // imageSize and anything else is a 400 from the worker.
6601
+ features: [feat("Multi-Image Input", "input"), feat("1K", "resolution")],
6602
+ paramConfig: {
6603
+ ...params.prompt(),
6604
+ ...params.aspectRatio([...GEMINI_AR_WIDE], "1:1"),
6605
+ ...params.count(),
6606
+ ...params.seed(),
6607
+ ...spicyMayoThinkingParam,
6608
+ ...params.imageInput(14, "Source Images")
6609
+ }
6610
+ },
6666
6611
  {
6667
6612
  id: "gemini-3.1-flash-image",
6668
6613
  addedAt: "2026-02-26",
@@ -13561,13 +13506,9 @@ var LtxV23Reframe = "ltx-v2.3-reframe";
13561
13506
  var LtxV23Retake = "ltx-v2.3-retake";
13562
13507
  var LtxV25Fast = "ltx-v2.5-fast";
13563
13508
  var LtxV25Pro = "ltx-v2.5-pro";
13564
- var LumaRay2 = "luma-ray-2";
13565
- var LumaRay2ReframeVideo = "luma-ray-2-reframe-video";
13566
13509
  var LumaRay32 = "luma-ray-3.2";
13567
13510
  var LumaRay32Edit = "luma-ray-3.2-edit";
13568
13511
  var LumaRay32ReframeVideo = "luma-ray-3.2-reframe-video";
13569
- var LumaRayFlash2 = "luma-ray-flash-2";
13570
- var LumaRayFlash2ReframeVideo = "luma-ray-flash-2-reframe-video";
13571
13512
  var LumaUni1 = "luma-uni-1";
13572
13513
  var LumaUni1Max = "luma-uni-1-max";
13573
13514
  var Lyria3Clip = "lyria-3-clip";
@@ -13670,6 +13611,7 @@ var Seedream47 = "seedream-4.7";
13670
13611
  var Seedream50Flash = "seedream-5.0-flash";
13671
13612
  var Seedream50Lite = "seedream-5.0-lite";
13672
13613
  var Seedream50Pro = "seedream-5.0-pro";
13614
+ var SpicyMayo = "spicy-mayo";
13673
13615
  var TopazUpscaleImage = "topaz-upscale-image";
13674
13616
  var TopazUpscaleVideo = "topaz-upscale-video";
13675
13617
  var VeedFabricV1 = "veed-fabric-v1";
@@ -13819,13 +13761,9 @@ var Models = {
13819
13761
  LtxV23Retake,
13820
13762
  LtxV25Fast,
13821
13763
  LtxV25Pro,
13822
- LumaRay2,
13823
- LumaRay2ReframeVideo,
13824
13764
  LumaRay32,
13825
13765
  LumaRay32Edit,
13826
13766
  LumaRay32ReframeVideo,
13827
- LumaRayFlash2,
13828
- LumaRayFlash2ReframeVideo,
13829
13767
  LumaUni1,
13830
13768
  LumaUni1Max,
13831
13769
  Lyria3Clip,
@@ -13928,6 +13866,7 @@ var Models = {
13928
13866
  Seedream50Flash,
13929
13867
  Seedream50Lite,
13930
13868
  Seedream50Pro,
13869
+ SpicyMayo,
13931
13870
  TopazUpscaleImage,
13932
13871
  TopazUpscaleVideo,
13933
13872
  VeedFabricV1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "6.22.1",
3
+ "version": "6.24.1",
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",