@picsart/ai-sdk 3.29.0 → 3.30.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 +4 -0
  2. package/index.js +46 -11
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -405,11 +405,14 @@ type ModelInputById = {
405
405
  imageUrls: [string, ...string[]];
406
406
  resolution?: "4k" | "1080p" | "720p";
407
407
  aspectRatio?: "16:9" | "9:16";
408
+ voiceId: string;
408
409
  prompt: string;
409
410
  };
410
411
  "heygen-video-avatar": {
412
+ videoId: string;
411
413
  resolution?: "4k" | "1080p" | "720p";
412
414
  aspectRatio?: "16:9" | "9:16";
415
+ voiceId: string;
413
416
  prompt: string;
414
417
  };
415
418
  "hunyuan-v3": {
@@ -1299,6 +1302,7 @@ type ModelInputById = {
1299
1302
  };
1300
1303
  "sora-2-extend": {
1301
1304
  prompt: string;
1305
+ videoId?: string;
1302
1306
  duration?: 4 | 8 | 12 | 16 | 20;
1303
1307
  };
1304
1308
  "sora-2-pro": {
package/index.js CHANGED
@@ -2857,6 +2857,42 @@ var buildMinimaxH3 = (ctx) => {
2857
2857
  ...ctx.aspectRatio ? { ratio: ctx.aspectRatio } : {}
2858
2858
  };
2859
2859
  };
2860
+ var FRAME_REF_EXCLUSIVE = "First/last frame and reference inputs cannot be combined.";
2861
+ var LAST_NEEDS_FIRST = "An end frame requires a start frame.";
2862
+ var AUDIO_NEEDS_VISUAL = "Reference audio needs a reference image or video.";
2863
+ var hailuo03Constraints = [
2864
+ // Frame roles ⊥ reference roles (declared both ways so either input disables the other).
2865
+ { when: { startFrame: { exists: true } }, then: {
2866
+ imageUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE },
2867
+ videoUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE },
2868
+ audioUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE }
2869
+ } },
2870
+ { when: { endFrame: { exists: true } }, then: {
2871
+ imageUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE },
2872
+ videoUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE },
2873
+ audioUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE }
2874
+ } },
2875
+ { when: { imageUrls: { exists: true } }, then: {
2876
+ startFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE },
2877
+ endFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE }
2878
+ } },
2879
+ { when: { videoUrls: { exists: true } }, then: {
2880
+ startFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE },
2881
+ endFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE }
2882
+ } },
2883
+ { when: { audioUrls: { exists: true } }, then: {
2884
+ startFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE },
2885
+ endFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE }
2886
+ } },
2887
+ // last_frame requires first_frame.
2888
+ { when: { startFrame: { exists: false } }, then: {
2889
+ endFrame: { disabled: true, reason: LAST_NEEDS_FIRST }
2890
+ } },
2891
+ // reference_audio cannot be the only reference input.
2892
+ { when: { imageUrls: { exists: false }, videoUrls: { exists: false } }, then: {
2893
+ audioUrls: { disabled: true, reason: AUDIO_NEEDS_VISUAL }
2894
+ } }
2895
+ ];
2860
2896
  var base = {
2861
2897
  mode: "video"
2862
2898
  };
@@ -2949,7 +2985,6 @@ var { MODELS: MODELS9 } = defineModels("minimax", [
2949
2985
  workflow: "minimax/v2/video-generation",
2950
2986
  buildPayload: buildMinimaxH3,
2951
2987
  estimatedTime: 300,
2952
- release: "preview",
2953
2988
  description: "MiniMax H3 2K video from text, start/last frame, or image/video/audio references.",
2954
2989
  features: [
2955
2990
  feat("Start Frame", "frame"),
@@ -2967,7 +3002,8 @@ var { MODELS: MODELS9 } = defineModels("minimax", [
2967
3002
  ...params.audioInputs(1, "Reference Audios", false),
2968
3003
  ...params.duration([5, 10, 15]),
2969
3004
  ...p.aspectRatio(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "adaptive")
2970
- }
3005
+ },
3006
+ constraints: hailuo03Constraints
2971
3007
  }
2972
3008
  ]);
2973
3009
 
@@ -6489,14 +6525,14 @@ var { MODELS: MODELS25 } = defineModels("heygen", [
6489
6525
  id: "heygen-video-avatar",
6490
6526
  modelId: "heygen-avatar-iv",
6491
6527
  addedAt: "2026-03-17",
6492
- // disabled 2026-05-08: backend/catalog mismatch.
6493
- // heygen/v1/video/generate uses Avatar IV mode but heygen/v1/avatars/list
6494
- // returns 1287 Avatar III avatars (all preview URLs are /avatar/v3/), so
6495
- // every avatar from the list is rejected with "This video avatar does not
6496
- // support Avatar IV video generation". Talking Photo (i2v) path is
6497
- // unaffected. Re-enable once backend exposes an Avatar IV catalog OR
6498
- // downgrades the worker to Avatar III mode.
6499
- disabled: true,
6528
+ // Disabled 2026-05-08 because the avatar list carried no way to tell an
6529
+ // Avatar IV-compatible avatar from an incompatible one, so picks were
6530
+ // rejected at submit. The worker now serves `heygen/v1/avatars/list` from
6531
+ // HeyGen v3 looks filtered by `supported_api_engines`, so every id it offers
6532
+ // is one the engine accepts. Kept at `preview` until that runs on
6533
+ // production — the tag is opt-in, so only stage surfaces asking for it will
6534
+ // list the model.
6535
+ release: "preview",
6500
6536
  name: "HeyGen Video Avatar",
6501
6537
  workflow: "heygen/v1/video/generate",
6502
6538
  buildPayload: buildHeyGenVideoAvatarPayload,
@@ -6664,7 +6700,6 @@ var { MODELS: MODELS27 } = defineModels("ideogram", [
6664
6700
  {
6665
6701
  id: "ideogram-p-image",
6666
6702
  name: "Ideogram P-Image",
6667
- release: "preview",
6668
6703
  addedAt: "2026-07-28",
6669
6704
  workflow: "ideogram/p-image/generate",
6670
6705
  buildPayload: buildIdeogramPImagePayload,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "3.29.0",
3
+ "version": "3.30.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",