@picsart/ai-sdk 5.21.2 → 5.22.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.
package/index.d.ts CHANGED
@@ -791,6 +791,17 @@ type ModelInputById = {
791
791
  duration?: 5 | 10 | 15;
792
792
  aspectRatio?: "adaptive" | "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
793
793
  };
794
+ "minimax-h3-max": {
795
+ prompt: string;
796
+ startFrame?: string;
797
+ endFrame?: string;
798
+ resolution?: "480p" | "768p";
799
+ duration?: number;
800
+ aspectRatio?: "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
801
+ promptExpansionMode?: "disabled" | "balanced" | "quality";
802
+ seed?: number;
803
+ enableSafetyChecker?: boolean;
804
+ };
794
805
  "minimax-music-v2": {
795
806
  prompt: string;
796
807
  lyricsPrompt?: string;
@@ -957,6 +968,17 @@ type ModelInputById = {
957
968
  enhancePrompt?: boolean;
958
969
  imageUrls?: string[];
959
970
  promptExtendMode?: "direct" | "agent";
971
+ enableThinking?: boolean;
972
+ };
973
+ "qwen-image-3.0-pro": {
974
+ prompt: string;
975
+ negativePrompt?: string;
976
+ resolution?: "2048x2048" | "2688x1536" | "1536x2688" | "2368x1728" | "1728x2368";
977
+ count?: 1 | 2 | 4 | 6;
978
+ enhancePrompt?: boolean;
979
+ imageUrls?: string[];
980
+ promptExtendMode?: "direct" | "agent";
981
+ enableThinking?: boolean;
960
982
  };
961
983
  "recraft-creative-upscale": {
962
984
  imageUrls: [string, ...string[]];
@@ -2089,8 +2111,10 @@ interface GenerationContext {
2089
2111
  substyle?: string;
2090
2112
  thinkingLevel?: 'minimal' | 'high';
2091
2113
  thinkingBudget?: number;
2092
- /** Qwen 3.0 — prompt-rewrite strategy (`direct`/`agent`), sent as `prompt_extend_mode`. */
2114
+ /** Qwen 3.0 family — prompt-rewrite strategy (`direct`/`agent`), sent as `prompt_extend_mode`. */
2093
2115
  promptExtendMode?: 'direct' | 'agent';
2116
+ /** Qwen 3.0 family — thinking mode (requires prompt_extend), sent as `enable_thinking`. */
2117
+ enableThinking?: boolean;
2094
2118
  }
2095
2119
  type PayloadBuilder<TContext extends GenerationContext = GenerationContext> = (ctx: TContext) => object;
2096
2120
  /** Lightweight runtime schema contract used by SDK integrations. */
@@ -2590,6 +2614,7 @@ declare const Models: {
2590
2614
  readonly Lyria3Pro: "lyria-3-pro";
2591
2615
  readonly Minimax02Hd: "minimax-02-hd";
2592
2616
  readonly MinimaxH3: "minimax-h3";
2617
+ readonly MinimaxH3Max: "minimax-h3-max";
2593
2618
  readonly MinimaxMusicV2: "minimax-music-v2";
2594
2619
  readonly MinimaxMusicV3: "minimax-music-v3";
2595
2620
  readonly Ovi: "ovi";
@@ -2618,6 +2643,7 @@ declare const Models: {
2618
2643
  readonly QwenImage2: "qwen-image-2";
2619
2644
  readonly QwenImage2Pro: "qwen-image-2-pro";
2620
2645
  readonly QwenImage30: "qwen-image-3.0";
2646
+ readonly QwenImage30Pro: "qwen-image-3.0-pro";
2621
2647
  readonly RecraftCreativeUpscale: "recraft-creative-upscale";
2622
2648
  readonly RecraftCrispUpscale: "recraft-crisp-upscale";
2623
2649
  readonly RecraftExplore: "recraft-explore";
package/index.js CHANGED
@@ -6413,6 +6413,52 @@ var { MODELS: MODELS26 } = defineModels("minimax", [
6413
6413
  ...p.enum("bitrate", [32e3, 64e3, 128e3, 256e3], 256e3, { label: "Bitrate" }),
6414
6414
  ...p.enum("format", ["mp3", "wav", "pcm"], "mp3", { label: "Format" })
6415
6415
  }
6416
+ },
6417
+ {
6418
+ // Combined T2V/I2V — fal.ai-hosted (pa-fal-ai-pluggable-worker), unlike
6419
+ // the Hailuo/H3 entries in hailuo.ts which route through the minimax
6420
+ // worker. A start frame switches to the image-to-video edit workflow.
6421
+ id: "minimax-h3-max",
6422
+ name: "MiniMax H3 Max",
6423
+ modelId: "fal-ai-h3-max",
6424
+ addedAt: "2026-08-28",
6425
+ workflow: "minimax/h3-max/text-to-video",
6426
+ editWorkflow: "minimax/h3-max/image-to-video",
6427
+ estimatedTime: 180,
6428
+ mode: "video",
6429
+ inputType: "t2v",
6430
+ description: "Top-tier MiniMax H3 Max video from text or a start/end frame, with prompt expansion. Up to 15s at 768p.",
6431
+ features: [
6432
+ feat("Image Input", "input"),
6433
+ feat("Start/End Frame", "frame"),
6434
+ feat("768p", "resolution"),
6435
+ feat("5-15 sec", "duration")
6436
+ ],
6437
+ paramConfig: {
6438
+ ...params.prompt(),
6439
+ ...params.startFrame(),
6440
+ ...params.endFrame(),
6441
+ // Lowercase on purpose: the worker uppercases for the fal wire ('768P')
6442
+ // and the pricing qualities are lowercase, so this casing serves both.
6443
+ ...params.resolution(["480p", "768p"], "768p"),
6444
+ ...params.durationRange(5, 15, 5),
6445
+ ...params.aspectRatio(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "16:9"),
6446
+ ...p.enum("promptExpansionMode", ["disabled", "balanced", "quality"], "balanced", { label: "Prompt Expansion" }),
6447
+ // -1 (sentinel) means "pick a random seed"; the builder drops it.
6448
+ ...p.range("seed", -1, 2147483647, -1),
6449
+ ...p.boolean("enableSafetyChecker", true, "Safety Checker")
6450
+ },
6451
+ constraints: [
6452
+ // The T2V wire has no end_image_url — an end frame only reaches the
6453
+ // vendor on the I2V route, which needs a start frame to trigger.
6454
+ { when: { startFrame: { exists: false } }, then: {
6455
+ endFrame: { disabled: true, reason: "An end frame requires a start frame." }
6456
+ } },
6457
+ // I2V derives the ratio from the input image (no aspect_ratio on that wire).
6458
+ { when: { startFrame: { exists: true } }, then: {
6459
+ aspectRatio: { disabled: true, reason: "Aspect ratio follows the start frame image." }
6460
+ } }
6461
+ ]
6416
6462
  }
6417
6463
  ]);
6418
6464
 
@@ -6431,8 +6477,25 @@ var buildMinimaxMusicV3Payload = (input) => ({
6431
6477
  format: input.format ?? "mp3"
6432
6478
  }
6433
6479
  });
6480
+ var buildMinimaxH3MaxPayload = (input) => ({
6481
+ prompt: input.prompt,
6482
+ prompt_expansion_mode: input.promptExpansionMode ?? "balanced",
6483
+ duration: input.duration ?? 5,
6484
+ resolution: input.resolution ?? "768p",
6485
+ ...input.startFrame ? {
6486
+ image_url: input.startFrame,
6487
+ ...input.endFrame ? { end_image_url: input.endFrame } : {}
6488
+ } : { aspect_ratio: input.aspectRatio ?? "16:9" },
6489
+ // -1 is the paramConfig sentinel for "random seed" — omit it on the wire.
6490
+ ...input.seed != null && input.seed !== -1 ? { seed: input.seed } : {},
6491
+ enable_safety_checker: input.enableSafetyChecker ?? true
6492
+ });
6434
6493
  registerPayloads(MODELS26, {
6435
- "minimax-music-v3": buildMinimaxMusicV3Payload
6494
+ "minimax-music-v3": buildMinimaxMusicV3Payload,
6495
+ "minimax-h3-max": buildMinimaxH3MaxPayload
6496
+ });
6497
+ registerEditPayloads(MODELS26, {
6498
+ "minimax-h3-max": buildMinimaxH3MaxPayload
6436
6499
  });
6437
6500
 
6438
6501
  // src/vendors/catalog/ideogram.ts
@@ -6672,6 +6735,7 @@ var buildQwen2Payload = (ctx) => {
6672
6735
  };
6673
6736
  var buildQwenV1 = (model) => (ctx) => {
6674
6737
  const hasImages = Array.isArray(ctx.imageUrls) && ctx.imageUrls.length > 0;
6738
+ const promptExtendMode = ctx.promptExtendMode === "agent" && hasImages && model === "qwen-image-3.0-pro" ? void 0 : ctx.promptExtendMode;
6675
6739
  return {
6676
6740
  prompt: ctx.prompt,
6677
6741
  model,
@@ -6680,8 +6744,10 @@ var buildQwenV1 = (model) => (ctx) => {
6680
6744
  size: (ctx.resolution ?? "2048x2048").replace("x", "*"),
6681
6745
  n: ctx.count ?? 1,
6682
6746
  prompt_extend: ctx.enhancePrompt ?? true,
6683
- // Qwen 3.0 only — prompt-rewrite strategy (direct/agent); 2.x ignores it.
6684
- ...ctx.promptExtendMode ? { prompt_extend_mode: ctx.promptExtendMode } : {},
6747
+ // Qwen 3.0 family only — prompt-rewrite strategy (direct/agent); 2.x ignores it.
6748
+ ...promptExtendMode ? { prompt_extend_mode: promptExtendMode } : {},
6749
+ // Qwen 3.0 family only — thinking mode (requires prompt_extend).
6750
+ ...ctx.enableThinking != null ? { enable_thinking: ctx.enableThinking } : {},
6685
6751
  watermark: false,
6686
6752
  ...ctx.seed != null ? { seed: ctx.seed } : {}
6687
6753
  };
@@ -6696,7 +6762,8 @@ var qwenV1Params = {
6696
6762
  };
6697
6763
  var qwenV1Params3 = {
6698
6764
  ...qwenV1Params,
6699
- ...p.enum("promptExtendMode", ["direct", "agent"], "direct")
6765
+ ...p.enum("promptExtendMode", ["direct", "agent"], "direct"),
6766
+ ...p.boolean("enableThinking", true, "Deep Thinking")
6700
6767
  };
6701
6768
  var { MODELS: MODELS28 } = defineModels("qwen", [
6702
6769
  {
@@ -6774,6 +6841,25 @@ var { MODELS: MODELS28 } = defineModels("qwen", [
6774
6841
  feat("2K", "resolution")
6775
6842
  ],
6776
6843
  paramConfig: qwenV1Params3
6844
+ },
6845
+ {
6846
+ id: "qwen-image-3.0-pro",
6847
+ name: "Qwen 3.0 Pro",
6848
+ addedAt: "2026-08-31",
6849
+ workflow: "qwen/v1/text-to-image",
6850
+ editWorkflow: "qwen/v1/image-to-image",
6851
+ buildPayload: buildQwenV1("qwen-image-3.0-pro"),
6852
+ estimatedTime: 90,
6853
+ mode: "image",
6854
+ inputType: "t2i",
6855
+ badge: ["premium"],
6856
+ description: "Qwen-Image 3.0 Pro (GA) \u2014 flagship text-to-image and image editing with prompt-rewrite modes and thinking mode.",
6857
+ features: [
6858
+ feat("Image Input", "input"),
6859
+ feat("Negative Prompt", "characteristic"),
6860
+ feat("2K", "resolution")
6861
+ ],
6862
+ paramConfig: qwenV1Params3
6777
6863
  }
6778
6864
  ]);
6779
6865
 
@@ -10624,6 +10710,7 @@ var Lyria3Clip = "lyria-3-clip";
10624
10710
  var Lyria3Pro = "lyria-3-pro";
10625
10711
  var Minimax02Hd = "minimax-02-hd";
10626
10712
  var MinimaxH3 = "minimax-h3";
10713
+ var MinimaxH3Max = "minimax-h3-max";
10627
10714
  var MinimaxMusicV2 = "minimax-music-v2";
10628
10715
  var MinimaxMusicV3 = "minimax-music-v3";
10629
10716
  var Ovi = "ovi";
@@ -10652,6 +10739,7 @@ var Qwen = "qwen";
10652
10739
  var QwenImage2 = "qwen-image-2";
10653
10740
  var QwenImage2Pro = "qwen-image-2-pro";
10654
10741
  var QwenImage30 = "qwen-image-3.0";
10742
+ var QwenImage30Pro = "qwen-image-3.0-pro";
10655
10743
  var RecraftCreativeUpscale = "recraft-creative-upscale";
10656
10744
  var RecraftCrispUpscale = "recraft-crisp-upscale";
10657
10745
  var RecraftExplore = "recraft-explore";
@@ -10833,6 +10921,7 @@ var Models = {
10833
10921
  Lyria3Pro,
10834
10922
  Minimax02Hd,
10835
10923
  MinimaxH3,
10924
+ MinimaxH3Max,
10836
10925
  MinimaxMusicV2,
10837
10926
  MinimaxMusicV3,
10838
10927
  Ovi,
@@ -10861,6 +10950,7 @@ var Models = {
10861
10950
  QwenImage2,
10862
10951
  QwenImage2Pro,
10863
10952
  QwenImage30,
10953
+ QwenImage30Pro,
10864
10954
  RecraftCreativeUpscale,
10865
10955
  RecraftCrispUpscale,
10866
10956
  RecraftExplore,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "5.21.2",
3
+ "version": "5.22.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",