@picsart/ai-sdk 6.50.0 → 6.51.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 -4
  2. package/index.js +18 -6
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -786,7 +786,7 @@ type ModelInputById = {
786
786
  "happyhorse-1.0-r2v": {
787
787
  prompt: string;
788
788
  seed?: number;
789
- aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4";
789
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "4:5" | "5:4";
790
790
  resolution?: "720P" | "1080P";
791
791
  duration?: number;
792
792
  imageUrls: [string, ...string[]];
@@ -794,7 +794,7 @@ type ModelInputById = {
794
794
  "happyhorse-1.0-t2v": {
795
795
  prompt: string;
796
796
  seed?: number;
797
- aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4";
797
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "4:5" | "5:4";
798
798
  resolution?: "720P" | "1080P";
799
799
  duration?: number;
800
800
  startFrame?: string;
@@ -810,7 +810,7 @@ type ModelInputById = {
810
810
  "happyhorse-1.1-r2v": {
811
811
  prompt: string;
812
812
  seed?: number;
813
- aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4";
813
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "4:5" | "5:4";
814
814
  resolution?: "720P" | "1080P";
815
815
  duration?: number;
816
816
  imageUrls: [string, ...string[]];
@@ -818,7 +818,7 @@ type ModelInputById = {
818
818
  "happyhorse-1.1-t2v": {
819
819
  prompt: string;
820
820
  seed?: number;
821
- aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4";
821
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "4:5" | "5:4";
822
822
  resolution?: "720P" | "1080P";
823
823
  duration?: number;
824
824
  startFrame?: string;
package/index.js CHANGED
@@ -3813,6 +3813,9 @@ var buildWan27VideoEditPayload = (ctx) => {
3813
3813
  };
3814
3814
  var WAN27_AR = ["16:9", "9:16", "1:1", "4:3", "3:4"];
3815
3815
  var WAN27_RES = ["720P", "1080P"];
3816
+ var WAN_V3_IMAGE_BOUNDS = { minSidePixels: 240, maxBytes: 20 * 1024 * 1024 };
3817
+ var WAN_V3_VIDEO_BOUNDS = { minDurationSec: 1, maxDurationSec: 15, maxBytes: 100 * 1024 * 1024 };
3818
+ var WAN_V3_AUDIO_BOUNDS = { maxDurationSec: 15, maxBytes: 15 * 1024 * 1024 };
3816
3819
  var WAN_V3_FRAME_REF_REASON = "Start/End frames cannot be combined with reference images, videos, or audios";
3817
3820
  var wanV3Constraints = [
3818
3821
  // any reference input active → disable frame slots
@@ -3850,6 +3853,15 @@ var wanV3Constraints = [
3850
3853
  audioUrls: { exists: false }
3851
3854
  }, then: {
3852
3855
  prompt: { required: true, reason: "Add a prompt or at least one frame or reference." }
3856
+ } },
3857
+ // Vendor: input video duration + output duration must stay within 30 s.
3858
+ // Reference videos are capped at 15 s in total, so only the 30 s option can break it.
3859
+ { when: { videoUrls: { exists: true } }, then: {
3860
+ duration: { allowed: [-1, 5, 10, 15], reason: "With a reference video, the output can be at most 15 s." }
3861
+ } },
3862
+ // Vendor: last_frame must be accompanied by first_frame.
3863
+ { when: { startFrame: { exists: false } }, then: {
3864
+ endFrame: { disabled: true, reason: "End frame requires a start frame." }
3853
3865
  } }
3854
3866
  ];
3855
3867
  var wanV3Features = [feat("Image Input", "input"), feat("Video Input", "input"), feat("Audio", "audio"), feat("Start/End Frame", "frame"), feat("1080P", "resolution"), feat("Adaptive Ratio", "resolution")];
@@ -3870,11 +3882,11 @@ var wanV3ParamConfig = {
3870
3882
  // Vendor default is 'adaptive' (model chooses from intent and input media).
3871
3883
  ...params.aspectRatio(["16:9", "9:16", "1:1", "4:3", "3:4", "adaptive"], "adaptive"),
3872
3884
  ...params.generateAudio(true),
3873
- ...params.startFrame(),
3874
- ...params.endFrame(),
3875
- ...params.imageInput(10, "Reference Images"),
3876
- ...params.videoInputs(5, "Reference Videos", false),
3877
- ...params.audioInputs(5, "Reference Audios"),
3885
+ ...params.startFrame("Start Frame", false, WAN_V3_IMAGE_BOUNDS),
3886
+ ...params.endFrame("End Frame", WAN_V3_IMAGE_BOUNDS),
3887
+ ...params.imageInput(10, "Reference Images", false, "reference", WAN_V3_IMAGE_BOUNDS),
3888
+ ...params.videoInputs(5, "Reference Videos", false, WAN_V3_VIDEO_BOUNDS),
3889
+ ...params.audioInputs(5, "Reference Audios", false, WAN_V3_AUDIO_BOUNDS),
3878
3890
  ...p.boolean("enableThinking", false, "Deep Thinking"),
3879
3891
  ...p.boolean("watermark", false, "Watermark"),
3880
3892
  // No default: a materialized seed would pin every generation to one value.
@@ -9933,7 +9945,7 @@ var buildHH11R2VPayload = (ctx) => {
9933
9945
  ...ctx.seed != null ? { seed: ctx.seed } : {}
9934
9946
  };
9935
9947
  };
9936
- var HH_AR = ["16:9", "9:16", "1:1", "4:3", "3:4"];
9948
+ var HH_AR = ["16:9", "9:16", "1:1", "4:3", "3:4", "4:5", "5:4"];
9937
9949
  var HH_RES = ["720P", "1080P"];
9938
9950
  var { MODELS: MODELS31 } = defineModels("happyhorse", [
9939
9951
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "6.50.0",
3
+ "version": "6.51.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",