@picsart/ai-sdk 5.31.0 → 5.33.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
@@ -241,6 +241,11 @@ type ModelInputById = {
241
241
  count?: 1 | 2 | 4 | 6 | 8 | 10;
242
242
  imageUrls?: string[];
243
243
  };
244
+ "flux-video-edit": {
245
+ videoUrl: string;
246
+ prompt: string;
247
+ safetyTolerance?: number;
248
+ };
244
249
  "flux-video-upscale": {
245
250
  videoUrl: string;
246
251
  upscaleFactor?: number;
@@ -383,6 +388,24 @@ type ModelInputById = {
383
388
  count?: 1 | 2 | 4 | 6 | 8 | 10;
384
389
  imageUrls?: string[];
385
390
  };
391
+ "gpt-image-2.5-flare": {
392
+ prompt: string;
393
+ aspectRatio?: "1:1" | "3:2" | "2:3" | "16:9" | "9:16" | "4:3" | "3:4" | "auto";
394
+ quality?: "max" | "xhigh" | "high" | "medium" | "low";
395
+ background?: "opaque" | "transparent";
396
+ outputFormat?: "png" | "jpeg" | "webp";
397
+ count?: 1 | 2 | 4 | 6 | 8 | 10;
398
+ imageUrls?: string[];
399
+ };
400
+ "gpt-image-2.5-sunburst": {
401
+ prompt: string;
402
+ aspectRatio?: "1:1" | "3:2" | "2:3" | "16:9" | "9:16" | "4:3" | "3:4" | "auto";
403
+ quality?: "max" | "xhigh" | "high" | "medium" | "low";
404
+ background?: "opaque" | "transparent";
405
+ outputFormat?: "png" | "jpeg" | "webp";
406
+ count?: 1 | 2 | 4 | 6 | 8 | 10;
407
+ imageUrls?: string[];
408
+ };
386
409
  "grok-edit-video": {
387
410
  prompt: string;
388
411
  videoUrl: string;
@@ -2664,6 +2687,7 @@ declare const Models: {
2664
2687
  readonly Flux3Video: "flux-3-video";
2665
2688
  readonly FluxKontextMax: "flux-kontext-max";
2666
2689
  readonly FluxKontextPro: "flux-kontext-pro";
2690
+ readonly FluxVideoEdit: "flux-video-edit";
2667
2691
  readonly FluxVideoUpscale: "flux-video-upscale";
2668
2692
  readonly Gemini25FlashImage: "gemini-2.5-flash-image";
2669
2693
  readonly Gemini25FlashTts: "gemini-2.5-flash-tts";
@@ -2686,6 +2710,8 @@ declare const Models: {
2686
2710
  readonly GptImage1: "gpt-image-1";
2687
2711
  readonly GptImage15: "gpt-image-1.5";
2688
2712
  readonly GptImage2: "gpt-image-2";
2713
+ readonly GptImage25Flare: "gpt-image-2.5-flare";
2714
+ readonly GptImage25Sunburst: "gpt-image-2.5-sunburst";
2689
2715
  readonly GrokEditVideo: "grok-edit-video";
2690
2716
  readonly GrokExtendVideo: "grok-extend-video";
2691
2717
  readonly GrokImagineImage: "grok-imagine-image";
package/index.js CHANGED
@@ -5775,6 +5775,32 @@ var { MODELS: MODELS21 } = defineModels("flux", [
5775
5775
  // Moderation level: 0 (strict) … 4 (permissive).
5776
5776
  ...p.range("safetyTolerance", 0, 4, 2, { label: "Safety Tolerance" })
5777
5777
  }
5778
+ },
5779
+ {
5780
+ // Pure pass-through like flux-video-upscale: the worker Command takes the
5781
+ // SDK's own field names (videoUrl, prompt, safetyTolerance) — no payload
5782
+ // builder needed.
5783
+ id: "flux-video-edit",
5784
+ name: "Sprout Video Edit",
5785
+ workflow: "flux/v1/video-edit",
5786
+ mode: "video",
5787
+ inputType: "v2v",
5788
+ addedAt: "2026-09-09",
5789
+ estimatedTime: 180,
5790
+ description: "Edit videos with a text instruction \u2014 change objects, styles or scenes while preserving motion, timing and audio. Source clips up to 15 seconds; output at 24 fps, up to 720p.",
5791
+ features: [
5792
+ feat("Video Required", "input"),
5793
+ feat("Up to 15s", "duration"),
5794
+ feat("720p", "resolution")
5795
+ ],
5796
+ paramConfig: {
5797
+ // Vendor source caps: 15s, 50 MB. Also ≥160 px per side and ≥17 frames —
5798
+ // minimums the upload check can't express; the vendor rejects violations.
5799
+ ...params.videoInput("Source Video", "asset", true, 15, void 0, 50 * 1024 * 1024),
5800
+ ...params.prompt({ maxLength: 4096 }),
5801
+ // Moderation level: 0 (strict) … 4 (permissive).
5802
+ ...p.range("safetyTolerance", 0, 4, 2, { label: "Safety Tolerance" })
5803
+ }
5778
5804
  }
5779
5805
  ]);
5780
5806
 
@@ -6163,6 +6189,9 @@ var buildGptImage2EditPayload = (ctx) => ({
6163
6189
  ...ctx.outputFormat ? { output_format: ctx.outputFormat } : {}
6164
6190
  });
6165
6191
  var GPT_IMAGE_PROMPT_MAX = 32e3;
6192
+ var GPT_IMAGE_25_QUALITIES = ["max", "xhigh", "high", "medium", "low"];
6193
+ var GPT_IMAGE_25_ASPECT_RATIOS = ["1:1", "3:2", "2:3", "16:9", "9:16", "4:3", "3:4", "auto"];
6194
+ var GPT_IMAGE_25_MAX_INPUT_IMAGES = 16;
6166
6195
  var gptImage2Constraints = [
6167
6196
  {
6168
6197
  when: { imageUrls: { exists: true } },
@@ -6181,6 +6210,50 @@ var gptImageBgConstraints = [
6181
6210
  ];
6182
6211
  var { MODELS: MODELS23 } = defineModels("openai", [
6183
6212
  // ── Image ─────────────────────────────────────────
6213
+ {
6214
+ id: "gpt-image-2.5-sunburst",
6215
+ name: "GPT Image 2.5 Sunburst",
6216
+ addedAt: "2026-09-09",
6217
+ workflow: "openai-images-generate",
6218
+ editWorkflow: "openai-image-editing",
6219
+ estimatedTime: 60,
6220
+ mode: "image",
6221
+ inputType: "t2i",
6222
+ description: "Most capable GPT Image tier \u2014 premium edits and campaign-grade output, with longer generation times.",
6223
+ features: [feat("Multi-Image Input", "input"), feat("High Quality", "quality")],
6224
+ paramConfig: {
6225
+ ...params.prompt({ maxLength: GPT_IMAGE_PROMPT_MAX }),
6226
+ ...params.aspectRatio(GPT_IMAGE_25_ASPECT_RATIOS, "1:1"),
6227
+ ...p.quality(GPT_IMAGE_25_QUALITIES, "high"),
6228
+ ...p.enum("background", ["opaque", "transparent"], "opaque", { label: "Background" }),
6229
+ ...p.enum("outputFormat", ["png", "jpeg", "webp"], "png", { label: "Format" }),
6230
+ ...params.count(),
6231
+ ...params.imageInput(GPT_IMAGE_25_MAX_INPUT_IMAGES, "Source Images")
6232
+ },
6233
+ constraints: gptImageBgConstraints
6234
+ },
6235
+ {
6236
+ id: "gpt-image-2.5-flare",
6237
+ name: "GPT Image 2.5 Flare",
6238
+ addedAt: "2026-09-09",
6239
+ workflow: "openai-images-generate",
6240
+ editWorkflow: "openai-image-editing",
6241
+ estimatedTime: 25,
6242
+ mode: "image",
6243
+ inputType: "t2i",
6244
+ description: "Fast GPT Image tier \u2014 everyday generation at roughly half the latency of GPT Image 2.",
6245
+ features: [feat("Multi-Image Input", "input"), feat("Fast", "characteristic")],
6246
+ paramConfig: {
6247
+ ...params.prompt({ maxLength: GPT_IMAGE_PROMPT_MAX }),
6248
+ ...params.aspectRatio(GPT_IMAGE_25_ASPECT_RATIOS, "1:1"),
6249
+ ...p.quality(GPT_IMAGE_25_QUALITIES, "high"),
6250
+ ...p.enum("background", ["opaque", "transparent"], "opaque", { label: "Background" }),
6251
+ ...p.enum("outputFormat", ["png", "jpeg", "webp"], "png", { label: "Format" }),
6252
+ ...params.count(),
6253
+ ...params.imageInput(GPT_IMAGE_25_MAX_INPUT_IMAGES, "Source Images")
6254
+ },
6255
+ constraints: gptImageBgConstraints
6256
+ },
6184
6257
  {
6185
6258
  id: "gpt-image-2",
6186
6259
  name: "GPT Image 2",
@@ -6261,6 +6334,36 @@ var { MODELS: MODELS23 } = defineModels("openai", [
6261
6334
  }
6262
6335
  ]);
6263
6336
 
6337
+ // src/vendors/catalog/openai.payloads.ts
6338
+ var resolveSize = (aspectRatio, fallback) => aspectRatio === "auto" ? "auto" : GPT_IMAGE_2_AR_TO_SIZE[aspectRatio ?? ""] ?? fallback;
6339
+ var generateFor = (model) => (input) => ({
6340
+ prompt: input.prompt,
6341
+ model,
6342
+ n: input.count ?? 1,
6343
+ size: resolveSize(input.aspectRatio, "1024x1024"),
6344
+ quality: input.quality ?? "high",
6345
+ ...input.background ? { background: input.background } : {},
6346
+ ...input.outputFormat ? { output_format: input.outputFormat } : {}
6347
+ });
6348
+ var editFor = (model) => (input) => ({
6349
+ prompt: input.prompt,
6350
+ model,
6351
+ images: input.imageUrls ?? [],
6352
+ n: input.count ?? 1,
6353
+ size: resolveSize(input.aspectRatio, "auto"),
6354
+ quality: input.quality ?? "high",
6355
+ ...input.background ? { background: input.background } : {},
6356
+ ...input.outputFormat ? { output_format: input.outputFormat } : {}
6357
+ });
6358
+ registerPayloads(MODELS23, {
6359
+ "gpt-image-2.5-flare": generateFor("gpt-image-2.5-flare"),
6360
+ "gpt-image-2.5-sunburst": generateFor("gpt-image-2.5-sunburst")
6361
+ });
6362
+ registerEditPayloads(MODELS23, {
6363
+ "gpt-image-2.5-flare": editFor("gpt-image-2.5-flare"),
6364
+ "gpt-image-2.5-sunburst": editFor("gpt-image-2.5-sunburst")
6365
+ });
6366
+
6264
6367
  // src/vendors/catalog/elevenlabs.ts
6265
6368
  var buildElevenLabsTTSPayload = (modelId) => (ctx) => ({
6266
6369
  text: ctx.prompt,
@@ -11369,6 +11472,7 @@ var Flux2Pro = "flux-2-pro";
11369
11472
  var Flux3Video = "flux-3-video";
11370
11473
  var FluxKontextMax = "flux-kontext-max";
11371
11474
  var FluxKontextPro = "flux-kontext-pro";
11475
+ var FluxVideoEdit = "flux-video-edit";
11372
11476
  var FluxVideoUpscale = "flux-video-upscale";
11373
11477
  var Gemini25FlashImage = "gemini-2.5-flash-image";
11374
11478
  var Gemini25FlashTts = "gemini-2.5-flash-tts";
@@ -11391,6 +11495,8 @@ var Gpt6Astra = "gpt-6-astra";
11391
11495
  var GptImage1 = "gpt-image-1";
11392
11496
  var GptImage15 = "gpt-image-1.5";
11393
11497
  var GptImage2 = "gpt-image-2";
11498
+ var GptImage25Flare = "gpt-image-2.5-flare";
11499
+ var GptImage25Sunburst = "gpt-image-2.5-sunburst";
11394
11500
  var GrokEditVideo = "grok-edit-video";
11395
11501
  var GrokExtendVideo = "grok-extend-video";
11396
11502
  var GrokImagineImage = "grok-imagine-image";
@@ -11592,6 +11698,7 @@ var Models = {
11592
11698
  Flux3Video,
11593
11699
  FluxKontextMax,
11594
11700
  FluxKontextPro,
11701
+ FluxVideoEdit,
11595
11702
  FluxVideoUpscale,
11596
11703
  Gemini25FlashImage,
11597
11704
  Gemini25FlashTts,
@@ -11614,6 +11721,8 @@ var Models = {
11614
11721
  GptImage1,
11615
11722
  GptImage15,
11616
11723
  GptImage2,
11724
+ GptImage25Flare,
11725
+ GptImage25Sunburst,
11617
11726
  GrokEditVideo,
11618
11727
  GrokExtendVideo,
11619
11728
  GrokImagineImage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "5.31.0",
3
+ "version": "5.33.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",