@picsart/ai-sdk 5.5.1 → 5.6.1

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 +41 -8
  2. package/index.js +123 -20
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1059,31 +1059,27 @@ type ModelInputById = {
1059
1059
  };
1060
1060
  "recraftv4_styles": {
1061
1061
  prompt: string;
1062
+ styleReferenceUrls: [string, ...string[]];
1062
1063
  aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
1063
1064
  count?: 1 | 2 | 4 | 6;
1064
- imageUrls?: string[];
1065
- imageWeight?: number;
1066
1065
  };
1067
1066
  "recraftv4_styles_pro": {
1068
1067
  prompt: string;
1068
+ styleReferenceUrls: [string, ...string[]];
1069
1069
  aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
1070
1070
  count?: 1 | 2 | 4 | 6;
1071
- imageUrls?: string[];
1072
- imageWeight?: number;
1073
1071
  };
1074
1072
  "recraftv4_styles_pro_vector": {
1075
1073
  prompt: string;
1074
+ styleReferenceUrls: [string, ...string[]];
1076
1075
  aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
1077
1076
  count?: 1 | 2 | 4 | 6;
1078
- imageUrls?: string[];
1079
- imageWeight?: number;
1080
1077
  };
1081
1078
  "recraftv4_styles_vector": {
1082
1079
  prompt: string;
1080
+ styleReferenceUrls: [string, ...string[]];
1083
1081
  aspectRatio?: "1:1" | "4:3" | "3:4" | "3:2" | "2:3" | "16:9" | "9:16" | "2:1" | "1:2";
1084
1082
  count?: 1 | 2 | 4 | 6;
1085
- imageUrls?: string[];
1086
- imageWeight?: number;
1087
1083
  };
