@picsart/ai-sdk 5.28.0 → 5.28.2

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 +48 -8
  2. package/index.js +163 -44
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -325,6 +325,21 @@ type ModelInputById = {
325
325
  imageUrls?: string[];
326
326
  thinking?: "off" | "low" | "medium" | "high";
327
327
  };
328
+ "gpt-5.6-luna": {
329
+ prompt: string;
330
+ imageUrls?: string[];
331
+ thinking?: "off" | "low" | "medium" | "high";
332
+ };
333
+ "gpt-5.6-sol": {
334
+ prompt: string;
335
+ imageUrls?: string[];
336
+ thinking?: "off" | "low" | "medium" | "high";
337
+ };
338
+ "gpt-5.6-terra": {
339
+ prompt: string;
340
+ imageUrls?: string[];
341
+ thinking?: "off" | "low" | "medium" | "high";
342
+ };
328
343
  "gpt-image-1": {
329
344
  prompt: string;
330
345
  aspectRatio?: "1:1" | "3:2" | "2:3" | "16:9" | "9:16" | "4:3" | "3:4";
@@ -659,6 +674,7 @@ type ModelInputById = {
659
674
  prompt?: string;
660
675
  audioUrl: string;
661
676
  imageUrls?: string[];
677
+ aspectRatio?: "auto" | "16:9" | "9:16";
662
678
  cfgScale?: number;
663
679
  };
664
680
  "ltx-pro-t2v": {
@@ -682,7 +698,8 @@ type ModelInputById = {
682
698
  };
683
699
  "ltx-v2.3-extend": {
684
700
  prompt?: string;
685
- duration?: 5 | 10 | 15 | 20;
701
+ duration?: number;
702
+ mode?: "end" | "start";
686
703
  videoUrl: string;
687
704
  };
688
705
  "ltx-v2.3-fast": {
@@ -690,20 +707,26 @@ type ModelInputById = {
690
707
  duration?: 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20;
691
708
  resolution?: "1080p" | "1440p" | "2160p";
692
709
  aspectRatio?: "16:9" | "9:16";
710
+ fps?: 24 | 25 | 48 | 50;
693
711
  generateAudio?: boolean;
694
712
  imageUrls?: string[];
713
+ endFrame?: string;
695
714
  };
696
715
  "ltx-v2.3-pro": {
697
716
  prompt: string;
698
717
  duration?: 6 | 8 | 10;
699
718
  resolution?: "1080p" | "1440p" | "2160p";
700
719
  aspectRatio?: "16:9" | "9:16";
720
+ fps?: 24 | 25 | 48 | 50;
701
721
  generateAudio?: boolean;
702
722
  imageUrls?: string[];
723
+ endFrame?: string;
703
724
  };
704
725
  "ltx-v2.3-retake": {
705
726
  prompt: string;
706
- duration?: 5 | 10 | 15 | 20;
727
+ duration?: number;
728
+ retakeMode?: "replace_audio_and_video" | "replace_audio" | "replace_video";
729
+ startTime?: number;
707
730
  videoUrl: string;
708
731
  };
709
732
  "luma-ray-2": {
@@ -790,7 +813,7 @@ type ModelInputById = {
790
813
  imageUrls?: string[];
791
814
  videoUrls?: string[];
792
815
  audioUrls?: string[];
793
- duration?: 5 | 10 | 15;
816
+ duration?: number;
794
817
  aspectRatio?: "adaptive" | "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
795
818
  };
796
819
  "minimax-h3-max": {
@@ -832,7 +855,9 @@ type ModelInputById = {
832
855
  lyricsPrompt?: string;
833
856
  lyricsOptimizer?: boolean;
834
857
  isInstrumental?: boolean;
835
- outputFormat?: "url" | "hex";
858
+ sampleRate?: 16000 | 24000 | 32000 | 44100;
859
+ bitrate?: 32000 | 64000 | 128000 | 256000;
860
+ format?: "mp3" | "wav" | "pcm";
836
861
  };
837
862
  "minimax-music-v3": {
838
863
  prompt: string;
@@ -1183,7 +1208,7 @@ type ModelInputById = {
1183
1208
  "reve": {
1184
1209
  prompt: string;
1185
1210
  aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "3:2" | "2:3";
1186
- count?: 1 | 2 | 4 | 6 | 8 | 10;
1211
+ count?: 1 | 2 | 4;
1187
1212
  imageUrls?: string[];
1188
1213
  };
1189
1214
  "runway-aleph2": {
@@ -1480,7 +1505,7 @@ type ModelInputById = {
1480
1505
  };
1481
1506
  "topaz-upscale-video": {
1482
1507
  videoUrl: string;
1483
- model?: "Proteus" | "Artemis HQ" | "Artemis MQ" | "Artemis LQ" | "Nyx" | "Nyx Fast" | "Nyx XL" | "Nyx HF" | "Gaia HQ" | "Gaia CG" | "Gaia 2" | "Starlight Precise 1" | "Starlight Precise 2" | "Starlight Precise 2.5" | "Starlight HQ" | "Starlight Mini" | "Starlight Sharp" | "Starlight Fast 1" | "Starlight Fast 2";
1508
+ model?: "Proteus" | "Artemis HQ" | "Artemis MQ" | "Artemis LQ" | "Nyx" | "Nyx Fast" | "Nyx XL" | "Nyx HF" | "Gaia HQ" | "Gaia CG" | "Gaia 2" | "Starlight Precise 2.5" | "Starlight HQ" | "Starlight Mini" | "Starlight Sharp" | "Starlight Fast 2";
1484
1509
  };
1485
1510
  "veed-fabric-v1": {
1486
1511
  prompt?: string;
@@ -1619,7 +1644,7 @@ type ModelInputById = {
1619
1644
  type TypedModelId = keyof ModelInputById;
1620
1645
  type ModelInput<M extends TypedModelId> = ModelInputById[M];
1621
1646
  /** IDs of text-generation (LLM) models — narrows generateText(). */
1622
- 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" | "gemini-3.8-flash" | "gpt-5.5";
1647
+ 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" | "gemini-3.8-flash" | "gpt-5.5" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra";
1623
1648
  type TextModelInputById = Pick<ModelInputById, TextModelId>;
1624
1649
 
1625
1650
  /**
@@ -2124,10 +2149,18 @@ interface GenerationContext {
2124
2149
  videoId?: string;
2125
2150
  modelId?: string;
2126
2151
  removeBackgroundNoise?: boolean;
2127
- /** MiniMax Music v2 worker field, sent as `lyrics_prompt` (min 10 chars). */
2152
+ /** MiniMax Music user lyrics, sent as the worker `lyrics` field. */
2128
2153
  lyricsPrompt?: string;
2129
2154
  lyricsOptimizer?: boolean;
2130
2155
  isInstrumental?: boolean;
2156
+ /** LTX 2.3 — output frame rate (24/25/48/50; >10s Fast videos require 25). */
2157
+ fps?: number;
2158
+ /** LTX 2.3 Extend — direction: 'end' extends forward, 'start' backward. */
2159
+ mode?: string;
2160
+ /** LTX 2.3 Retake — which tracks to regenerate. */
2161
+ retakeMode?: string;
2162
+ /** LTX 2.3 Retake — segment start offset in seconds. */
2163
+ startTime?: number;
2131
2164
  language?: string;
2132
2165
  accent?: string;
2133
2166
  style?: string;
@@ -2157,6 +2190,10 @@ interface GenerationContext {
2157
2190
  sourceImageUrl?: string;
2158
2191
  similarity?: number;
2159
2192
  audioSetting?: 'auto' | 'origin';
2193
+ /** MiniMax Music — audio_setting knobs. */
2194
+ sampleRate?: number;
2195
+ bitrate?: number;
2196
+ format?: string;
2160
2197
  returnLastFrame?: boolean;
2161
2198
  background?: string;
2162
2199
  outputFormat?: string;
@@ -2606,6 +2643,9 @@ declare const Models: {
2606
2643
  readonly GeminiOmni11FlashPreview: "gemini-omni-1.1-flash-preview";
2607
2644
  readonly GeminiOmniFlashPreview: "gemini-omni-flash-preview";
2608
2645
  readonly Gpt55: "gpt-5.5";
2646
+ readonly Gpt56Luna: "gpt-5.6-luna";
2647
+ readonly Gpt56Sol: "gpt-5.6-sol";
2648
+ readonly Gpt56Terra: "gpt-5.6-terra";
2609
2649
  readonly GptImage1: "gpt-image-1";
2610
2650
  readonly GptImage15: "gpt-image-1.5";
2611
2651
  readonly GptImage2: "gpt-image-2";
package/index.js CHANGED
@@ -2292,6 +2292,15 @@ var PRO_DURATIONS = [6, 8, 10];
2292
2292
  var FAST_DURATIONS = [6, 8, 10, 12, 14, 16, 18, 20];
2293
2293
  var LTX_RESOLUTIONS = ["1080p", "1440p", "2160p"];
2294
2294
  var LTX_23_AR = ["16:9", "9:16"];
2295
+ var LTX_23_FPS = [24, 25, 48, 50];
2296
+ var FAST_LONG = "Videos longer than 10s render at 1080p / 25 fps.";
2297
+ var ltxFastLongConstraints = [12, 14, 16, 18, 20].map((d) => ({
2298
+ when: { duration: { is: d } },
2299
+ then: {
2300
+ resolution: { allowed: ["1080p"], reason: FAST_LONG },
2301
+ fps: { allowed: [25], reason: FAST_LONG }
2302
+ }
2303
+ }));
2295
2304
  var buildLtxT2VPayload = (ctx) => ({
2296
2305
  prompt: ctx.prompt,
2297
2306
  ...ctx.imageUrls?.[0] ? { image_url: ctx.imageUrls[0] } : {},
@@ -2318,34 +2327,48 @@ var buildLtx23T2VPayload = (ctx) => ({
2318
2327
  ...ctx.duration != null ? { duration: ctx.duration } : {},
2319
2328
  ...ctx.resolution ? { resolution: ctx.resolution } : {},
2320
2329
  ...ctx.aspectRatio ? { aspect_ratio: ctx.aspectRatio } : {},
2330
+ ...ctx.fps != null ? { fps: ctx.fps } : {},
2321
2331
  generate_audio: ctx.generateAudio ?? true
2322
2332
  });
2323
2333
  var buildLtx23I2VPayload = (ctx) => ({
2324
2334
  prompt: ctx.prompt,
2325
2335
  image_url: ctx.imageUrls?.[0],
2336
+ ...ctx.endFrame ? { end_image_url: ctx.endFrame } : {},
2326
2337
  ...ctx.duration != null ? { duration: ctx.duration } : {},
2327
2338
  ...ctx.resolution ? { resolution: ctx.resolution } : {},
2328
2339
  ...ctx.aspectRatio ? { aspect_ratio: ctx.aspectRatio } : {},
2340
+ ...ctx.fps != null ? { fps: ctx.fps } : {},
2329
2341
  generate_audio: ctx.generateAudio ?? true
2330
2342
  });
2331
2343
  var buildLtx23FastPayload = buildLtx23T2VPayload;
2332
- var buildLtx23A2VPayload = (ctx) => ({
2333
- audio_url: ctx.audioUrl,
2334
- ...ctx.prompt ? { prompt: ctx.prompt } : {},
2335
- ...ctx.imageUrls?.[0] ? { image_url: ctx.imageUrls[0] } : {},
2336
- ...ctx.cfgScale != null ? { guidance_scale: ctx.cfgScale } : {}
2337
- });
2344
+ var buildLtx23A2VPayload = (ctx) => {
2345
+ if (!ctx.prompt && !ctx.imageUrls?.[0]) {
2346
+ throw new ApiError("LTX 2.3 Audio-to-Video: provide a prompt or a first-frame image.", {
2347
+ status: 400,
2348
+ code: "validation_error"
2349
+ });
2350
+ }
2351
+ return {
2352
+ audio_url: ctx.audioUrl,
2353
+ ...ctx.prompt ? { prompt: ctx.prompt } : {},
2354
+ ...ctx.imageUrls?.[0] ? { image_url: ctx.imageUrls[0] } : {},
2355
+ ...ctx.aspectRatio ? { aspect_ratio: ctx.aspectRatio } : {},
2356
+ // No client default: the vendor picks 5 (with image) / 9 (without) contextually.
2357
+ ...ctx.cfgScale != null ? { guidance_scale: ctx.cfgScale } : {}
2358
+ };
2359
+ };
2338
2360
  var buildLtx23ExtendPayload = (ctx) => ({
2339
2361
  video_url: ctx.videoUrl,
2340
2362
  ...ctx.prompt ? { prompt: ctx.prompt } : {},
2341
2363
  ...ctx.duration != null ? { duration: ctx.duration } : {},
2342
- mode: "end"
2364
+ mode: ctx.mode ?? "end"
2343
2365
  });
2344
2366
  var buildLtx23RetakePayload = (ctx) => ({
2345
2367
  prompt: ctx.prompt,
2346
2368
  video_url: ctx.videoUrl,
2347
2369
  ...ctx.duration != null ? { duration: ctx.duration } : {},
2348
- retake_mode: "replace_audio_and_video"
2370
+ retake_mode: ctx.retakeMode ?? "replace_audio_and_video",
2371
+ ...ctx.startTime != null ? { start_time: ctx.startTime } : {}
2349
2372
  });
2350
2373
  var { MODELS: MODELS2 } = defineModels("ltx", [
2351
2374
  // ── LTX 2.0 ──────────────────────────────────────────────────────
@@ -2437,9 +2460,17 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
2437
2460
  ...params.duration(PRO_DURATIONS, 6),
2438
2461
  ...params.resolution([...LTX_RESOLUTIONS]),
2439
2462
  ...params.aspectRatio(LTX_23_AR),
2463
+ ...p.enum("fps", LTX_23_FPS, 25, { label: "FPS" }),
2440
2464
  ...params.generateAudio(),
2441
- ...params.imageInput()
2442
- }
2465
+ ...params.imageInput(),
2466
+ ...params.endFrame()
2467
+ },
2468
+ constraints: [
2469
+ // end_image_url exists only on the I2V route, which a start image triggers.
2470
+ { when: { imageUrls: { exists: false } }, then: {
2471
+ endFrame: { disabled: true, reason: "An end frame requires a start image." }
2472
+ } }
2473
+ ]
2443
2474
  },
2444
2475
  {
2445
2476
  id: "ltx-v2.3-fast",
@@ -2460,9 +2491,18 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
2460
2491
  ...params.duration(FAST_DURATIONS, 6),
2461
2492
  ...params.resolution([...LTX_RESOLUTIONS]),
2462
2493
  ...params.aspectRatio(LTX_23_AR),
2494
+ ...p.enum("fps", LTX_23_FPS, 25, { label: "FPS" }),
2463
2495
  ...params.generateAudio(),
2464
- ...params.imageInput()
2465
- }
2496
+ ...params.imageInput(),
2497
+ ...params.endFrame()
2498
+ },
2499
+ constraints: [
2500
+ ...ltxFastLongConstraints,
2501
+ // end_image_url exists only on the I2V route, which a start image triggers.
2502
+ { when: { imageUrls: { exists: false } }, then: {
2503
+ endFrame: { disabled: true, reason: "An end frame requires a start image." }
2504
+ } }
2505
+ ]
2466
2506
  },
2467
2507
  {
2468
2508
  id: "ltx-2.3-a2v",
@@ -2480,7 +2520,13 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
2480
2520
  ...params.prompt({ required: false }),
2481
2521
  ...params.audioInput("Audio Track", true),
2482
2522
  ...params.imageInput(1, "First Frame Image", false),
2483
- ...params.cfgScale(1, 50, 5)
2523
+ ...params.aspectRatio(["auto", ...LTX_23_AR]),
2524
+ // Default-less on purpose: the vendor default is contextual (5 with an
2525
+ // image, 9 without), so the SDK only sends a user-chosen value.
2526
+ cfgScale: {
2527
+ label: "CFG Scale",
2528
+ descriptor: { kind: "range", min: 1, max: 50, step: 1 }
2529
+ }
2484
2530
  }
2485
2531
  },
2486
2532
  {
@@ -2496,7 +2542,8 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
2496
2542
  features: [feat("Video Input", "input"), feat("Up to 20s", "duration")],
2497
2543
  paramConfig: {
2498
2544
  ...params.prompt({ required: false }),
2499
- ...params.duration([5, 10, 15, 20], 5),
2545
+ ...params.durationRange(2, 20, 5, 1),
2546
+ ...p.enum("mode", ["end", "start"], "end", { label: "Extend Direction" }),
2500
2547
  ...params.videoInput("Source Video")
2501
2548
  }
2502
2549
  },
@@ -2513,7 +2560,13 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
2513
2560
  features: [feat("Video Input", "input"), feat("Up to 20s", "duration")],
2514
2561
  paramConfig: {
2515
2562
  ...params.prompt(),
2516
- ...params.duration([5, 10, 15, 20], 5),
2563
+ ...params.durationRange(2, 20, 5, 1),
2564
+ ...p.enum("retakeMode", ["replace_audio_and_video", "replace_audio", "replace_video"], "replace_audio_and_video", { label: "Retake Mode" }),
2565
+ // Default-less: when unset the retake starts at 0 (vendor default).
2566
+ startTime: {
2567
+ label: "Start Time (s)",
2568
+ descriptor: { kind: "range", min: 0, max: 20, step: 1 }
2569
+ },
2517
2570
  ...params.videoInput("Source Video")
2518
2571
  }
2519
2572
  }
@@ -2827,13 +2880,13 @@ var { MODELS: MODELS8 } = defineModels("hunyuan", [
2827
2880
  var buildT2V = (withDuration) => (ctx) => ({
2828
2881
  prompt: ctx.prompt,
2829
2882
  ...ctx.enhancePrompt !== void 0 ? { prompt_optimizer: ctx.enhancePrompt } : {},
2830
- ...withDuration && ctx.duration ? { duration: String(ctx.duration) } : {}
2883
+ ...withDuration && ctx.duration ? { duration: ctx.duration } : {}
2831
2884
  });
2832
2885
  var buildI2V = (withDuration) => (ctx) => ({
2833
2886
  prompt: ctx.prompt,
2834
2887
  image_url: ctx.imageUrls?.[0],
2835
2888
  ...ctx.enhancePrompt !== void 0 ? { prompt_optimizer: ctx.enhancePrompt } : {},
2836
- ...withDuration && ctx.duration ? { duration: String(ctx.duration) } : {}
2889
+ ...withDuration && ctx.duration ? { duration: ctx.duration } : {}
2837
2890
  });
2838
2891
  var buildMinimaxH3 = (ctx) => {
2839
2892
  const content = [{ type: "text", text: ctx.prompt }];
@@ -2846,7 +2899,7 @@ var buildMinimaxH3 = (ctx) => {
2846
2899
  model: "MiniMax-H3",
2847
2900
  content,
2848
2901
  resolution: "2K",
2849
- ...ctx.duration ? { duration: ctx.duration } : {},
2902
+ duration: ctx.duration ?? 5,
2850
2903
  ...ctx.aspectRatio ? { ratio: ctx.aspectRatio } : {}
2851
2904
  };
2852
2905
  };
@@ -2902,10 +2955,10 @@ var { MODELS: MODELS9 } = defineModels("minimax", [
2902
2955
  buildPayload: buildT2V(true),
2903
2956
  buildEditPayload: buildI2V(true),
2904
2957
  estimatedTime: 150,
2905
- description: "Stylized 720p animation with strong character expression and emotion.",
2906
- features: [feat("Image Input", "input"), feat("Start Frame", "frame"), feat("720p", "resolution"), feat("10 sec", "duration")],
2958
+ description: "Stylized 768p animation with strong character expression and emotion.",
2959
+ features: [feat("Image Input", "input"), feat("Start Frame", "frame"), feat("768p", "resolution"), feat("10 sec", "duration")],
2907
2960
  paramConfig: {
2908
- ...params.prompt(),
2961
+ ...params.prompt({ maxLength: 2e3 }),
2909
2962
  ...params.enhancePrompt(),
2910
2963
  ...params.duration([6, 10]),
2911
2964
  ...params.imageInput()
@@ -2926,7 +2979,7 @@ var { MODELS: MODELS9 } = defineModels("minimax", [
2926
2979
  description: "1080p output focused on detailed scenes and polished short-form content.",
2927
2980
  features: [feat("Image Input", "input"), feat("Start Frame", "frame"), feat("1080p", "resolution"), feat("6 sec", "duration")],
2928
2981
  paramConfig: {
2929
- ...params.prompt(),
2982
+ ...params.prompt({ maxLength: 2e3 }),
2930
2983
  ...params.enhancePrompt(),
2931
2984
  ...params.imageInput()
2932
2985
  }
@@ -2941,10 +2994,10 @@ var { MODELS: MODELS9 } = defineModels("minimax", [
2941
2994
  workflow: "minimax/hailuo-2.3-fast/standard/image-to-video",
2942
2995
  buildPayload: buildI2V(true),
2943
2996
  estimatedTime: 173,
2944
- description: "Quick 720p previews with expressive characters for rapid experimentation.",
2945
- features: [feat("Image Input", "input"), feat("Start Frame", "frame"), feat("720p", "resolution"), feat("10 sec", "duration")],
2997
+ description: "Quick 768p previews with expressive characters for rapid experimentation.",
2998
+ features: [feat("Image Input", "input"), feat("Start Frame", "frame"), feat("768p", "resolution"), feat("10 sec", "duration")],
2946
2999
  paramConfig: {
2947
- ...params.prompt(),
3000
+ ...params.prompt({ maxLength: 2e3 }),
2948
3001
  ...params.enhancePrompt(),
2949
3002
  ...params.duration([6, 10]),
2950
3003
  ...params.imageInput(1, "Start Image", true)
@@ -2963,7 +3016,7 @@ var { MODELS: MODELS9 } = defineModels("minimax", [
2963
3016
  description: "Fast 1080p output for short, polished clips with varied styles.",
2964
3017
  features: [feat("Image Input", "input"), feat("Start Frame", "frame"), feat("1080p", "resolution"), feat("6 sec", "duration")],
2965
3018
  paramConfig: {
2966
- ...params.prompt(),
3019
+ ...params.prompt({ maxLength: 2e3 }),
2967
3020
  ...params.enhancePrompt(),
2968
3021
  ...params.imageInput(1, "Start Image", true)
2969
3022
  }
@@ -2987,13 +3040,13 @@ var { MODELS: MODELS9 } = defineModels("minimax", [
2987
3040
  feat("15 sec", "duration")
2988
3041
  ],
2989
3042
  paramConfig: {
2990
- ...params.prompt(),
3043
+ ...params.prompt({ maxLength: 7e3 }),
2991
3044
  ...params.startFrame(),
2992
3045
  ...params.endFrame(),
2993
- ...params.imageInput(3, "Reference Images", false),
2994
- ...params.videoInputs(1, "Reference Videos", false),
2995
- ...params.audioInputs(1, "Reference Audios", false),
2996
- ...params.duration([5, 10, 15]),
3046
+ ...params.imageInput(9, "Reference Images", false),
3047
+ ...params.videoInputs(3, "Reference Videos", false),
3048
+ ...params.audioInputs(3, "Reference Audios", false),
3049
+ ...params.durationRange(5, 15, 5),
2997
3050
  ...p.aspectRatio(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "adaptive")
2998
3051
  },
2999
3052
  constraints: minimaxH3Constraints
@@ -4790,7 +4843,7 @@ var buildRevePayload = (ctx) => {
4790
4843
  return {
4791
4844
  prompt: ctx.prompt,
4792
4845
  num_images: ctx.count ?? 1,
4793
- ...ctx.aspectRatio ? { aspect_ratio: ctx.aspectRatio } : {},
4846
+ ...ctx.aspectRatio && !hasImages ? { aspect_ratio: ctx.aspectRatio } : {},
4794
4847
  ...hasImages ? { image_url: ctx.imageUrls[0] } : {}
4795
4848
  };
4796
4849
  };
@@ -4808,9 +4861,10 @@ var { MODELS: MODELS16 } = defineModels("reve", [
4808
4861
  description: "Stylized 1K images with optional reference input.",
4809
4862
  features: [feat("Image Input", "input"), feat("1K", "resolution")],
4810
4863
  paramConfig: {
4811
- ...params.prompt(),
4864
+ // fal enforces prompt <= 2560 chars and num_images <= 4 on both routes.
4865
+ ...params.prompt({ maxLength: 2560 }),
4812
4866
  ...params.aspectRatio(REVE_AR),
4813
- ...params.count(),
4867
+ ...params.count([1, 2, 4]),
4814
4868
  ...params.imageInput(1, "Source Image")
4815
4869
  }
4816
4870
  }
@@ -6545,10 +6599,14 @@ var buildMinimaxTTSPayload = (ctx) => ({
6545
6599
  });
6546
6600
  var buildMinimaxMusicPayload = (ctx) => ({
6547
6601
  prompt: ctx.prompt,
6548
- lyrics_prompt: ctx.lyricsPrompt ?? ctx.prompt,
6602
+ ...ctx.lyricsPrompt ? { lyrics: ctx.lyricsPrompt } : {},
6549
6603
  ...ctx.lyricsOptimizer != null ? { lyrics_optimizer: ctx.lyricsOptimizer } : {},
6550
6604
  ...ctx.isInstrumental != null ? { is_instrumental: ctx.isInstrumental } : {},
6551
- ...ctx.outputFormat ? { output_format: ctx.outputFormat } : { output_format: "url" }
6605
+ audio_setting: {
6606
+ sample_rate: ctx.sampleRate ?? 44100,
6607
+ bitrate: ctx.bitrate ?? 256e3,
6608
+ format: ctx.format ?? "mp3"
6609
+ }
6552
6610
  });
6553
6611
  var { MODELS: MODELS26 } = defineModels("minimax", [
6554
6612
  {
@@ -6584,13 +6642,15 @@ var { MODELS: MODELS26 } = defineModels("minimax", [
6584
6642
  paramConfig: {
6585
6643
  ...params.prompt({ maxLength: 2e3, placeholder: "Describe the genre, mood, instruments, tempo, and production style..." }),
6586
6644
  ...p.text("lyricsPrompt", {
6587
- maxLength: 2e3,
6588
- label: "Lyrics Prompt",
6589
- placeholder: "Write lyrics, or describe the lyrical theme. Minimum 10 characters."
6645
+ maxLength: 3500,
6646
+ label: "Lyrics",
6647
+ placeholder: "Write lyrics, or describe the lyrical theme. Optional for instrumental or optimizer-generated lyrics."
6590
6648
  }),
6591
6649
  ...p.boolean("lyricsOptimizer", false, "Lyrics Optimizer"),
6592
6650
  ...p.boolean("isInstrumental", false, "Instrumental"),
6593
- ...p.enum("outputFormat", ["url", "hex"], "url", { label: "Output Format" })
6651
+ ...p.enum("sampleRate", [16e3, 24e3, 32e3, 44100], 44100, { label: "Sample Rate" }),
6652
+ ...p.enum("bitrate", [32e3, 64e3, 128e3, 256e3], 256e3, { label: "Bitrate" }),
6653
+ ...p.enum("format", ["mp3", "wav", "pcm"], "mp3", { label: "Format" })
6594
6654
  }
6595
6655
  },
6596
6656
  {
@@ -6606,7 +6666,7 @@ var { MODELS: MODELS26 } = defineModels("minimax", [
6606
6666
  paramConfig: {
6607
6667
  ...params.prompt({ maxLength: 2e3, placeholder: "Describe the genre, mood, instruments, tempo, and production style..." }),
6608
6668
  ...p.text("lyricsPrompt", {
6609
- maxLength: 2e3,
6669
+ maxLength: 3500,
6610
6670
  label: "Lyrics",
6611
6671
  placeholder: "Write lyrics; \\n separates lines, [Intro]/[Verse]/[Chorus] tags supported. Optional for instrumental or optimizer-generated lyrics."
6612
6672
  }),
@@ -7795,13 +7855,12 @@ var TOPAZ_VIDEO_MODEL_OPTIONS = [
7795
7855
  "Gaia HQ",
7796
7856
  "Gaia CG",
7797
7857
  "Gaia 2",
7798
- "Starlight Precise 1",
7799
- "Starlight Precise 2",
7858
+ // 'Starlight Precise 1' / 'Starlight Precise 2' / 'Starlight Fast 1' removed:
7859
+ // deprecated upstream (developer.topazlabs.com) — Precise 2.5 / Fast 2 succeed them.
7800
7860
  "Starlight Precise 2.5",
7801
7861
  "Starlight HQ",
7802
7862
  "Starlight Mini",
7803
7863
  "Starlight Sharp",
7804
- "Starlight Fast 1",
7805
7864
  "Starlight Fast 2"
7806
7865
  ];
7807
7866
  var { MODELS: MODELS30 } = defineModels("topaz", [
@@ -8665,6 +8724,57 @@ var { MODELS: ANTHROPIC } = defineModels("anthropic", [
8665
8724
  }
8666
8725
  ]);
8667
8726
  var { MODELS: OPENAI_LLM } = defineModels("openai", [
8727
+ {
8728
+ id: "gpt-5.6-sol",
8729
+ name: "GPT-5.6 Sol",
8730
+ workflow: "chat-completions",
8731
+ addedAt: "2026-09-04",
8732
+ estimatedTime: 10,
8733
+ mode: "text",
8734
+ inputType: "i2t",
8735
+ badge: ["premium"],
8736
+ description: "OpenAI\u2019s most capable GPT-5.6 model for deep reasoning and complex tasks.",
8737
+ features: [feat("Vision", "input"), feat("Thinking", "characteristic")],
8738
+ paramConfig: {
8739
+ ...params.prompt(),
8740
+ ...params.imageInput(8, "Images"),
8741
+ ...thinkingParam(["low", "medium", "high"])
8742
+ }
8743
+ },
8744
+ {
8745
+ id: "gpt-5.6-terra",
8746
+ name: "GPT-5.6 Terra",
8747
+ workflow: "chat-completions",
8748
+ addedAt: "2026-09-04",
8749
+ estimatedTime: 8,
8750
+ mode: "text",
8751
+ inputType: "i2t",
8752
+ badge: ["popular"],
8753
+ description: "Balanced GPT-5.6 model \u2014 strong general-purpose quality at moderate latency.",
8754
+ features: [feat("Vision", "input"), feat("Thinking", "characteristic")],
8755
+ paramConfig: {
8756
+ ...params.prompt(),
8757
+ ...params.imageInput(8, "Images"),
8758
+ ...thinkingParam(["low", "medium", "high"])
8759
+ }
8760
+ },
8761
+ {
8762
+ id: "gpt-5.6-luna",
8763
+ name: "GPT-5.6 Luna",
8764
+ workflow: "chat-completions",
8765
+ addedAt: "2026-09-04",
8766
+ estimatedTime: 5,
8767
+ mode: "text",
8768
+ inputType: "i2t",
8769
+ badge: ["fast"],
8770
+ description: "Fast, lightweight GPT-5.6 model for low-latency, high-volume text tasks.",
8771
+ features: [feat("Vision", "input"), feat("Thinking", "characteristic")],
8772
+ paramConfig: {
8773
+ ...params.prompt(),
8774
+ ...params.imageInput(8, "Images"),
8775
+ ...thinkingParam(["low", "medium", "high"])
8776
+ }
8777
+ },
8668
8778
  {
8669
8779
  id: "gpt-5.5",
8670
8780
  name: "GPT-5.5",
@@ -8826,6 +8936,9 @@ registerPayloads(MODELS36, {
8826
8936
  "claude-opus-4-8": buildClaudePayload("claude-opus-4-8"),
8827
8937
  "claude-sonnet-4-6": buildClaudePayload("claude-sonnet-4-6"),
8828
8938
  "claude-haiku-4-5": buildClaudePayload("claude-haiku-4-5"),
8939
+ "gpt-5.6-sol": buildOpenAiPayload("gpt-5.6-sol"),
8940
+ "gpt-5.6-terra": buildOpenAiPayload("gpt-5.6-terra"),
8941
+ "gpt-5.6-luna": buildOpenAiPayload("gpt-5.6-luna"),
8829
8942
  "gpt-5.5": buildOpenAiPayload("gpt-5.5"),
8830
8943
  "gemini-3-pro": buildGeminiPayload("gemini-3-pro-preview"),
8831
8944
  // Flash models route through chat-completions (OpenAI-shaped), not the
@@ -11181,6 +11294,9 @@ var Gemini38Flash = "gemini-3.8-flash";
11181
11294
  var GeminiOmni11FlashPreview = "gemini-omni-1.1-flash-preview";
11182
11295
  var GeminiOmniFlashPreview = "gemini-omni-flash-preview";
11183
11296
  var Gpt55 = "gpt-5.5";
11297
+ var Gpt56Luna = "gpt-5.6-luna";
11298
+ var Gpt56Sol = "gpt-5.6-sol";
11299
+ var Gpt56Terra = "gpt-5.6-terra";
11184
11300
  var GptImage1 = "gpt-image-1";
11185
11301
  var GptImage15 = "gpt-image-1.5";
11186
11302
  var GptImage2 = "gpt-image-2";
@@ -11397,6 +11513,9 @@ var Models = {
11397
11513
  GeminiOmni11FlashPreview,
11398
11514
  GeminiOmniFlashPreview,
11399
11515
  Gpt55,
11516
+ Gpt56Luna,
11517
+ Gpt56Sol,
11518
+ Gpt56Terra,
11400
11519
  GptImage1,
11401
11520
  GptImage15,
11402
11521
  GptImage2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "5.28.0",
3
+ "version": "5.28.2",
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",