@picsart/ai-sdk 5.28.8 → 5.29.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
@@ -841,19 +841,10 @@ type ModelInputById = {
841
841
  prompt: string;
842
842
  startFrame?: string;
843
843
  endFrame?: string;
844
- resolution?: "480p" | "768p";
845
- duration?: number;
846
- aspectRatio?: "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
847
- promptExpansionMode?: "disabled" | "balanced" | "quality";
848
- seed?: number;
849
- enableSafetyChecker?: boolean;
850
- };
851
- "minimax-h3-max-r2v": {
852
- prompt: string;
853
844
  imageUrls?: string[];
854
845
  videoUrls?: string[];
855
846
  audioUrls?: string[];
856
- resolution?: "480p" | "768p";
847
+ resolution?: "480p" | "768p" | "1080p";
857
848
  duration?: number;
858
849
  aspectRatio?: "adaptive" | "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
859
850
  promptExpansionMode?: "balanced" | "quality";
@@ -864,7 +855,7 @@ type ModelInputById = {
864
855
  prompt: string;
865
856
  startFrame?: string;
866
857
  endFrame?: string;
867
- resolution?: "480p" | "768p";
858
+ resolution?: "480p" | "768p" | "1080p";
868
859
  duration?: number;
869
860
  aspectRatio?: "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
870
861
  promptExpansionMode?: "balanced" | "quality";
@@ -2737,7 +2728,6 @@ declare const Models: {
2737
2728
  readonly Minimax02Hd: "minimax-02-hd";
2738
2729
  readonly MinimaxH3: "minimax-h3";
2739
2730
  readonly MinimaxH3Max: "minimax-h3-max";
2740
- readonly MinimaxH3MaxR2v: "minimax-h3-max-r2v";
2741
2731
  readonly MinimaxH3MaxTurbo: "minimax-h3-max-turbo";
2742
2732
  readonly MinimaxMusicV2: "minimax-music-v2";
2743
2733
  readonly MinimaxMusicV3: "minimax-music-v3";
package/index.js CHANGED
@@ -6619,7 +6619,44 @@ var buildMinimaxMusicPayload = (ctx) => ({
6619
6619
  format: ctx.format ?? "mp3"
6620
6620
  }
6621
6621
  });
6622
- var MINIMAX_H3_PROMPT_MAX = 7e3;
6622
+ var H3_MAX_PROMPT_MAX = 5e4;
6623
+ var FRAME_REF_EXCLUSIVE2 = "References and start/end frames cannot be combined.";
6624
+ var AUDIO_NEEDS_VISUAL2 = "Audio cannot be the only reference \u2014 add an image or video.";
6625
+ var RATIO_FOLLOWS_FRAME = "Aspect ratio follows the frame image.";
6626
+ var ADAPTIVE_NEEDS_REFS = "Adaptive aspect ratio requires reference inputs.";
6627
+ var H3_MAX_RATIOS = ["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"];
6628
+ var REFERENCE_EXCLUDES_FRAMES = {
6629
+ startFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 },
6630
+ endFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 }
6631
+ };
6632
+ var FRAME_EXCLUDES_REFERENCES = {
6633
+ imageUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 },
6634
+ videoUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 },
6635
+ audioUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 }
6636
+ };
6637
+ var h3MaxConstraints = [
6638
+ { when: { startFrame: { exists: true } }, then: FRAME_EXCLUDES_REFERENCES },
6639
+ { when: { endFrame: { exists: true } }, then: FRAME_EXCLUDES_REFERENCES },
6640
+ { when: { imageUrls: { exists: true } }, then: REFERENCE_EXCLUDES_FRAMES },
6641
+ { when: { videoUrls: { exists: true } }, then: REFERENCE_EXCLUDES_FRAMES },
6642
+ { when: { audioUrls: { exists: true } }, then: REFERENCE_EXCLUDES_FRAMES },
6643
+ // With a frame the output follows that image, so the ratio is not a choice.
6644
+ // An end frame alone is valid — it generates towards that keyframe.
6645
+ { when: { startFrame: { exists: true } }, then: {
6646
+ aspectRatio: { disabled: true, reason: RATIO_FOLLOWS_FRAME }
6647
+ } },
6648
+ { when: { endFrame: { exists: true } }, then: {
6649
+ aspectRatio: { disabled: true, reason: RATIO_FOLLOWS_FRAME }
6650
+ } },
6651
+ // 'adaptive' means "follow the references" — no meaning without them.
6652
+ { when: { imageUrls: { exists: false }, videoUrls: { exists: false }, audioUrls: { exists: false } }, then: {
6653
+ aspectRatio: { allowed: [...H3_MAX_RATIOS], reason: ADAPTIVE_NEEDS_REFS }
6654
+ } },
6655
+ // Audio carries no visual signal, so it cannot be the only reference.
6656
+ { when: { imageUrls: { exists: false }, videoUrls: { exists: false } }, then: {
6657
+ audioUrls: { disabled: true, reason: AUDIO_NEEDS_VISUAL2 }
6658
+ } }
6659
+ ];
6623
6660
  var { MODELS: MODELS26 } = defineModels("minimax", [
6624
6661
  {
6625
6662
  id: "minimax-02-hd",
@@ -6690,55 +6727,51 @@ var { MODELS: MODELS26 } = defineModels("minimax", [
6690
6727
  }
6691
6728
  },
6692
6729
  {
6693
- // Combined T2V/I2V fal.ai-hosted (pa-fal-ai-pluggable-worker), unlike
6694
- // the Hailuo/H3 entries in hailuo.ts which route through the minimax
6695
- // worker. A start frame switches to the image-to-video edit workflow.
6730
+ // One entry for all three H3 Max modes: the inputs pick it — reference
6731
+ // images, videos or audio generate from references; a start and/or end
6732
+ // frame animates those frames; neither generates from the prompt alone.
6696
6733
  id: "minimax-h3-max",
6697
6734
  name: "MiniMax H3 Max",
6698
6735
  modelId: "fal-ai-h3-max",
6699
6736
  addedAt: "2026-08-28",
6700
- workflow: "minimax/h3-max/text-to-video",
6701
- editWorkflow: "minimax/h3-max/image-to-video",
6737
+ workflow: "minimax/h3-max/video-generation",
6702
6738
  estimatedTime: 5,
6703
6739
  mode: "video",
6704
6740
  inputType: "t2v",
6705
- description: "Top-tier MiniMax H3 Max video from text or a start/end frame, with prompt expansion. Up to 15s at 768p.",
6741
+ description: "Top-tier MiniMax H3 Max video from text, a start/end frame, or reference images, videos, and audio \u2014 refer to references in the prompt as Image 1, Video 1, Audio 1, in input order. Up to 15s at 1080p.",
6706
6742
  features: [
6707
- feat("Image Input", "input"),
6708
6743
  feat("Start/End Frame", "frame"),
6709
- feat("768p", "resolution"),
6744
+ feat("Multi-Image Input", "input"),
6745
+ feat("Video Input", "input"),
6746
+ feat("Audio Input", "input"),
6747
+ feat("1080p", "resolution"),
6710
6748
  feat("5-15 sec", "duration")
6711
6749
  ],
6712
6750
  paramConfig: {
6713
- ...params.prompt({ maxLength: MINIMAX_H3_PROMPT_MAX }),
6751
+ ...params.prompt({ maxLength: H3_MAX_PROMPT_MAX }),
6714
6752
  ...params.startFrame(),
6715
6753
  ...params.endFrame(),
6716
- // Lowercase on purpose: the worker uppercases for the fal wire ('768P')
6717
- // and the pricing qualities are lowercase, so this casing serves both.
6718
- ...params.resolution(["480p", "768p"], "768p"),
6754
+ // Reference slots reference-to-video route. Clips are 2-15s each
6755
+ // (≤15s combined per modality) and images + videos + audios must add up
6756
+ // to ≤12 files — backend-enforced; only the per-array maxima live here.
6757
+ ...params.imageInput(9, "Reference Images"),
6758
+ ...params.videoInputs(3, "Reference Videos"),
6759
+ ...params.audioInputs(3, "Reference Audios"),
6760
+ // 1080p is a latent refinement of a native 768p generation.
6761
+ ...params.resolution(["480p", "768p", "1080p"], "768p"),
6719
6762
  ...params.durationRange(5, 15, 5),
6720
- ...params.aspectRatio(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "16:9"),
6721
- ...p.enum("promptExpansionMode", ["disabled", "balanced", "quality"], "balanced", { label: "Prompt Expansion" }),
6763
+ // 'adaptive' means "follow the references" — constrained below.
6764
+ ...params.aspectRatio(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "16:9"),
6765
+ ...p.enum("promptExpansionMode", ["balanced", "quality"], "balanced", { label: "Prompt Expansion" }),
6722
6766
  // -1 (sentinel) means "pick a random seed"; the builder drops it.
6723
6767
  ...p.range("seed", -1, 2147483647, -1),
6724
6768
  ...p.boolean("enableSafetyChecker", true, "Safety Checker")
6725
6769
  },
6726
- constraints: [
6727
- // The T2V wire has no end_image_url — an end frame only reaches the
6728
- // vendor on the I2V route, which needs a start frame to trigger.
6729
- { when: { startFrame: { exists: false } }, then: {
6730
- endFrame: { disabled: true, reason: "An end frame requires a start frame." }
6731
- } },
6732
- // I2V derives the ratio from the input image (no aspect_ratio on that wire).
6733
- { when: { startFrame: { exists: true } }, then: {
6734
- aspectRatio: { disabled: true, reason: "Aspect ratio follows the start frame image." }
6735
- } }
6736
- ]
6770
+ constraints: h3MaxConstraints
6737
6771
  },
6738
6772
  {
6739
- // Turbo sibling of minimax-h3-max — same fal.ai worker, same wire shape,
6740
- // tuned for speed (faster-than-realtime generation). The only schema
6741
- // difference: prompt expansion has no 'disabled' mode on this endpoint.
6773
+ // Turbo sibling of minimax-h3-max — same model family, tuned for speed
6774
+ // (faster-than-realtime generation), text and frames only.
6742
6775
  id: "minimax-h3-max-turbo",
6743
6776
  name: "MiniMax H3 Max Turbo",
6744
6777
  modelId: "fal-ai-h3-max-turbo",
@@ -6748,81 +6781,35 @@ var { MODELS: MODELS26 } = defineModels("minimax", [
6748
6781
  estimatedTime: 5,
6749
6782
  mode: "video",
6750
6783
  inputType: "t2v",
6751
- description: "Faster-than-realtime MiniMax H3 Max Turbo video from text or a start/end frame, with prompt expansion. Up to 15s at 768p.",
6784
+ description: "Faster-than-realtime MiniMax H3 Max Turbo video from text or a start/end frame, with prompt expansion. Up to 15s at 1080p.",
6752
6785
  features: [
6753
6786
  feat("Fast", "characteristic"),
6754
6787
  feat("Image Input", "input"),
6755
6788
  feat("Start/End Frame", "frame"),
6756
- feat("768p", "resolution"),
6789
+ feat("1080p", "resolution"),
6757
6790
  feat("5-15 sec", "duration")
6758
6791
  ],
6759
6792
  paramConfig: {
6760
- ...params.prompt({ maxLength: MINIMAX_H3_PROMPT_MAX }),
6793
+ ...params.prompt({ maxLength: H3_MAX_PROMPT_MAX }),
6761
6794
  ...params.startFrame(),
6762
6795
  ...params.endFrame(),
6763
- // Lowercase on purpose: the worker uppercases for the fal wire ('768P')
6764
- // and the pricing qualities are lowercase, so this casing serves both.
6765
- ...params.resolution(["480p", "768p"], "768p"),
6796
+ ...params.resolution(["480p", "768p", "1080p"], "768p"),
6766
6797
  ...params.durationRange(5, 15, 5),
6767
6798
  ...params.aspectRatio(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "16:9"),
6768
- // Unlike minimax-h3-max, the turbo wire has no 'disabled' expansion mode.
6769
6799
  ...p.enum("promptExpansionMode", ["balanced", "quality"], "balanced", { label: "Prompt Expansion" }),
6770
6800
  // -1 (sentinel) means "pick a random seed"; the builder drops it.
6771
6801
  ...p.range("seed", -1, 2147483647, -1),
6772
6802
  ...p.boolean("enableSafetyChecker", true, "Safety Checker")
6773
6803
  },
6774
6804
  constraints: [
6775
- // The T2V wire has no end_image_url an end frame only reaches the
6776
- // vendor on the I2V route, which needs a start frame to trigger.
6777
- { when: { startFrame: { exists: false } }, then: {
6778
- endFrame: { disabled: true, reason: "An end frame requires a start frame." }
6779
- } },
6780
- // I2V derives the ratio from the input image (no aspect_ratio on that wire).
6805
+ // Either frame routes to image-to-video, which derives the ratio from
6806
+ // the image it was given (no aspect_ratio on that wire). An end frame
6807
+ // alone is valid fal documents it as end-only keyframe generation.
6781
6808
  { when: { startFrame: { exists: true } }, then: {
6782
- aspectRatio: { disabled: true, reason: "Aspect ratio follows the start frame image." }
6783
- } }
6784
- ]
6785
- },
6786
- {
6787
- // Reference-to-video sibling of minimax-h3-max (same fal.ai worker).
6788
- // The prompt addresses references by modality and order — Image 1,
6789
- // Video 1, Audio 1, … Reference clips are 2-15s each (≤15s combined per
6790
- // modality) and images + videos + audios must add up to ≤12 files —
6791
- // backend-enforced; paramConfig only carries the per-array maxima.
6792
- id: "minimax-h3-max-r2v",
6793
- name: "MiniMax H3 Max Ref-to-Video",
6794
- modelId: "fal-ai-h3-max",
6795
- addedAt: "2026-09-01",
6796
- workflow: "minimax/h3-max/reference-to-video",
6797
- estimatedTime: 5,
6798
- mode: "video",
6799
- inputType: "i2v",
6800
- description: "MiniMax H3 Max video from reference images, videos, and audio \u2014 refer to them in the prompt as Image 1, Video 1, Audio 1, in input order. Up to 15s at 768p.",
6801
- features: [
6802
- feat("Multi-Image Input", "input"),
6803
- feat("Video Input", "input"),
6804
- feat("Audio Input", "input"),
6805
- feat("768p", "resolution"),
6806
- feat("5-15 sec", "duration")
6807
- ],
6808
- paramConfig: {
6809
- ...params.prompt({ maxLength: MINIMAX_H3_PROMPT_MAX, placeholder: "Image 1 is the protagonist. Keep her consistent with the reference while she walks through a sunlit garden..." }),
6810
- ...params.imageInput(9, "Reference Images"),
6811
- ...params.videoInputs(3, "Reference Videos"),
6812
- ...params.audioInputs(3, "Reference Audios"),
6813
- // Lowercase on purpose — same worker normalization as minimax-h3-max.
6814
- ...params.resolution(["480p", "768p"], "768p"),
6815
- ...params.durationRange(5, 15, 5),
6816
- ...params.aspectRatio(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "adaptive"),
6817
- // Unlike the T2V/I2V entry, this wire has no 'disabled' expansion mode.
6818
- ...p.enum("promptExpansionMode", ["balanced", "quality"], "balanced", { label: "Prompt Expansion" }),
6819
- // -1 (sentinel) means "pick a random seed"; the builder drops it.
6820
- ...p.range("seed", -1, 2147483647, -1),
6821
- ...p.boolean("enableSafetyChecker", true, "Safety Checker")
6822
- },
6823
- constraints: [
6824
- { when: { imageUrls: { exists: false }, videoUrls: { exists: false } }, then: {
6825
- audioUrls: { disabled: true, reason: "Audio cannot be the only reference \u2014 add an image or video." }
6809
+ aspectRatio: { disabled: true, reason: "Aspect ratio follows the frame image." }
6810
+ } },
6811
+ { when: { endFrame: { exists: true } }, then: {
6812
+ aspectRatio: { disabled: true, reason: "Aspect ratio follows the frame image." }
6826
6813
  } }
6827
6814
  ]
6828
6815
  }
@@ -6843,41 +6830,43 @@ var buildMinimaxMusicV3Payload = (input) => ({
6843
6830
  format: input.format ?? "mp3"
6844
6831
  }
6845
6832
  });
6846
- var buildMinimaxH3MaxPayload = (input) => ({
6847
- prompt: input.prompt,
6848
- prompt_expansion_mode: input.promptExpansionMode ?? "balanced",
6849
- duration: input.duration ?? 5,
6850
- resolution: input.resolution ?? "768p",
6851
- ...input.startFrame ? {
6852
- image_url: input.startFrame,
6853
- ...input.endFrame ? { end_image_url: input.endFrame } : {}
6854
- } : { aspect_ratio: input.aspectRatio ?? "16:9" },
6855
- // -1 is the paramConfig sentinel for "random seed" omit it on the wire.
6856
- ...input.seed != null && input.seed !== -1 ? { seed: input.seed } : {},
6857
- enable_safety_checker: input.enableSafetyChecker ?? true
6858
- });
6833
+ var buildMinimaxH3MaxPayload = (input) => {
6834
+ const hasReferences = !!(input.imageUrls?.length || input.videoUrls?.length || input.audioUrls?.length);
6835
+ const hasFrame = !!(input.startFrame || input.endFrame);
6836
+ return {
6837
+ prompt: input.prompt,
6838
+ prompt_expansion_mode: input.promptExpansionMode ?? "balanced",
6839
+ duration: input.duration ?? 5,
6840
+ // The vendor enum is uppercase; paramConfig keeps the lowercase form.
6841
+ resolution: (input.resolution ?? "768p").toUpperCase(),
6842
+ // Frames and references pick different modes and are mutually exclusive
6843
+ // (the model's constraints keep them so), hence whichever the caller
6844
+ // filled is what goes out.
6845
+ ...input.startFrame ? { image_url: input.startFrame } : {},
6846
+ ...input.endFrame ? { end_image_url: input.endFrame } : {},
6847
+ ...input.imageUrls?.length ? { reference_image_urls: input.imageUrls } : {},
6848
+ ...input.videoUrls?.length ? { reference_video_urls: input.videoUrls } : {},
6849
+ ...input.audioUrls?.length ? { reference_audio_urls: input.audioUrls } : {},
6850
+ // A frame decides the ratio itself, so the field is dropped there. With
6851
+ // references the default is 'adaptive' (follow them); from the prompt
6852
+ // alone it is 16:9.
6853
+ ...hasFrame ? {} : { aspect_ratio: input.aspectRatio ?? (hasReferences ? "adaptive" : "16:9") },
6854
+ // -1 is the paramConfig sentinel for "random seed" — omit it on the wire.
6855
+ ...input.seed != null && input.seed !== -1 ? { seed: input.seed } : {},
6856
+ enable_safety_checker: input.enableSafetyChecker ?? true
6857
+ };
6858
+ };
6859
6859
  var buildMinimaxH3MaxTurboPayload = (input) => ({
6860
6860
  prompt: input.prompt,
6861
6861
  prompt_expansion_mode: input.promptExpansionMode ?? "balanced",
6862
6862
  duration: input.duration ?? 5,
6863
6863
  resolution: input.resolution ?? "768p",
6864
- ...input.startFrame ? {
6865
- image_url: input.startFrame,
6866
- ...input.endFrame ? { end_image_url: input.endFrame } : {}
6867
- } : { aspect_ratio: input.aspectRatio ?? "16:9" },
6868
- // -1 is the paramConfig sentinel for "random seed" — omit it on the wire.
6869
- ...input.seed != null && input.seed !== -1 ? { seed: input.seed } : {},
6870
- enable_safety_checker: input.enableSafetyChecker ?? true
6871
- });
6872
- var buildMinimaxH3MaxR2VPayload = (input) => ({
6873
- prompt: input.prompt,
6874
- prompt_expansion_mode: input.promptExpansionMode ?? "balanced",
6875
- duration: input.duration ?? 5,
6876
- resolution: input.resolution ?? "768p",
6877
- aspect_ratio: input.aspectRatio ?? "adaptive",
6878
- ...input.imageUrls?.length ? { reference_image_urls: input.imageUrls } : {},
6879
- ...input.videoUrls?.length ? { reference_video_urls: input.videoUrls } : {},
6880
- ...input.audioUrls?.length ? { reference_audio_urls: input.audioUrls } : {},
6864
+ // Either frame animates frames, and an end frame alone is valid (it
6865
+ // generates towards that keyframe). The ratio follows the frame when one is
6866
+ // supplied, so it goes out only when neither is set.
6867
+ ...input.startFrame ? { image_url: input.startFrame } : {},
6868
+ ...input.endFrame ? { end_image_url: input.endFrame } : {},
6869
+ ...input.startFrame || input.endFrame ? {} : { aspect_ratio: input.aspectRatio ?? "16:9" },
6881
6870
  // -1 is the paramConfig sentinel for "random seed" — omit it on the wire.
6882
6871
  ...input.seed != null && input.seed !== -1 ? { seed: input.seed } : {},
6883
6872
  enable_safety_checker: input.enableSafetyChecker ?? true
@@ -6885,11 +6874,9 @@ var buildMinimaxH3MaxR2VPayload = (input) => ({
6885
6874
  registerPayloads(MODELS26, {
6886
6875
  "minimax-music-v3": buildMinimaxMusicV3Payload,
6887
6876
  "minimax-h3-max": buildMinimaxH3MaxPayload,
6888
- "minimax-h3-max-turbo": buildMinimaxH3MaxTurboPayload,
6889
- "minimax-h3-max-r2v": buildMinimaxH3MaxR2VPayload
6877
+ "minimax-h3-max-turbo": buildMinimaxH3MaxTurboPayload
6890
6878
  });
6891
6879
  registerEditPayloads(MODELS26, {
6892
- "minimax-h3-max": buildMinimaxH3MaxPayload,
6893
6880
  "minimax-h3-max-turbo": buildMinimaxH3MaxTurboPayload
6894
6881
  });
6895
6882
 
@@ -11456,7 +11443,6 @@ var Lyria35 = "lyria-3.5";
11456
11443
  var Minimax02Hd = "minimax-02-hd";
11457
11444
  var MinimaxH3 = "minimax-h3";
11458
11445
  var MinimaxH3Max = "minimax-h3-max";
11459
- var MinimaxH3MaxR2v = "minimax-h3-max-r2v";
11460
11446
  var MinimaxH3MaxTurbo = "minimax-h3-max-turbo";
11461
11447
  var MinimaxMusicV2 = "minimax-music-v2";
11462
11448
  var MinimaxMusicV3 = "minimax-music-v3";
@@ -11680,7 +11666,6 @@ var Models = {
11680
11666
  Minimax02Hd,
11681
11667
  MinimaxH3,
11682
11668
  MinimaxH3Max,
11683
- MinimaxH3MaxR2v,
11684
11669
  MinimaxH3MaxTurbo,
11685
11670
  MinimaxMusicV2,
11686
11671
  MinimaxMusicV3,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "5.28.8",
3
+ "version": "5.29.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",