@picsart/ai-sdk 5.32.0 → 5.34.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 +42 -0
- package/index.js +134 -9
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -241,6 +241,11 @@ type ModelInputById = {
|
|
|
241
241
|
count?: 1 | 2 | 4 | 6 | 8 | 10;
|
|
242
242
|
imageUrls?: string[];
|
|
243
243
|
};
|
|
244
|
+
"flux-video-edit": {
|
|
245
|
+
videoUrl: string;
|
|
246
|
+
prompt: string;
|
|
247
|
+
safetyTolerance?: number;
|
|
248
|
+
};
|
|
244
249
|
"flux-video-upscale": {
|
|
245
250
|
videoUrl: string;
|
|
246
251
|
upscaleFactor?: number;
|
|
@@ -1465,6 +1470,39 @@ type ModelInputById = {
|
|
|
1465
1470
|
outputFormat?: "mp4" | "mov";
|
|
1466
1471
|
videoUrls: [string, ...string[]];
|
|
1467
1472
|
};
|
|
1473
|
+
"seedance-2.5-without-moderation": {
|
|
1474
|
+
prompt: string;
|
|
1475
|
+
aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
|
|
1476
|
+
resolution?: "480p" | "720p" | "1080p";
|
|
1477
|
+
duration?: number;
|
|
1478
|
+
generateAudio?: boolean;
|
|
1479
|
+
returnLastFrame?: boolean;
|
|
1480
|
+
outputFormat?: "mp4" | "mov";
|
|
1481
|
+
imageUrls?: string[];
|
|
1482
|
+
videoUrls?: string[];
|
|
1483
|
+
audioUrls?: string[];
|
|
1484
|
+
startFrame?: string;
|
|
1485
|
+
endFrame?: string;
|
|
1486
|
+
};
|
|
1487
|
+
"seedance-2.5-without-moderation-video-edit": {
|
|
1488
|
+
prompt: string;
|
|
1489
|
+
aspectRatio?: "adaptive";
|
|
1490
|
+
resolution?: "480p" | "720p" | "1080p";
|
|
1491
|
+
generateAudio?: boolean;
|
|
1492
|
+
returnLastFrame?: boolean;
|
|
1493
|
+
outputFormat?: "mp4" | "mov";
|
|
1494
|
+
videoUrl: string;
|
|
1495
|
+
imageUrls?: string[];
|
|
1496
|
+
};
|
|
1497
|
+
"seedance-2.5-without-moderation-video-extend": {
|
|
1498
|
+
prompt: string;
|
|
1499
|
+
aspectRatio?: "adaptive";
|
|
1500
|
+
resolution?: "480p" | "720p" | "1080p";
|
|
1501
|
+
duration?: number;
|
|
1502
|
+
generateAudio?: boolean;
|
|
1503
|
+
outputFormat?: "mp4" | "mov";
|
|
1504
|
+
videoUrls: [string, ...string[]];
|
|
1505
|
+
};
|
|
1468
1506
|
"seedance-i2v": {
|
|
1469
1507
|
prompt: string;
|
|
1470
1508
|
aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
|
|
@@ -2682,6 +2720,7 @@ declare const Models: {
|
|
|
2682
2720
|
readonly Flux3Video: "flux-3-video";
|
|
2683
2721
|
readonly FluxKontextMax: "flux-kontext-max";
|
|
2684
2722
|
readonly FluxKontextPro: "flux-kontext-pro";
|
|
2723
|
+
readonly FluxVideoEdit: "flux-video-edit";
|
|
2685
2724
|
readonly FluxVideoUpscale: "flux-video-upscale";
|
|
2686
2725
|
readonly Gemini25FlashImage: "gemini-2.5-flash-image";
|
|
2687
2726
|
readonly Gemini25FlashTts: "gemini-2.5-flash-tts";
|
|
@@ -2851,6 +2890,9 @@ declare const Models: {
|
|
|
2851
2890
|
readonly Seedance25: "seedance-2.5";
|
|
2852
2891
|
readonly Seedance25VideoEdit: "seedance-2.5-video-edit";
|
|
2853
2892
|
readonly Seedance25VideoExtend: "seedance-2.5-video-extend";
|
|
2893
|
+
readonly Seedance25WithoutModeration: "seedance-2.5-without-moderation";
|
|
2894
|
+
readonly Seedance25WithoutModerationVideoEdit: "seedance-2.5-without-moderation-video-edit";
|
|
2895
|
+
readonly Seedance25WithoutModerationVideoExtend: "seedance-2.5-without-moderation-video-extend";
|
|
2854
2896
|
readonly SeedanceI2v: "seedance-i2v";
|
|
2855
2897
|
readonly Seedream40: "seedream-4.0";
|
|
2856
2898
|
readonly Seedream45: "seedream-4.5";
|
package/index.js
CHANGED
|
@@ -3980,13 +3980,13 @@ var seedance25Constraints = [
|
|
|
3980
3980
|
then: { aspectRatio: { allowed: ["adaptive"], reason: SEEDANCE_25_FRAME_ADAPTIVE_REASON } }
|
|
3981
3981
|
}
|
|
3982
3982
|
];
|
|
3983
|
-
var
|
|
3983
|
+
var buildSeedance25PayloadFor = (modelAlias) => (ctx) => {
|
|
3984
3984
|
const refImages = ctx.imageUrls ?? [];
|
|
3985
3985
|
const refVideos = ctx.videoUrls ?? [];
|
|
3986
3986
|
const refAudios = ctx.audioUrls ?? [];
|
|
3987
3987
|
const usesFrame = Boolean(ctx.startFrame || ctx.endFrame);
|
|
3988
3988
|
return {
|
|
3989
|
-
model:
|
|
3989
|
+
model: modelAlias,
|
|
3990
3990
|
content: [
|
|
3991
3991
|
...ctx.startFrame ? [{ type: "image_url", image_url: { url: ctx.startFrame }, role: "first_frame" }] : [],
|
|
3992
3992
|
...refImages.slice(0, 30).map((url) => ({
|
|
@@ -4015,8 +4015,8 @@ var buildSeedance25Payload = (ctx) => {
|
|
|
4015
4015
|
...ctx.returnLastFrame ? { return_last_frame: true } : {}
|
|
4016
4016
|
};
|
|
4017
4017
|
};
|
|
4018
|
-
var
|
|
4019
|
-
model:
|
|
4018
|
+
var buildSeedance25VideoEditPayloadFor = (modelAlias) => (ctx) => ({
|
|
4019
|
+
model: modelAlias,
|
|
4020
4020
|
content: [
|
|
4021
4021
|
{ type: "text", text: ctx.prompt },
|
|
4022
4022
|
{ type: "video_url", video_url: { url: ctx.videoUrl }, role: "reference_video" },
|
|
@@ -4033,8 +4033,8 @@ var buildSeedance25VideoEditPayload = (ctx) => ({
|
|
|
4033
4033
|
output_format: ctx.outputFormat ?? "mp4",
|
|
4034
4034
|
...ctx.returnLastFrame ? { return_last_frame: true } : {}
|
|
4035
4035
|
});
|
|
4036
|
-
var
|
|
4037
|
-
model:
|
|
4036
|
+
var buildSeedance25VideoExtendPayloadFor = (modelAlias) => (ctx) => ({
|
|
4037
|
+
model: modelAlias,
|
|
4038
4038
|
content: [
|
|
4039
4039
|
{ type: "text", text: ctx.prompt },
|
|
4040
4040
|
...(ctx.videoUrls ?? []).slice(0, 10).map((url) => ({
|
|
@@ -4059,7 +4059,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
|
|
|
4059
4059
|
modelId: "seedance-2.5",
|
|
4060
4060
|
addedAt: "2026-08-06",
|
|
4061
4061
|
workflow: "seedance",
|
|
4062
|
-
buildPayload:
|
|
4062
|
+
buildPayload: buildSeedance25PayloadFor("seedance_2_5"),
|
|
4063
4063
|
constraints: seedance25Constraints,
|
|
4064
4064
|
estimatedTime: 20,
|
|
4065
4065
|
mode: "video",
|
|
@@ -4087,13 +4087,51 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
|
|
|
4087
4087
|
...params.endFrame()
|
|
4088
4088
|
}
|
|
4089
4089
|
},
|
|
4090
|
+
{
|
|
4091
|
+
// Same model as seedance-2.5 on a vendor endpoint with moderation
|
|
4092
|
+
// disabled — full capability parity, bills under the seedance-2.5
|
|
4093
|
+
// pricing key (hence the shared modelId).
|
|
4094
|
+
id: "seedance-2.5-without-moderation",
|
|
4095
|
+
name: "Seedance 2.5 Without Moderation",
|
|
4096
|
+
modelId: "seedance-2.5",
|
|
4097
|
+
addedAt: "2026-09-09",
|
|
4098
|
+
release: "preview",
|
|
4099
|
+
workflow: "seedance",
|
|
4100
|
+
buildPayload: buildSeedance25PayloadFor("seedance_2_5_without_moderation"),
|
|
4101
|
+
constraints: seedance25Constraints,
|
|
4102
|
+
estimatedTime: 20,
|
|
4103
|
+
mode: "video",
|
|
4104
|
+
inputType: "t2v",
|
|
4105
|
+
badge: ["new", "premium", "hot"],
|
|
4106
|
+
description: "Seedance 2.5 with vendor moderation disabled \u2014 cinematic video with audio, multi-reference input, and mp4/mov output. Up to 30s.",
|
|
4107
|
+
features: [feat("Reference Image", "frame"), feat("Start/End Frame", "frame"), feat("Audio", "audio"), feat("1080p", "resolution"), feat("4-30 sec", "duration")],
|
|
4108
|
+
paramConfig: {
|
|
4109
|
+
...params.prompt(),
|
|
4110
|
+
...params.aspectRatio(SEEDANCE_AR),
|
|
4111
|
+
...params.resolution(["480p", "720p", "1080p"], "1080p"),
|
|
4112
|
+
...params.durationRange(SEEDANCE_25_DURATION.min, SEEDANCE_25_DURATION.max, 5),
|
|
4113
|
+
...params.generateAudio(),
|
|
4114
|
+
...params.returnLastFrame(),
|
|
4115
|
+
...p.enum("outputFormat", ["mp4", "mov"], "mp4", { label: "Format" }),
|
|
4116
|
+
// 2.5 lifts the reference caps to 30 images / 10 videos / 10 audios.
|
|
4117
|
+
...params.imageInput(30, "Reference Images", false, "reference", { minSidePixels: SEEDANCE_MIN_SIDE_PIXELS }),
|
|
4118
|
+
...params.videoInputs(10, "Reference Videos", false, {
|
|
4119
|
+
minPixels: SEEDANCE_VIDEO_MIN_PIXELS,
|
|
4120
|
+
minSidePixels: SEEDANCE_MIN_SIDE_PIXELS,
|
|
4121
|
+
maxBytes: SEEDANCE_25_MAX_VIDEO_BYTES
|
|
4122
|
+
}),
|
|
4123
|
+
...params.audioInputs(10, "Reference Audios"),
|
|
4124
|
+
...params.startFrame(),
|
|
4125
|
+
...params.endFrame()
|
|
4126
|
+
}
|
|
4127
|
+
},
|
|
4090
4128
|
{
|
|
4091
4129
|
id: "seedance-2.5-video-edit",
|
|
4092
4130
|
name: "Seedance 2.5 Video Edit",
|
|
4093
4131
|
modelId: "seedance-2.5",
|
|
4094
4132
|
addedAt: "2026-08-06",
|
|
4095
4133
|
workflow: "seedance",
|
|
4096
|
-
buildPayload:
|
|
4134
|
+
buildPayload: buildSeedance25VideoEditPayloadFor("seedance_2_5"),
|
|
4097
4135
|
estimatedTime: 60,
|
|
4098
4136
|
mode: "video",
|
|
4099
4137
|
inputType: "v2v",
|
|
@@ -4113,13 +4151,40 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
|
|
|
4113
4151
|
...params.imageInput(30, "Reference Images")
|
|
4114
4152
|
}
|
|
4115
4153
|
},
|
|
4154
|
+
{
|
|
4155
|
+
id: "seedance-2.5-without-moderation-video-edit",
|
|
4156
|
+
name: "Seedance 2.5 Without Moderation Video Edit",
|
|
4157
|
+
modelId: "seedance-2.5",
|
|
4158
|
+
addedAt: "2026-09-09",
|
|
4159
|
+
release: "preview",
|
|
4160
|
+
workflow: "seedance",
|
|
4161
|
+
buildPayload: buildSeedance25VideoEditPayloadFor("seedance_2_5_without_moderation"),
|
|
4162
|
+
estimatedTime: 60,
|
|
4163
|
+
mode: "video",
|
|
4164
|
+
inputType: "v2v",
|
|
4165
|
+
badge: ["new", "premium", "hot"],
|
|
4166
|
+
description: "Moderation-free video edit \u2014 replace subjects, add or remove objects, restyle scenes with reference images.",
|
|
4167
|
+
features: [feat("Video Input", "input"), feat("Multi-Image Input", "input"), feat("Audio", "audio"), feat("1080p", "resolution"), feat("Source length", "duration")],
|
|
4168
|
+
paramConfig: {
|
|
4169
|
+
...params.prompt(),
|
|
4170
|
+
// Editing mode: aspect ratio is fixed to 'adaptive' and duration is
|
|
4171
|
+
// source-driven ('-1'), so neither is user-selectable (vendor rule).
|
|
4172
|
+
...params.aspectRatio(["adaptive"]),
|
|
4173
|
+
...params.resolution(["480p", "720p", "1080p"], "1080p"),
|
|
4174
|
+
...params.generateAudio(),
|
|
4175
|
+
...params.returnLastFrame(),
|
|
4176
|
+
...p.enum("outputFormat", ["mp4", "mov"], "mp4", { label: "Format" }),
|
|
4177
|
+
...params.videoInput("Source Video", "reference", true, void 0, void 0, SEEDANCE_25_MAX_VIDEO_BYTES),
|
|
4178
|
+
...params.imageInput(30, "Reference Images")
|
|
4179
|
+
}
|
|
4180
|
+
},
|
|
4116
4181
|
{
|
|
4117
4182
|
id: "seedance-2.5-video-extend",
|
|
4118
4183
|
name: "Seedance 2.5 Video Extend",
|
|
4119
4184
|
modelId: "seedance-2.5",
|
|
4120
4185
|
addedAt: "2026-08-06",
|
|
4121
4186
|
workflow: "seedance",
|
|
4122
|
-
buildPayload:
|
|
4187
|
+
buildPayload: buildSeedance25VideoExtendPayloadFor("seedance_2_5"),
|
|
4123
4188
|
estimatedTime: 200,
|
|
4124
4189
|
mode: "video",
|
|
4125
4190
|
inputType: "v2v",
|
|
@@ -4138,6 +4203,32 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
|
|
|
4138
4203
|
...params.videoInputs(10, "Source Videos", true, { maxBytes: SEEDANCE_25_MAX_VIDEO_BYTES })
|
|
4139
4204
|
}
|
|
4140
4205
|
},
|
|
4206
|
+
{
|
|
4207
|
+
id: "seedance-2.5-without-moderation-video-extend",
|
|
4208
|
+
name: "Seedance 2.5 Without Moderation Video Extend",
|
|
4209
|
+
modelId: "seedance-2.5",
|
|
4210
|
+
addedAt: "2026-09-09",
|
|
4211
|
+
release: "preview",
|
|
4212
|
+
workflow: "seedance",
|
|
4213
|
+
buildPayload: buildSeedance25VideoExtendPayloadFor("seedance_2_5_without_moderation"),
|
|
4214
|
+
estimatedTime: 200,
|
|
4215
|
+
mode: "video",
|
|
4216
|
+
inputType: "v2v",
|
|
4217
|
+
badge: ["new", "premium", "hot"],
|
|
4218
|
+
description: "Moderation-free: stitch up to 10 clips into one continuous, extended video.",
|
|
4219
|
+
features: [feat("Multi-Video Input", "input"), feat("Audio", "audio"), feat("1080p", "resolution"), feat("4-30 sec", "duration")],
|
|
4220
|
+
paramConfig: {
|
|
4221
|
+
...params.prompt(),
|
|
4222
|
+
// Extension mode: aspect ratio is locked to 'adaptive' (vendor rule);
|
|
4223
|
+
// duration stays user-selectable.
|
|
4224
|
+
...params.aspectRatio(["adaptive"]),
|
|
4225
|
+
...params.resolution(["480p", "720p", "1080p"], "1080p"),
|
|
4226
|
+
...params.durationRange(SEEDANCE_25_DURATION.min, SEEDANCE_25_DURATION.max, 15),
|
|
4227
|
+
...params.generateAudio(),
|
|
4228
|
+
...p.enum("outputFormat", ["mp4", "mov"], "mp4", { label: "Format" }),
|
|
4229
|
+
...params.videoInputs(10, "Source Videos", true, { maxBytes: SEEDANCE_25_MAX_VIDEO_BYTES })
|
|
4230
|
+
}
|
|
4231
|
+
},
|
|
4141
4232
|
{
|
|
4142
4233
|
id: "seedance-2.0",
|
|
4143
4234
|
name: "Seedance 2.0",
|
|
@@ -5775,6 +5866,32 @@ var { MODELS: MODELS21 } = defineModels("flux", [
|
|
|
5775
5866
|
// Moderation level: 0 (strict) … 4 (permissive).
|
|
5776
5867
|
...p.range("safetyTolerance", 0, 4, 2, { label: "Safety Tolerance" })
|
|
5777
5868
|
}
|
|
5869
|
+
},
|
|
5870
|
+
{
|
|
5871
|
+
// Pure pass-through like flux-video-upscale: the worker Command takes the
|
|
5872
|
+
// SDK's own field names (videoUrl, prompt, safetyTolerance) — no payload
|
|
5873
|
+
// builder needed.
|
|
5874
|
+
id: "flux-video-edit",
|
|
5875
|
+
name: "Sprout Video Edit",
|
|
5876
|
+
workflow: "flux/v1/video-edit",
|
|
5877
|
+
mode: "video",
|
|
5878
|
+
inputType: "v2v",
|
|
5879
|
+
addedAt: "2026-09-09",
|
|
5880
|
+
estimatedTime: 180,
|
|
5881
|
+
description: "Edit videos with a text instruction \u2014 change objects, styles or scenes while preserving motion, timing and audio. Source clips up to 15 seconds; output at 24 fps, up to 720p.",
|
|
5882
|
+
features: [
|
|
5883
|
+
feat("Video Required", "input"),
|
|
5884
|
+
feat("Up to 15s", "duration"),
|
|
5885
|
+
feat("720p", "resolution")
|
|
5886
|
+
],
|
|
5887
|
+
paramConfig: {
|
|
5888
|
+
// Vendor source caps: 15s, 50 MB. Also ≥160 px per side and ≥17 frames —
|
|
5889
|
+
// minimums the upload check can't express; the vendor rejects violations.
|
|
5890
|
+
...params.videoInput("Source Video", "asset", true, 15, void 0, 50 * 1024 * 1024),
|
|
5891
|
+
...params.prompt({ maxLength: 4096 }),
|
|
5892
|
+
// Moderation level: 0 (strict) … 4 (permissive).
|
|
5893
|
+
...p.range("safetyTolerance", 0, 4, 2, { label: "Safety Tolerance" })
|
|
5894
|
+
}
|
|
5778
5895
|
}
|
|
5779
5896
|
]);
|
|
5780
5897
|
|
|
@@ -11446,6 +11563,7 @@ var Flux2Pro = "flux-2-pro";
|
|
|
11446
11563
|
var Flux3Video = "flux-3-video";
|
|
11447
11564
|
var FluxKontextMax = "flux-kontext-max";
|
|
11448
11565
|
var FluxKontextPro = "flux-kontext-pro";
|
|
11566
|
+
var FluxVideoEdit = "flux-video-edit";
|
|
11449
11567
|
var FluxVideoUpscale = "flux-video-upscale";
|
|
11450
11568
|
var Gemini25FlashImage = "gemini-2.5-flash-image";
|
|
11451
11569
|
var Gemini25FlashTts = "gemini-2.5-flash-tts";
|
|
@@ -11615,6 +11733,9 @@ var Seedance20WithoutModerationVideoExtend = "seedance-2.0-without-moderation-vi
|
|
|
11615
11733
|
var Seedance25 = "seedance-2.5";
|
|
11616
11734
|
var Seedance25VideoEdit = "seedance-2.5-video-edit";
|
|
11617
11735
|
var Seedance25VideoExtend = "seedance-2.5-video-extend";
|
|
11736
|
+
var Seedance25WithoutModeration = "seedance-2.5-without-moderation";
|
|
11737
|
+
var Seedance25WithoutModerationVideoEdit = "seedance-2.5-without-moderation-video-edit";
|
|
11738
|
+
var Seedance25WithoutModerationVideoExtend = "seedance-2.5-without-moderation-video-extend";
|
|
11618
11739
|
var SeedanceI2v = "seedance-i2v";
|
|
11619
11740
|
var Seedream40 = "seedream-4.0";
|
|
11620
11741
|
var Seedream45 = "seedream-4.5";
|
|
@@ -11671,6 +11792,7 @@ var Models = {
|
|
|
11671
11792
|
Flux3Video,
|
|
11672
11793
|
FluxKontextMax,
|
|
11673
11794
|
FluxKontextPro,
|
|
11795
|
+
FluxVideoEdit,
|
|
11674
11796
|
FluxVideoUpscale,
|
|
11675
11797
|
Gemini25FlashImage,
|
|
11676
11798
|
Gemini25FlashTts,
|
|
@@ -11840,6 +11962,9 @@ var Models = {
|
|
|
11840
11962
|
Seedance25,
|
|
11841
11963
|
Seedance25VideoEdit,
|
|
11842
11964
|
Seedance25VideoExtend,
|
|
11965
|
+
Seedance25WithoutModeration,
|
|
11966
|
+
Seedance25WithoutModerationVideoEdit,
|
|
11967
|
+
Seedance25WithoutModerationVideoExtend,
|
|
11843
11968
|
SeedanceI2v,
|
|
11844
11969
|
Seedream40,
|
|
11845
11970
|
Seedream45,
|