@picsart/ai-sdk 6.39.0 → 6.40.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.
Files changed (3) hide show
  1. package/index.d.ts +12 -1
  2. package/index.js +67 -1
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1189,6 +1189,16 @@ type ModelInputById = {
1189
1189
  duration?: number;
1190
1190
  aspectRatio?: "adaptive" | "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
1191
1191
  };
1192
+ "minimax-h3-context-ir": {
1193
+ prompt: string;
1194
+ startFrame?: string;
1195
+ endFrame?: string;
1196
+ imageUrls?: string[];
1197
+ videoUrls?: string[];
1198
+ audioUrls?: string[];
1199
+ duration?: number;
1200
+ aspectRatio?: "adaptive" | "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
1201
+ };
1192
1202
  "minimax-h3-max": {
1193
1203
  prompt: string;
1194
1204
  startFrame?: string;
@@ -2104,7 +2114,7 @@ type ModelInputById = {
2104
2114
  type TypedModelId = keyof ModelInputById;
2105
2115
  type ModelInput<M extends TypedModelId> = ModelInputById[M];
2106
2116
  /** IDs of text-generation (LLM) models — narrows generateText(). */
2107
- type TextModelId = "claude-fable-5" | "claude-fable-5-1" | "claude-haiku-4-5" | "claude-haiku-5-5" | "claude-opus-4-8" | "claude-opus-5" | "claude-sonnet-4-5" | "claude-sonnet-4-6" | "claude-sonnet-5" | "eleven-speech-to-text" | "gemini-2.5-flash" | "gemini-3-pro" | "gemini-3.5-flash-lite" | "gemini-3.6-flash" | "gemini-3.7-flash" | "gemini-3.8-flash" | "gemini-4-argon" | "gpt-4.1-mini" | "gpt-4.1-nano" | "gpt-4o" | "gpt-4o-mini" | "gpt-5" | "gpt-5-mini" | "gpt-5.1" | "gpt-5.2" | "gpt-5.5" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-6-astra" | "gpt-6-luna" | "gpt-6-sol" | "grok-4.7" | "kimi-k3";
2117
+ type TextModelId = "claude-fable-5" | "claude-fable-5-1" | "claude-haiku-4-5" | "claude-haiku-5-5" | "claude-opus-4-8" | "claude-opus-5" | "claude-sonnet-4-5" | "claude-sonnet-4-6" | "claude-sonnet-5" | "eleven-speech-to-text" | "gemini-2.5-flash" | "gemini-3-pro" | "gemini-3.5-flash-lite" | "gemini-3.6-flash" | "gemini-3.7-flash" | "gemini-3.8-flash" | "gemini-4-argon" | "gpt-4.1-mini" | "gpt-4.1-nano" | "gpt-4o" | "gpt-4o-mini" | "gpt-5" | "gpt-5-mini" | "gpt-5.1" | "gpt-5.2" | "gpt-5.5" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-6-astra" | "gpt-6-luna" | "gpt-6-sol" | "grok-4.7" | "kimi-k3" | "minimax-h3-context-ir";
2108
2118
  type TextModelInputById = Pick<ModelInputById, TextModelId>;
2109
2119
  /** IDs of structured-output (json-mode) models — narrows run()'s result type. */
2110
2120
  type JsonModelId = "typesafe-evaluate";
@@ -3612,6 +3622,7 @@ declare const Models: {
3612
3622
  readonly Lyria3Pro: "lyria-3-pro";
3613
3623
  readonly Lyria35: "lyria-3.5";
3614
3624
  readonly MinimaxH3: "minimax-h3";
3625
+ readonly MinimaxH3ContextIr: "minimax-h3-context-ir";
3615
3626
  readonly MinimaxH3Max: "minimax-h3-max";
3616
3627
  readonly MinimaxH3MaxCameraControls: "minimax-h3-max-camera-controls";
3617
3628
  readonly MinimaxH3MaxExtend: "minimax-h3-max-extend";
package/index.js CHANGED
@@ -10664,7 +10664,56 @@ var { MODELS: GROK_LLM } = defineModels("grok", [
10664
10664
  }
10665
10665
  }
10666
10666
  ]);
10667
- var MODELS35 = [...ANTHROPIC, ...OPENAI_LLM, ...GEMINI_LLM, ...KIMI_LLM, ...GROK_LLM];
10667
+ var H3_FRAME_REF_EXCLUSIVE = "References and start/end frames cannot be combined.";
10668
+ var H3_FRAME_EXCLUDES_REFERENCES = {
10669
+ imageUrls: { disabled: true, reason: H3_FRAME_REF_EXCLUSIVE },
10670
+ videoUrls: { disabled: true, reason: H3_FRAME_REF_EXCLUSIVE },
10671
+ audioUrls: { disabled: true, reason: H3_FRAME_REF_EXCLUSIVE }
10672
+ };
10673
+ var H3_REFERENCE_EXCLUDES_FRAMES = {
10674
+ startFrame: { disabled: true, reason: H3_FRAME_REF_EXCLUSIVE },
10675
+ endFrame: { disabled: true, reason: H3_FRAME_REF_EXCLUSIVE }
10676
+ };
10677
+ var h3ContextIrConstraints = [
10678
+ { when: { startFrame: { exists: true } }, then: H3_FRAME_EXCLUDES_REFERENCES },
10679
+ { when: { endFrame: { exists: true } }, then: H3_FRAME_EXCLUDES_REFERENCES },
10680
+ { when: { imageUrls: { exists: true } }, then: H3_REFERENCE_EXCLUDES_FRAMES },
10681
+ { when: { videoUrls: { exists: true } }, then: H3_REFERENCE_EXCLUDES_FRAMES },
10682
+ { when: { audioUrls: { exists: true } }, then: H3_REFERENCE_EXCLUDES_FRAMES }
10683
+ ];
10684
+ var { MODELS: MINIMAX_LLM } = defineModels("minimax", [
10685
+ {
10686
+ id: "minimax-h3-context-ir",
10687
+ name: "MiniMax H3 Context IR",
10688
+ workflow: "minimax/v2/h3-context-ir",
10689
+ addedAt: "2026-10-14",
10690
+ estimatedTime: 8,
10691
+ mode: "text",
10692
+ inputType: "v2t",
10693
+ badge: ["new"],
10694
+ description: "MiniMax H3 Context IR \u2014 enhances a video prompt from text plus optional first/last frame, reference images, videos, and audio. Returns an enhanced prompt, not a video.",
10695
+ features: [
10696
+ feat("Vision", "input"),
10697
+ feat("Video Input", "input"),
10698
+ feat("Audio Input", "input"),
10699
+ feat("Start/End Frame", "frame")
10700
+ ],
10701
+ paramConfig: {
10702
+ ...params.prompt(),
10703
+ ...params.startFrame("Start Frame", false),
10704
+ ...params.endFrame("End Frame"),
10705
+ ...params.imageInput(9, "Reference Images", false, "reference"),
10706
+ ...params.videoInputs(3, "Reference Videos", false),
10707
+ ...params.audioInputs(3, "Reference Audios", false),
10708
+ // Target video shape the enhancement is written towards (4-15s; the
10709
+ // ratio defaults to 'adaptive' — follow the references).
10710
+ ...params.durationRange(4, 15, 5),
10711
+ ...params.aspectRatio(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "adaptive")
10712
+ },
10713
+ constraints: h3ContextIrConstraints
10714
+ }
10715
+ ]);
10716
+ var MODELS35 = [...ANTHROPIC, ...OPENAI_LLM, ...GEMINI_LLM, ...KIMI_LLM, ...GROK_LLM, ...MINIMAX_LLM];
10668
10717
 
10669
10718
  // src/vendors/catalog/llm.payloads.ts
10670
10719
  var CLAUDE_MAX_TOKENS = 8192;
@@ -10715,7 +10764,22 @@ var buildGeminiPayload = (modelId) => (input) => {
10715
10764
  ...level ? { generationConfig: { thinkingConfig: { thinkingLevel: level } } } : {}
10716
10765
  };
10717
10766
  };
