@picsart/ai-sdk 6.2.2 → 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 -20
  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_8bit" | "mp4" | "mov";
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_8bit" | "mp4" | "mov";
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_8bit" | "mp4" | "mov";
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_8bit" | "mp4" | "mov";
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_8bit" | "mp4" | "mov";
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_8bit" | "mp4" | "mov";
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,14 +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 = [
3887
- { id: "mp4_8bit", label: "MP4" },
3888
- { id: "mp4", label: "MP4 10Bit" },
3889
- { id: "mov", label: "MOV" }
3890
- ];
3897
+ var SEEDANCE_25_FORMATS = ["mp4", "mov"];
3898
+ var SEEDANCE_25_COLOR_DEPTHS = ["10bit", "8bit"];
3891
3899
  var SEEDANCE_V2_DURATIONS = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
3892
3900
  var SEEDANCE_25_DURATION = { min: 4, max: 30 };
3893
3901
  var { MODELS: MODELS12 } = defineModels("seedance", [
@@ -3903,7 +3911,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
3903
3911
  mode: "video",
3904
3912
  inputType: "t2v",
3905
3913
  badge: ["new", "premium", "hot"],
3906
- 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.",
3907
3915
  features: [feat("Reference Image", "frame"), feat("Start/End Frame", "frame"), feat("Audio", "audio"), feat("1080p", "resolution"), feat("4-30 sec", "duration")],
3908
3916
  paramConfig: {
3909
3917
  ...params.prompt(),
@@ -3913,6 +3921,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
3913
3921
  ...params.generateAudio(),
3914
3922
  ...params.returnLastFrame(),
3915
3923
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
3924
+ ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
3916
3925
  // 2.5 lifts the reference caps to 30 images / 10 videos / 10 audios.
3917
3926
  ...params.imageInput(30, "Reference Images", false, "reference", { minSidePixels: SEEDANCE_MIN_SIDE_PIXELS }),
3918
3927
  ...params.videoInputs(10, "Reference Videos", false, {
@@ -3941,7 +3950,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
3941
3950
  mode: "video",
3942
3951
  inputType: "t2v",
3943
3952
  badge: ["new", "premium", "hot"],
3944
- 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.",
3945
3954
  features: [feat("Reference Image", "frame"), feat("Start/End Frame", "frame"), feat("Audio", "audio"), feat("1080p", "resolution"), feat("4-30 sec", "duration")],
3946
3955
  paramConfig: {
3947
3956
  ...params.prompt(),
@@ -3951,6 +3960,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
3951
3960
  ...params.generateAudio(),
3952
3961
  ...params.returnLastFrame(),
3953
3962
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
3963
+ ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
3954
3964
  // 2.5 lifts the reference caps to 30 images / 10 videos / 10 audios.
3955
3965
  ...params.imageInput(30, "Reference Images", false, "reference", { minSidePixels: SEEDANCE_MIN_SIDE_PIXELS }),
3956
3966
  ...params.videoInputs(10, "Reference Videos", false, {
@@ -3970,7 +3980,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
3970
3980
  addedAt: "2026-08-06",
3971
3981
  workflow: "seedance",
3972
3982
  buildPayload: buildSeedance25VideoEditPayloadFor("seedance_2_5"),
3973
- constraints: seedance25FormatConstraints,
3983
+ constraints: seedance25ColorDepthConstraints,
3974
3984
  estimatedTime: 60,
3975
3985
  mode: "video",
3976
3986
  inputType: "v2v",
@@ -3986,6 +3996,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
3986
3996
  ...params.generateAudio(),
3987
3997
  ...params.returnLastFrame(),
3988
3998
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
3999
+ ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
3989
4000
  ...params.videoInput("Source Video", "reference", true, void 0, void 0, SEEDANCE_25_MAX_VIDEO_BYTES),
3990
4001
  ...params.imageInput(30, "Reference Images")
3991
4002
  }
@@ -3998,7 +4009,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
3998
4009
  release: "preview",
3999
4010
  workflow: "seedance",
4000
4011
  buildPayload: buildSeedance25VideoEditPayloadFor("seedance_2_5_without_moderation"),
4001
- constraints: seedance25FormatConstraints,
4012
+ constraints: seedance25ColorDepthConstraints,
4002
4013
  estimatedTime: 60,
4003
4014
  mode: "video",
4004
4015
  inputType: "v2v",
@@ -4014,6 +4025,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4014
4025
  ...params.generateAudio(),
4015
4026
  ...params.returnLastFrame(),
4016
4027
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
4028
+ ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
4017
4029
  ...params.videoInput("Source Video", "reference", true, void 0, void 0, SEEDANCE_25_MAX_VIDEO_BYTES),
4018
4030
  ...params.imageInput(30, "Reference Images")
4019
4031
  }
@@ -4025,7 +4037,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4025
4037
  addedAt: "2026-08-06",
4026
4038
  workflow: "seedance",
4027
4039
  buildPayload: buildSeedance25VideoExtendPayloadFor("seedance_2_5"),
4028
- constraints: seedance25FormatConstraints,
4040
+ constraints: seedance25ColorDepthConstraints,
4029
4041
  estimatedTime: 200,
4030
4042
  mode: "video",
4031
4043
  inputType: "v2v",
@@ -4041,6 +4053,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4041
4053
  ...params.durationRange(SEEDANCE_25_DURATION.min, SEEDANCE_25_DURATION.max, 15),
4042
4054
  ...params.generateAudio(),
4043
4055
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
4056
+ ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
4044
4057
  ...params.videoInputs(10, "Source Videos", true, { maxBytes: SEEDANCE_25_MAX_VIDEO_BYTES })
4045
4058
  }
4046
4059
  },
@@ -4052,7 +4065,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4052
4065
  release: "preview",
4053
4066
  workflow: "seedance",
4054
4067
  buildPayload: buildSeedance25VideoExtendPayloadFor("seedance_2_5_without_moderation"),
4055
- constraints: seedance25FormatConstraints,
4068
+ constraints: seedance25ColorDepthConstraints,
4056
4069
  estimatedTime: 200,
4057
4070
  mode: "video",
4058
4071
  inputType: "v2v",
@@ -4068,6 +4081,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4068
4081
  ...params.durationRange(SEEDANCE_25_DURATION.min, SEEDANCE_25_DURATION.max, 15),
4069
4082
  ...params.generateAudio(),
4070
4083
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
4084
+ ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
4071
4085
  ...params.videoInputs(10, "Source Videos", true, { maxBytes: SEEDANCE_25_MAX_VIDEO_BYTES })
4072
4086
  }
4073
4087
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "6.2.2",
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",