@picsart/ai-sdk 6.24.1 → 6.25.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
@@ -759,6 +759,18 @@ type ModelInputById = {
759
759
  voiceId: string;
760
760
  prompt: string;
761
761
  };
762
+ "heygen-video-1": {
763
+ prompt: string;
764
+ startFrame?: string;
765
+ imageUrls?: string[];
766
+ videoUrls?: string[];
767
+ audioUrls?: string[];
768
+ resolution?: "480p" | "768p";
769
+ duration?: number;
770
+ aspectRatio?: "adaptive" | "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
771
+ promptEnhancement?: "turbo" | "quality" | "disabled";
772
+ seed?: number;
773
+ };
762
774
  "heygen-video-avatar": {
763
775
  videoId: string;
764
776
  engine?: "avatar_iv" | "avatar_v";
@@ -3361,6 +3373,7 @@ declare const Models: {
3361
3373
  readonly Happyhorse11R2v: "happyhorse-1.1-r2v";
3362
3374
  readonly Happyhorse11T2v: "happyhorse-1.1-t2v";
3363
3375
  readonly HeygenTalkingPhoto: "heygen-talking-photo";
3376
+ readonly HeygenVideo1: "heygen-video-1";
3364
3377
  readonly HeygenVideoAvatar: "heygen-video-avatar";
3365
3378
  readonly HunyuanV3: "hunyuan-v3";
3366
3379
  readonly Ideogram45: "ideogram-4-5";
package/index.js CHANGED
@@ -7750,6 +7750,32 @@ var dynamicVoiceConfig = {
7750
7750
  catalog: { workflow: "heygen/v1/catalog/voices" }
7751
7751
  })
7752
7752
  };