10767
+ var buildMinimaxH3ContextIrPayload = (input) => {
10768
+ const content = [{ type: "text", text: input.prompt }];
10769
+ if (input.startFrame) content.push({ type: "image_url", image_url: { url: input.startFrame }, role: "first_frame" });
10770
+ if (input.endFrame) content.push({ type: "image_url", image_url: { url: input.endFrame }, role: "last_frame" });
10771
+ for (const url of input.imageUrls ?? []) content.push({ type: "image_url", image_url: { url }, role: "reference_image" });
10772
+ for (const url of input.videoUrls ?? []) content.push({ type: "video_url", video_url: { url }, role: "reference_video" });
10773
+ for (const url of input.audioUrls ?? []) content.push({ type: "audio_url", audio_url: { url }, role: "reference_audio" });
10774
+ return {
10775
+ model: "MiniMax-H3",
10776
+ content,
10777
+ duration: input.duration ?? 5,
10778
+ ...input.aspectRatio ? { ratio: input.aspectRatio } : {}
10779
+ };
10780
+ };
10718
10781
  registerPayloads(MODELS35, {
10782
+ "minimax-h3-context-ir": buildMinimaxH3ContextIrPayload,
10719
10783
  "claude-fable-5-1": buildClaudePayload("claude-fable-5-1"),
10720
10784
  "claude-fable-5": buildClaudePayload("claude-fable-5"),
10721
10785
  "claude-opus-5": buildClaudePayload("claude-opus-5"),
@@ -14863,6 +14927,7 @@ var Lyria3Clip = "lyria-3-clip";
14863
14927
  var Lyria3Pro = "lyria-3-pro";
14864
14928
  var Lyria35 = "lyria-3.5";
14865
14929
  var MinimaxH3 = "minimax-h3";
14930
+ var MinimaxH3ContextIr = "minimax-h3-context-ir";
14866
14931
  var MinimaxH3Max = "minimax-h3-max";
14867
14932
  var MinimaxH3MaxCameraControls = "minimax-h3-max-camera-controls";
14868
14933
  var MinimaxH3MaxExtend = "minimax-h3-max-extend";
@@ -15128,6 +15193,7 @@ var Models = {
15128
15193
  Lyria3Pro,
15129
15194
  Lyria35,
15130
15195
  MinimaxH3,
15196
+ MinimaxH3ContextIr,
15131
15197
  MinimaxH3Max,
15132
15198
  MinimaxH3MaxCameraControls,
15133
15199
  MinimaxH3MaxExtend,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "6.39.0",
3
+ "version": "6.40.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",