1088
1084
  "recraftv4_vector": {
1089
1085
  prompt: string;
@@ -1258,6 +1254,37 @@ type ModelInputById = {
1258
1254
  generateAudio?: boolean;
1259
1255
  videoUrls: [string, ...string[]];
1260
1256
  };
1257
+ "seedance-2.0-without-moderation": {
1258
+ prompt: string;
1259
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
1260
+ resolution?: "480p" | "720p" | "1080p" | "4k";
1261
+ duration?: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
1262
+ generateAudio?: boolean;
1263
+ returnLastFrame?: boolean;
1264
+ imageUrls?: string[];
1265
+ videoUrls?: string[];
1266
+ audioUrls?: string[];
1267
+ startFrame?: string;
1268
+ endFrame?: string;
1269
+ };
1270
+ "seedance-2.0-without-moderation-video-edit": {
1271
+ prompt: string;
1272
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
1273
+ resolution?: "480p" | "720p" | "1080p" | "4k";
1274
+ duration?: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
1275
+ generateAudio?: boolean;
1276
+ returnLastFrame?: boolean;
1277
+ videoUrl: string;
1278
+ imageUrls?: string[];
1279
+ };
1280
+ "seedance-2.0-without-moderation-video-extend": {
1281
+ prompt: string;
1282
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
1283
+ resolution?: "480p" | "720p" | "1080p" | "4k";
1284
+ duration?: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
1285
+ generateAudio?: boolean;
1286
+ videoUrls: [string, ...string[]];
1287
+ };
1261
1288
  "seedance-2.5": {
1262
1289
  prompt: string;
1263
1290
  aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
@@ -1979,6 +2006,9 @@ interface GenerationContext {
1979
2006
  language?: string;
1980
2007
  accent?: string;
1981
2008
  style?: string;
2009
+ /** Recraft V4 Styles — style-reference image URLs (max 5, t2i only).
2010
+ * Required: the V4 Styles API rejects requests without a style. */
2011
+ styleReferenceUrls?: string[];
1982
2012
  quality?: string;
1983
2013
  size?: string;
1984
2014
  negativePrompt?: string;
@@ -2548,6 +2578,9 @@ declare const Models: {
2548
2578
  readonly Seedance20MiniVideoExtend: "seedance-2.0-mini-video-extend";
2549
2579
  readonly Seedance20VideoEdit: "seedance-2.0-video-edit";
2550
2580
  readonly Seedance20VideoExtend: "seedance-2.0-video-extend";
2581
+ readonly Seedance20WithoutModeration: "seedance-2.0-without-moderation";
2582
+ readonly Seedance20WithoutModerationVideoEdit: "seedance-2.0-without-moderation-video-edit";
2583
+ readonly Seedance20WithoutModerationVideoExtend: "seedance-2.0-without-moderation-video-extend";
2551
2584
  readonly Seedance25: "seedance-2.5";
2552
2585
  readonly Seedance25VideoEdit: "seedance-2.5-video-edit";
2553
2586
  readonly Seedance25VideoExtend: "seedance-2.5-video-extend";
package/index.js CHANGED
@@ -4201,6 +4201,40 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4201
4201
  ...params.endFrame()
4202
4202
  }
4203
4203
  },
4204
+ {
4205
+ // Same model as seedance-2.0 on a vendor endpoint with moderation
4206
+ // disabled — full capability parity, bills under the seedance-2.0
4207
+ // pricing key (hence the shared modelId).
4208
+ id: "seedance-2.0-without-moderation",
4209
+ name: "Seedance 2.0 Without Moderation",
4210
+ modelId: "seedance-2.0",
4211
+ addedAt: "2026-08-17",
4212
+ release: "preview",
4213
+ workflow: "seedance",
4214
+ buildPayload: buildSeedance20PayloadFor("seedance_2_0_without_moderation"),
4215
+ constraints: seedance20Constraints,
4216
+ estimatedTime: 15,
4217
+ mode: "video",
4218
+ inputType: "t2v",
4219
+ badge: ["new", "premium", "hot"],
4220
+ description: "Seedance 2.0 with vendor moderation disabled \u2014 cinematic video with optional audio and reference image. Up to 4K.",
4221
+ features: [feat("Reference Image", "frame"), feat("Start/End Frame", "frame"), feat("Audio", "audio"), feat("4K", "resolution"), feat("4-15 sec", "duration")],
4222
+ paramConfig: {
4223
+ ...params.prompt(),
4224
+ ...params.aspectRatio(SEEDANCE_AR),
4225
+ ...params.resolution(["480p", "720p", "1080p", "4k"], "720p"),
4226
+ ...params.duration(SEEDANCE_V2_DURATIONS, 10),
4227
+ ...params.generateAudio(),
4228
+ ...params.returnLastFrame(),
4229
+ // Reference roles map directly to backend `reference_*` content entries.
4230
+ // start/end frame stay on their own named slots.
4231
+ ...params.imageInput(9, "Reference Images", false, "reference", SEEDANCE_MIN_PIXELS),
4232
+ ...params.videoInputs(3, "Reference Videos", false, SEEDANCE_MIN_PIXELS),
4233
+ ...params.audioInputs(3, "Reference Audios"),
4234
+ ...params.startFrame(),
4235
+ ...params.endFrame()
4236
+ }
4237
+ },
4204
4238
  {
4205
4239
  id: "seedance-2.0-fast",
4206
4240
  name: "Seedance 2.0 Fast",
@@ -4285,6 +4319,31 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4285
4319
  ...params.imageInput(9, "Reference Images")
4286
4320
  }
4287
4321
  },
4322
+ {
4323
+ id: "seedance-2.0-without-moderation-video-edit",
4324
+ name: "Seedance 2.0 Without Moderation Video Edit",
4325
+ modelId: "seedance-2.0",
4326
+ addedAt: "2026-08-17",
4327
+ release: "preview",
4328
+ workflow: "seedance",
4329
+ buildPayload: buildSeedance20VideoEditPayloadFor("seedance_2_0_without_moderation"),
4330
+ estimatedTime: 77,
4331
+ mode: "video",
4332
+ inputType: "v2v",
4333
+ badge: ["new", "premium", "hot"],
4334
+ description: "Moderation-free video edit \u2014 replace subjects, add or remove objects, restyle scenes with reference images.",
4335
+ features: [feat("Video Input", "input"), feat("Multi-Image Input", "input"), feat("Audio", "audio"), feat("4K", "resolution"), feat("4-15 sec", "duration")],
4336
+ paramConfig: {
4337
+ ...params.prompt(),
4338
+ ...params.aspectRatio(SEEDANCE_AR),
4339
+ ...params.resolution(["480p", "720p", "1080p", "4k"], "720p"),
4340
+ ...params.duration(SEEDANCE_V2_DURATIONS, 5),
4341
+ ...params.generateAudio(),
4342
+ ...params.returnLastFrame(),
4343
+ ...params.videoInput("Source Video"),
4344
+ ...params.imageInput(9, "Reference Images")
4345
+ }
4346
+ },
4288
4347
  {
4289
4348
  id: "seedance-2.0-fast-video-edit",
4290
4349
  name: "Seedance 2.0 Fast Video Edit",
@@ -4355,6 +4414,29 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4355
4414
  ...params.videoInputs(3, "Source Videos", true)
4356
4415
  }
4357
4416
  },