7753
+ var VIDEO1_MODE_EXCLUSIVE = "A first frame and references cannot be combined \u2014 each picks a different mode.";
7754
+ var VIDEO1_RATIO_FOLLOWS_FRAME = "Aspect ratio follows the first-frame image.";
7755
+ var VIDEO1_ADAPTIVE_NEEDS_REFS = "Adaptive aspect ratio follows the references \u2014 add one to use it.";
7756
+ var VIDEO1_RATIOS = ["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"];
7757
+ var heygenVideo1Constraints = [
7758
+ { when: { startFrame: { exists: true } }, then: {
7759
+ imageUrls: { disabled: true, reason: VIDEO1_MODE_EXCLUSIVE },
7760
+ videoUrls: { disabled: true, reason: VIDEO1_MODE_EXCLUSIVE },
7761
+ audioUrls: { disabled: true, reason: VIDEO1_MODE_EXCLUSIVE },
7762
+ // image_to_video always follows the first frame — the ratio is not a choice.
7763
+ aspectRatio: { disabled: true, reason: VIDEO1_RATIO_FOLLOWS_FRAME }
7764
+ } },
7765
+ { when: { imageUrls: { exists: true } }, then: {
7766
+ startFrame: { disabled: true, reason: VIDEO1_MODE_EXCLUSIVE }
7767
+ } },
7768
+ { when: { videoUrls: { exists: true } }, then: {
7769
+ startFrame: { disabled: true, reason: VIDEO1_MODE_EXCLUSIVE }
7770
+ } },
7771
+ { when: { audioUrls: { exists: true } }, then: {
7772
+ startFrame: { disabled: true, reason: VIDEO1_MODE_EXCLUSIVE }
7773
+ } },
7774
+ // 'adaptive' means "follow the first reference" — no meaning without one.
7775
+ { when: { imageUrls: { exists: false }, videoUrls: { exists: false }, audioUrls: { exists: false } }, then: {
7776
+ aspectRatio: { allowed: [...VIDEO1_RATIOS], reason: VIDEO1_ADAPTIVE_NEEDS_REFS }
7777
+ } }
7778
+ ];
7753
7779
  var { MODELS: MODELS25 } = defineModels("heygen", [
7754
7780
  // ── Photo Avatar (i2v) ────────────────────────────────────────────
7755
7781
  {
@@ -7804,9 +7830,73 @@ var { MODELS: MODELS25 } = defineModels("heygen", [
7804
7830
  ...dynamicVoiceConfig,
7805
7831
  ...params.prompt({ minLength: 20, maxLength: 5e3, placeholder: "Write the script your avatar will speak (at least 20 characters)..." })
7806
7832
  }
7833
+ },
7834
+ // ── HeyGen Video (t2v / i2v / r2v) ────────────────────────────────
7835
+ {
7836
+ // One entry for all three modes: the inputs pick it — a first-frame image
7837
+ // animates that image, references generate from references, a bare prompt
7838
+ // generates from text. Payload assembly lives in heygen.payloads.ts.
7839
+ id: "heygen-video-1",
7840
+ name: "HeyGen Video",
7841
+ addedAt: "2026-10-05",
7842
+ workflow: "heygen/v1/models/video/generate",
7843
+ estimatedTime: 60,
7844
+ mode: "video",
7845
+ inputType: "t2v",
7846
+ description: "HeyGen Video \u2014 video with native audio from text, a first-frame image, or up to 12 reference images, videos and audio. Refer to references in the prompt as Picture 1, Video 1, in input order. Up to 15s at 768p.",
7847
+ features: [
7848
+ feat("Start Frame", "frame"),
7849
+ feat("Multi-Image Input", "input"),
7850
+ feat("Video Input", "input"),
7851
+ feat("Audio Input", "input"),
7852
+ feat("Audio", "audio"),
7853
+ feat("5-15 sec", "duration")
7854
+ ],
7855
+ paramConfig: {
7856
+ ...params.prompt({ maxLength: 32e3 }),
7857
+ ...params.startFrame("Start Frame", false),
7858
+ // Reference slots, reference-to-video route. The ≤12 files combined
7859
+ // across images + videos + audios stay backend-enforced.
7860
+ ...params.imageInput(9, "Reference Images", false, "reference"),
7861
+ ...params.videoInputs(3, "Reference Videos"),
7862
+ ...params.audioInputs(3, "Reference Audios"),
7863
+ ...params.resolution(["480p", "768p"], "768p"),
7864
+ ...params.durationRange(5, 15, 5),
7865
+ // 'adaptive' means "follow the references" — constrained below.
7866
+ ...params.aspectRatio(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "16:9"),
7867
+ ...p.enum("promptEnhancement", ["turbo", "quality", "disabled"], "turbo", { label: "Prompt Enhancement" }),
7868
+ // Unsigned 32-bit per the schema; sent only when the user sets it.
7869
+ ...params.seed(4294967295)
7870
+ },
7871
+ constraints: heygenVideo1Constraints
7807
7872
  }
7808
7873
  ]);
7809
7874
 
7875
+ // src/vendors/catalog/heygen.payloads.ts
7876
+ var asMediaRef = (url) => ({ type: "url", url });
7877
+ var buildHeygenVideo1Payload = (input) => {
7878
+ const hasFrame = !!input.startFrame;
7879
+ const hasReferences = !!(input.imageUrls?.length || input.videoUrls?.length || input.audioUrls?.length);
7880
+ return {
7881
+ model: "heygen-video-1",
7882
+ prompt: input.prompt,
7883
+ duration: input.duration ?? 5,
7884
+ resolution: input.resolution ?? "768p",
7885
+ prompt_enhancement: input.promptEnhancement ?? "turbo",
7886
+ // With references the default is 'adaptive' (follow the first one); from
7887
+ // the prompt alone it is 16:9.
7888
+ ...hasFrame ? {} : { aspect_ratio: input.aspectRatio ?? (hasReferences ? "adaptive" : "16:9") },
7889
+ ...input.startFrame ? { image: asMediaRef(input.startFrame) } : {},
7890
+ ...input.imageUrls?.length ? { reference_images: input.imageUrls.map(asMediaRef) } : {},
7891
+ ...input.videoUrls?.length ? { reference_videos: input.videoUrls.map(asMediaRef) } : {},
7892
+ ...input.audioUrls?.length ? { reference_audio: input.audioUrls.map(asMediaRef) } : {},
7893
+ ...input.seed != null ? { seed: input.seed } : {}
7894
+ };
7895
+ };
7896
+ registerPayloads(MODELS25, {
7897
+ "heygen-video-1": buildHeygenVideo1Payload
7898
+ });
7899
+
7810
7900
  // src/vendors/catalog/minimax.payloads.ts
7811
7901
  var buildMinimaxMusicV3Payload = (input) => ({
7812
7902
  prompt: input.prompt,
@@ -13470,6 +13560,7 @@ var Happyhorse10VideoEdit = "happyhorse-1.0-video-edit";
13470
13560
  var Happyhorse11R2v = "happyhorse-1.1-r2v";
13471
13561
  var Happyhorse11T2v = "happyhorse-1.1-t2v";
13472
13562
  var HeygenTalkingPhoto = "heygen-talking-photo";
13563
+ var HeygenVideo1 = "heygen-video-1";
13473
13564
  var HeygenVideoAvatar = "heygen-video-avatar";
13474
13565
  var HunyuanV3 = "hunyuan-v3";
13475
13566
  var Ideogram45 = "ideogram-4-5";
@@ -13725,6 +13816,7 @@ var Models = {
13725
13816
  Happyhorse11R2v,
13726
13817
  Happyhorse11T2v,
13727
13818
  HeygenTalkingPhoto,
13819
+ HeygenVideo1,
13728
13820
  HeygenVideoAvatar,
13729
13821
  HunyuanV3,
13730
13822
  Ideogram45,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "6.24.1",
3
+ "version": "6.25.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",