@picsart/ai-sdk 6.2.1 → 6.2.3

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 +13 -6
  2. package/index.js +34 -16
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1509,7 +1509,8 @@ type ModelInputById = {
1509
1509
  duration?: number;
1510
1510
  generateAudio?: boolean;
1511
1511
  returnLastFrame?: boolean;
1512
- outputFormat?: "mp4" | "mov" | "mp4_8bit";
1512
+ outputFormat?: "mp4" | "mov";
1513
+ colorDepth?: "10bit" | "8bit";
1513
1514
  imageUrls?: string[];
1514
1515
  videoUrls?: string[];
1515
1516
  audioUrls?: string[];
@@ -1522,7 +1523,8 @@ type ModelInputById = {
1522
1523
  resolution?: "480p" | "720p" | "1080p";
1523
1524
  generateAudio?: boolean;
1524
1525
  returnLastFrame?: boolean;
1525
- outputFormat?: "mp4" | "mov" | "mp4_8bit";
1526
+ outputFormat?: "mp4" | "mov";
1527
+ colorDepth?: "10bit" | "8bit";
1526
1528
  videoUrl: string;
1527
1529
  imageUrls?: string[];
1528
1530
  };
@@ -1532,7 +1534,8 @@ type ModelInputById = {
1532
1534
  resolution?: "480p" | "720p" | "1080p";
1533
1535
  duration?: number;
1534
1536
  generateAudio?: boolean;
1535
- outputFormat?: "mp4" | "mov" | "mp4_8bit";
1537
+ outputFormat?: "mp4" | "mov";
1538
+ colorDepth?: "10bit" | "8bit";
1536
1539
  videoUrls: [string, ...string[]];
1537
1540
  };
1538
1541
  "seedance-2.5-without-moderation": {
@@ -1542,7 +1545,8 @@ type ModelInputById = {
1542
1545
  duration?: number;
1543
1546
  generateAudio?: boolean;
1544
1547
  returnLastFrame?: boolean;
1545
- outputFormat?: "mp4" | "mov" | "mp4_8bit";
1548
+ outputFormat?: "mp4" | "mov";
1549
+ colorDepth?: "10bit" | "8bit";
1546
1550
  imageUrls?: string[];
1547
1551
  videoUrls?: string[];
1548
1552
  audioUrls?: string[];
@@ -1555,7 +1559,8 @@ type ModelInputById = {
1555
1559
  resolution?: "480p" | "720p" | "1080p";
1556
1560
  generateAudio?: boolean;
1557
1561
  returnLastFrame?: boolean;
1558
- outputFormat?: "mp4" | "mov" | "mp4_8bit";
1562
+ outputFormat?: "mp4" | "mov";
1563
+ colorDepth?: "10bit" | "8bit";
1559
1564
  videoUrl: string;
1560
1565
  imageUrls?: string[];
1561
1566
  };
@@ -1565,7 +1570,8 @@ type ModelInputById = {
1565
1570
  resolution?: "480p" | "720p" | "1080p";
1566
1571
  duration?: number;
1567
1572
  generateAudio?: boolean;
1568
- outputFormat?: "mp4" | "mov" | "mp4_8bit";
1573
+ outputFormat?: "mp4" | "mov";
1574
+ colorDepth?: "10bit" | "8bit";
1569
1575
  videoUrls: [string, ...string[]];
1570
1576
  };
1571
1577
  "seedance-i2v": {
@@ -2312,6 +2318,7 @@ interface GenerationContext {
2312
2318
  returnLastFrame?: boolean;
2313
2319
  background?: string;
2314
2320
  outputFormat?: string;
2321
+ colorDepth?: string;
2315
2322
  guidance?: number;
2316
2323
  seed?: number;
2317
2324
  substyle?: string;
package/index.js CHANGED
@@ -3784,11 +3784,18 @@ var buildSeedance20VideoExtendPayloadFor = (modelAlias) => (ctx) => ({
3784
3784
  resolution: ctx.resolution ?? "720p",
3785
3785
  generate_audio: ctx.generateAudio ?? true
3786
3786
  });
3787
- var SEEDANCE_25_8BIT_REASON = "8-bit MP4 applies to 1080p only \u2014 480p and 720p are already 8-bit H.264.";
3788
- var seedance25FormatConstraints = ["480p", "720p"].map((resolution) => ({
3789
- when: { resolution: { is: resolution } },
3790
- then: { outputFormat: { allowed: ["mp4", "mov"], reason: SEEDANCE_25_8BIT_REASON } }
3791
- }));
3787
+ var SEEDANCE_25_DEPTH_RESOLUTION_REASON = "Color depth applies to 1080p only \u2014 480p and 720p are always 8-bit.";
3788
+ var SEEDANCE_25_DEPTH_CONTAINER_REASON = "Color depth applies to the mp4 container only.";
3789
+ var seedance25ColorDepthConstraints = [
3790
+ ...["480p", "720p"].map((resolution) => ({
3791
+ when: { resolution: { is: resolution } },
3792
+ then: { colorDepth: { disabled: true, reason: SEEDANCE_25_DEPTH_RESOLUTION_REASON } }
3793
+ })),
3794
+ {
3795
+ when: { outputFormat: { is: "mov" } },
3796
+ then: { colorDepth: { disabled: true, reason: SEEDANCE_25_DEPTH_CONTAINER_REASON } }
3797
+ }
3798
+ ];
3792
3799
  var SEEDANCE_25_FRAME_ADAPTIVE_REASON = "First/Last Frame mode requires an adaptive aspect ratio \u2014 the vendor rejects any fixed ratio.";
3793
3800
  var seedance25Constraints = [
3794
3801
  ...seedance20Constraints.slice(1),
@@ -3811,8 +3818,12 @@ var seedance25Constraints = [
3811
3818
  when: { endFrame: { exists: true } },
3812
3819
  then: { aspectRatio: { allowed: ["adaptive"], reason: SEEDANCE_25_FRAME_ADAPTIVE_REASON } }
3813
3820
  },
3814
- ...seedance25FormatConstraints
3821
+ ...seedance25ColorDepthConstraints
3815
3822
  ];
3823
+ var seedance25OutputFormat = (ctx) => {
3824
+ if (ctx.outputFormat === "mov") return "mov";
3825
+ return ctx.colorDepth === "8bit" ? "mp4_8bit" : "mp4";
3826
+ };
3816
3827
  var buildSeedance25PayloadFor = (modelAlias) => (ctx) => {
3817
3828
  const refImages = ctx.imageUrls ?? [];
3818
3829
  const refVideos = ctx.videoUrls ?? [];
@@ -3844,7 +3855,7 @@ var buildSeedance25PayloadFor = (modelAlias) => (ctx) => {
3844
3855
  duration: ctx.duration ?? 5,
3845
3856
  resolution: ctx.resolution ?? "1080p",
3846
3857
  generate_audio: ctx.generateAudio ?? true,
3847
- output_format: ctx.outputFormat ?? "mp4",
3858
+ output_format: seedance25OutputFormat(ctx),
3848
3859
  ...ctx.returnLastFrame ? { return_last_frame: true } : {}
3849
3860
  };
3850
3861
  };
@@ -3863,7 +3874,7 @@ var buildSeedance25VideoEditPayloadFor = (modelAlias) => (ctx) => ({
3863
3874
  duration: -1,
3864
3875
  resolution: ctx.resolution ?? "1080p",
3865
3876
  generate_audio: ctx.generateAudio ?? true,
3866
- output_format: ctx.outputFormat ?? "mp4",
3877
+ output_format: seedance25OutputFormat(ctx),
3867
3878
  ...ctx.returnLastFrame ? { return_last_frame: true } : {}
3868
3879
  });
3869
3880
  var buildSeedance25VideoExtendPayloadFor = (modelAlias) => (ctx) => ({
@@ -3880,10 +3891,11 @@ var buildSeedance25VideoExtendPayloadFor = (modelAlias) => (ctx) => ({
3880
3891
  duration: ctx.duration ?? 15,
3881
3892
  resolution: ctx.resolution ?? "1080p",
3882
3893
  generate_audio: ctx.generateAudio ?? true,
3883
- output_format: ctx.outputFormat ?? "mp4"
3894
+ output_format: seedance25OutputFormat(ctx)
3884
3895
  });
3885
3896
  var SEEDANCE_AR = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "adaptive"];
3886
- var SEEDANCE_25_FORMATS = ["mp4", "mov", { id: "mp4_8bit", label: "MP4 8-bit" }];
3897
+ var SEEDANCE_25_FORMATS = ["mp4", "mov"];
3898
+ var SEEDANCE_25_COLOR_DEPTHS = ["10bit", "8bit"];
3887
3899
  var SEEDANCE_V2_DURATIONS = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
3888
3900
  var SEEDANCE_25_DURATION = { min: 4, max: 30 };
3889
3901
  var { MODELS: MODELS12 } = defineModels("seedance", [
@@ -3899,7 +3911,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
3899
3911
  mode: "video",
3900
3912
  inputType: "t2v",
3901
3913
  badge: ["new", "premium", "hot"],
3902
- description: "Latest cinematic video with audio, multi-reference input, and mp4/mov/8-bit output. Up to 30s.",
3914
+ description: "Latest cinematic video with audio, multi-reference input, and mp4/mov output in 10- or 8-bit. Up to 30s.",
3903
3915
  features: [feat("Reference Image", "frame"), feat("Start/End Frame", "frame"), feat("Audio", "audio"), feat("1080p", "resolution"), feat("4-30 sec", "duration")],
3904
3916
  paramConfig: {
3905
3917
  ...params.prompt(),
@@ -3909,6 +3921,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
3909
3921
  ...params.generateAudio(),
3910
3922
  ...params.returnLastFrame(),
3911
3923
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
3924
+ ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
3912
3925
  // 2.5 lifts the reference caps to 30 images / 10 videos / 10 audios.
3913
3926
  ...params.imageInput(30, "Reference Images", false, "reference", { minSidePixels: SEEDANCE_MIN_SIDE_PIXELS }),
3914
3927
  ...params.videoInputs(10, "Reference Videos", false, {
@@ -3937,7 +3950,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
3937
3950
  mode: "video",
3938
3951
  inputType: "t2v",
3939
3952
  badge: ["new", "premium", "hot"],
3940
- description: "Seedance 2.5 with vendor moderation disabled \u2014 cinematic video with audio, multi-reference input, and mp4/mov/8-bit output. Up to 30s.",
3953
+ description: "Seedance 2.5 with vendor moderation disabled \u2014 cinematic video with audio, multi-reference input, and mp4/mov output in 10- or 8-bit. Up to 30s.",
3941
3954
  features: [feat("Reference Image", "frame"), feat("Start/End Frame", "frame"), feat("Audio", "audio"), feat("1080p", "resolution"), feat("4-30 sec", "duration")],
3942
3955
  paramConfig: {
3943
3956
  ...params.prompt(),
@@ -3947,6 +3960,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
3947
3960
  ...params.generateAudio(),
3948
3961
  ...params.returnLastFrame(),
3949
3962
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
3963
+ ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
3950
3964
  // 2.5 lifts the reference caps to 30 images / 10 videos / 10 audios.
3951
3965
  ...params.imageInput(30, "Reference Images", false, "reference", { minSidePixels: SEEDANCE_MIN_SIDE_PIXELS }),
3952
3966
  ...params.videoInputs(10, "Reference Videos", false, {
@@ -3966,7 +3980,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
3966
3980
  addedAt: "2026-08-06",
3967
3981
  workflow: "seedance",
3968
3982
  buildPayload: buildSeedance25VideoEditPayloadFor("seedance_2_5"),
3969
- constraints: seedance25FormatConstraints,
3983
+ constraints: seedance25ColorDepthConstraints,
3970
3984
  estimatedTime: 60,
3971
3985
  mode: "video",
3972
3986
  inputType: "v2v",
@@ -3982,6 +3996,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
3982
3996
  ...params.generateAudio(),
3983
3997
  ...params.returnLastFrame(),
3984
3998
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
3999
+ ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
3985
4000
  ...params.videoInput("Source Video", "reference", true, void 0, void 0, SEEDANCE_25_MAX_VIDEO_BYTES),
3986
4001
  ...params.imageInput(30, "Reference Images")
3987
4002
  }
@@ -3994,7 +4009,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
3994
4009
  release: "preview",
3995
4010
  workflow: "seedance",
3996
4011
  buildPayload: buildSeedance25VideoEditPayloadFor("seedance_2_5_without_moderation"),
3997
- constraints: seedance25FormatConstraints,
4012
+ constraints: seedance25ColorDepthConstraints,
3998
4013
  estimatedTime: 60,
3999
4014
  mode: "video",
4000
4015
  inputType: "v2v",
@@ -4010,6 +4025,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4010
4025
  ...params.generateAudio(),
4011
4026
  ...params.returnLastFrame(),
4012
4027
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
4028
+ ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
4013
4029
  ...params.videoInput("Source Video", "reference", true, void 0, void 0, SEEDANCE_25_MAX_VIDEO_BYTES),
4014
4030
  ...params.imageInput(30, "Reference Images")
4015
4031
  }
@@ -4021,7 +4037,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4021
4037
  addedAt: "2026-08-06",
4022
4038
  workflow: "seedance",
4023
4039
  buildPayload: buildSeedance25VideoExtendPayloadFor("seedance_2_5"),
4024
- constraints: seedance25FormatConstraints,
4040
+ constraints: seedance25ColorDepthConstraints,
4025
4041
  estimatedTime: 200,
4026
4042
  mode: "video",
4027
4043
  inputType: "v2v",
@@ -4037,6 +4053,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4037
4053
  ...params.durationRange(SEEDANCE_25_DURATION.min, SEEDANCE_25_DURATION.max, 15),
4038
4054
  ...params.generateAudio(),
4039
4055
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
4056
+ ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
4040
4057
  ...params.videoInputs(10, "Source Videos", true, { maxBytes: SEEDANCE_25_MAX_VIDEO_BYTES })
4041
4058
  }
4042
4059
  },
@@ -4048,7 +4065,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4048
4065
  release: "preview",
4049
4066
  workflow: "seedance",
4050
4067
  buildPayload: buildSeedance25VideoExtendPayloadFor("seedance_2_5_without_moderation"),
4051
- constraints: seedance25FormatConstraints,
4068
+ constraints: seedance25ColorDepthConstraints,
4052
4069
  estimatedTime: 200,
4053
4070
  mode: "video",
4054
4071
  inputType: "v2v",
@@ -4064,6 +4081,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4064
4081
  ...params.durationRange(SEEDANCE_25_DURATION.min, SEEDANCE_25_DURATION.max, 15),
4065
4082
  ...params.generateAudio(),
4066
4083
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
4084
+ ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
4067
4085
  ...params.videoInputs(10, "Source Videos", true, { maxBytes: SEEDANCE_25_MAX_VIDEO_BYTES })
4068
4086
  }
4069
4087
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "6.2.1",
3
+ "version": "6.2.3",
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",