4417
+ {
4418
+ id: "seedance-2.0-without-moderation-video-extend",
4419
+ name: "Seedance 2.0 Without Moderation Video Extend",
4420
+ modelId: "seedance-2.0",
4421
+ addedAt: "2026-08-17",
4422
+ release: "preview",
4423
+ workflow: "seedance",
4424
+ buildPayload: buildSeedance20VideoExtendPayloadFor("seedance_2_0_without_moderation"),
4425
+ estimatedTime: 400,
4426
+ mode: "video",
4427
+ inputType: "v2v",
4428
+ badge: ["new", "premium", "hot"],
4429
+ description: "Moderation-free: stitch up to 3 clips into one continuous, extended video.",
4430
+ features: [feat("Multi-Video Input", "input"), feat("Audio", "audio"), feat("4K", "resolution"), feat("4-15 sec", "duration")],
4431
+ paramConfig: {
4432
+ ...params.prompt(),
4433
+ ...params.aspectRatio(SEEDANCE_AR),
4434
+ ...params.resolution(["480p", "720p", "1080p", "4k"], "720p"),
4435
+ ...params.duration(SEEDANCE_V2_DURATIONS, 15),
4436
+ ...params.generateAudio(),
4437
+ ...params.videoInputs(3, "Source Videos", true)
4438
+ }
4439
+ },
4358
4440
  {
4359
4441
  id: "seedance-2.0-fast-video-extend",
4360
4442
  name: "Seedance 2.0 Fast Video Extend",
@@ -6917,6 +6999,18 @@ var buildRecraftUtilityPayload = (includePrompt) => (ctx) => ({
6917
6999
  image_url: ctx.imageUrls?.[0],
6918
7000
  ...includePrompt && ctx.prompt ? { prompt: ctx.prompt } : {}
6919
7001
  });
7002
+ var buildRecraftV4StylesPayload = (apiModel) => (ctx) => {
7003
+ if (!ctx.styleReferenceUrls?.length) {
7004
+ throw new Error("V4 Styles models require styleReferenceUrls");
7005
+ }
7006
+ return {
7007
+ prompt: ctx.prompt,
7008
+ model: apiModel,
7009
+ n: ctx.count ?? 1,
7010
+ ...ctx.aspectRatio ? { size: ctx.aspectRatio } : {},
7011
+ style_reference_urls: ctx.styleReferenceUrls
7012
+ };
7013
+ };
6920
7014
  var buildRecraftV4VariantPayload = (apiModel) => (ctx) => ({
6921
7015
  prompt: ctx.prompt,
6922
7016
  model: apiModel,
@@ -6933,6 +7027,13 @@ var buildRecraftExploreSimilarPayload = (ctx) => ({
6933
7027
  similarity: ctx.similarity ?? 3,
6934
7028
  ...ctx.aspectRatio ? { size: ctx.aspectRatio } : {}
6935
7029
  });
7030
+ var v4StylesParams = p.file("styleReferenceUrls", "image", {
7031
+ label: "Style References",
7032
+ required: true,
7033
+ array: { min: 1, max: 5 },
7034
+ category: "reference",
7035
+ maxBytes: 10 * 1024 * 1024
7036
+ });
6936
7037
  var { MODELS: MODELS29 } = defineModels("recraft", [
6937
7038
  // ── V4.1 family (raster only — vector variants exist in API but not exposed here) ─
6938
7039
  {
@@ -7232,18 +7333,17 @@ var { MODELS: MODELS29 } = defineModels("recraft", [
7232
7333
  name: "Recraft V4 Styles",
7233
7334
  addedAt: "2026-08-14",
7234
7335
  workflow: "recraft/v1/images/generations",
7235
- buildPayload: buildRecraftV4VariantPayload("recraftv4_styles"),
7336
+ buildPayload: buildRecraftV4StylesPayload("recraftv4_styles"),
7236
7337
  estimatedTime: 17,
7237
7338
  mode: "image",
7238
7339
  inputType: "t2i",
7239
7340
  description: "Style-focused raster output with 10K-character prompts.",
7240
- features: [feat("Image Input", "input"), feat("Text in Image", "characteristic"), feat("10K Prompt", "characteristic")],
7341
+ features: [feat("Style References", "style"), feat("Text in Image", "characteristic"), feat("10K Prompt", "characteristic")],
7241
7342
  paramConfig: {
7242
7343
  ...params.prompt({ maxLength: 1e4 }),
7344
+ ...v4StylesParams,
7243
7345
  ...params.aspectRatio(recraftAspectRatios, "1:1"),
7244
- ...params.count([1, 2, 4, 6]),
7245
- ...params.imageInput(1, "Source Image"),
7246
- ...params.imageWeight(0, 100, 80, 5)
7346
+ ...params.count([1, 2, 4, 6])
7247
7347
  }
7248
7348
  },
7249
7349
  {
@@ -7251,18 +7351,17 @@ var { MODELS: MODELS29 } = defineModels("recraft", [
7251
7351
  name: "Recraft V4 Styles Vector",
7252
7352
  addedAt: "2026-08-14",
7253
7353
  workflow: "recraft/v1/images/generations",
7254
- buildPayload: buildRecraftV4VariantPayload("recraftv4_styles_vector"),
7354
+ buildPayload: buildRecraftV4StylesPayload("recraftv4_styles_vector"),
7255
7355
  estimatedTime: 22,
7256
7356
  mode: "image",
7257
7357
  inputType: "t2i",
7258
7358
  description: "Style-focused SVG vector output with 10K-character prompts.",
7259
- features: [feat("Image Input", "input"), feat("Vector/SVG", "characteristic"), feat("10K Prompt", "characteristic")],
7359
+ features: [feat("Style References", "style"), feat("Vector/SVG", "characteristic"), feat("10K Prompt", "characteristic")],
7260
7360
  paramConfig: {
7261
7361
  ...params.prompt({ maxLength: 1e4 }),
7362
+ ...v4StylesParams,
7262
7363
  ...params.aspectRatio(recraftAspectRatios, "1:1"),
7263
- ...params.count([1, 2, 4, 6]),
7264
- ...params.imageInput(1, "Source Image"),
7265
- ...params.imageWeight(0, 100, 80, 5)
7364
+ ...params.count([1, 2, 4, 6])
7266
7365
  }
7267
7366
  },
7268
7367
  {
@@ -7270,19 +7369,18 @@ var { MODELS: MODELS29 } = defineModels("recraft", [
7270
7369
  name: "Recraft V4 Styles Pro",
7271
7370
  addedAt: "2026-08-14",
7272
7371
  workflow: "recraft/v1/images/generations",
7273
- buildPayload: buildRecraftV4VariantPayload("recraftv4_styles_pro"),
7372
+ buildPayload: buildRecraftV4StylesPayload("recraftv4_styles_pro"),
7274
7373
  estimatedTime: 35,
7275
7374
  mode: "image",
7276
7375
  inputType: "t2i",
7277
7376
  badge: ["premium"],
7278
7377
  description: "Pro-quality style-focused raster output with enhanced detail and 10K-character prompts.",
7279
- features: [feat("Image Input", "input"), feat("Text in Image", "characteristic"), feat("10K Prompt", "characteristic")],
7378
+ features: [feat("Style References", "style"), feat("Text in Image", "characteristic"), feat("10K Prompt", "characteristic")],
7280
7379
  paramConfig: {
7281
7380
  ...params.prompt({ maxLength: 1e4 }),
7381
+ ...v4StylesParams,
7282
7382
  ...params.aspectRatio(recraftAspectRatios, "1:1"),
7283
- ...params.count([1, 2, 4, 6]),
7284
- ...params.imageInput(1, "Source Image"),
7285
- ...params.imageWeight(0, 100, 80, 5)
7383
+ ...params.count([1, 2, 4, 6])
7286
7384
  }
7287
7385
  },
7288
7386
  {
@@ -7290,19 +7388,18 @@ var { MODELS: MODELS29 } = defineModels("recraft", [
7290
7388
  name: "Recraft V4 Styles Pro Vector",
7291
7389
  addedAt: "2026-08-14",
7292
7390
  workflow: "recraft/v1/images/generations",
7293
- buildPayload: buildRecraftV4VariantPayload("recraftv4_styles_pro_vector"),
7391
+ buildPayload: buildRecraftV4StylesPayload("recraftv4_styles_pro_vector"),
7294
7392
  estimatedTime: 35,
7295
7393
  mode: "image",
7296
7394
  inputType: "t2i",
7297
7395
  badge: ["premium"],
7298
7396
  description: "Pro-quality style-focused SVG vector output with enhanced detail and 10K-character prompts.",
7299
- features: [feat("Image Input", "input"), feat("Vector/SVG", "characteristic"), feat("10K Prompt", "characteristic")],
7397
+ features: [feat("Style References", "style"), feat("Vector/SVG", "characteristic"), feat("10K Prompt", "characteristic")],
7300
7398
  paramConfig: {
7301
7399
  ...params.prompt({ maxLength: 1e4 }),
7400
+ ...v4StylesParams,
7302
7401
  ...params.aspectRatio(recraftAspectRatios, "1:1"),
7303
- ...params.count([1, 2, 4, 6]),
7304
- ...params.imageInput(1, "Source Image"),
7305
- ...params.imageWeight(0, 100, 80, 5)
7402
+ ...params.count([1, 2, 4, 6])
7306
7403
  }
7307
7404
  },
7308
7405
  {
@@ -10696,6 +10793,9 @@ var Seedance20MiniVideoEdit = "seedance-2.0-mini-video-edit";
10696
10793
  var Seedance20MiniVideoExtend = "seedance-2.0-mini-video-extend";
10697
10794
  var Seedance20VideoEdit = "seedance-2.0-video-edit";
10698
10795
  var Seedance20VideoExtend = "seedance-2.0-video-extend";
10796
+ var Seedance20WithoutModeration = "seedance-2.0-without-moderation";
10797
+ var Seedance20WithoutModerationVideoEdit = "seedance-2.0-without-moderation-video-edit";
10798
+ var Seedance20WithoutModerationVideoExtend = "seedance-2.0-without-moderation-video-extend";
10699
10799
  var Seedance25 = "seedance-2.5";
10700
10800
  var Seedance25VideoEdit = "seedance-2.5-video-edit";
10701
10801
  var Seedance25VideoExtend = "seedance-2.5-video-extend";
@@ -10899,6 +10999,9 @@ var Models = {
10899
10999
  Seedance20MiniVideoExtend,
10900
11000
  Seedance20VideoEdit,
10901
11001
  Seedance20VideoExtend,
11002
+ Seedance20WithoutModeration,
11003
+ Seedance20WithoutModerationVideoEdit,
11004
+ Seedance20WithoutModerationVideoExtend,
10902
11005
  Seedance25,
10903
11006
  Seedance25VideoEdit,
10904
11007
  Seedance25VideoExtend,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "5.5.1",
3
+ "version": "5.6.1",
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",