@picsart/ai-sdk 3.30.1 → 3.32.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 +16 -0
  2. package/index.js +92 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1418,6 +1418,21 @@ type ModelInputById = {
1418
1418
  videoUrl: string;
1419
1419
  imageUrls?: string[];
1420
1420
  };
1421
+ "wan-3.0-video": {
1422
+ prompt: string;
1423
+ duration?: 5 | 10 | 15 | 30;
1424
+ resolution?: "480P" | "720P" | "1080P";
1425
+ aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "adaptive";
1426
+ generateAudio?: boolean;
1427
+ startFrame?: string;
1428
+ endFrame?: string;
1429
+ imageUrls?: string[];
1430
+ videoUrls?: string[];
1431
+ audioUrls?: string[];
1432
+ enableThinking?: boolean;
1433
+ watermark?: boolean;
1434
+ seed?: number;
1435
+ };
1421
1436
  };
1422
1437
  type TypedModelId = keyof ModelInputById;
1423
1438
  type ModelInput<M extends TypedModelId> = ModelInputById[M];
@@ -2355,6 +2370,7 @@ declare const Models: {
2355
2370
  readonly Wan27R2v: "wan-2.7-r2v";
2356
2371
  readonly Wan27T2v: "wan-2.7-t2v";
2357
2372
  readonly Wan27VideoEdit: "wan-2.7-video-edit";
2373
+ readonly Wan30Video: "wan-3.0-video";
2358
2374
  /** @deprecated Use the `catalog` accessor (`catalog.all()` / `catalog.find({ output, provider })`) instead. */
2359
2375
  readonly list: (filter?: ModelFilter) => ModelDefinition[];
2360
2376
  /** @deprecated Use `Model(id).validate(input)` instead. */
package/index.js CHANGED
@@ -3094,6 +3094,33 @@ var buildWan27VideoEditPayload = (ctx) => {
3094
3094
  };
3095
3095
  var WAN27_AR = ["16:9", "9:16", "1:1", "4:3", "3:4"];
3096
3096
  var WAN27_RES = ["720P", "1080P"];
3097
+ var WAN_V3_FRAME_REF_REASON = "Start/End frames cannot be combined with reference images, videos, or audios";
3098
+ var wanV3Constraints = [
3099
+ // any reference input active → disable frame slots
3100
+ { when: { imageUrls: { exists: true } }, then: {
3101
+ startFrame: { disabled: true, reason: WAN_V3_FRAME_REF_REASON },
3102
+ endFrame: { disabled: true, reason: WAN_V3_FRAME_REF_REASON }
3103
+ } },
3104
+ { when: { videoUrls: { exists: true } }, then: {
3105
+ startFrame: { disabled: true, reason: WAN_V3_FRAME_REF_REASON },
3106
+ endFrame: { disabled: true, reason: WAN_V3_FRAME_REF_REASON }
3107
+ } },
3108
+ { when: { audioUrls: { exists: true } }, then: {
3109
+ startFrame: { disabled: true, reason: WAN_V3_FRAME_REF_REASON },
3110
+ endFrame: { disabled: true, reason: WAN_V3_FRAME_REF_REASON }
3111
+ } },
3112
+ // any frame slot active → disable reference inputs (mirror, blocks inverse order)
3113
+ { when: { startFrame: { exists: true } }, then: {
3114
+ imageUrls: { disabled: true, reason: WAN_V3_FRAME_REF_REASON },
3115
+ videoUrls: { disabled: true, reason: WAN_V3_FRAME_REF_REASON },
3116
+ audioUrls: { disabled: true, reason: WAN_V3_FRAME_REF_REASON }
3117
+ } },
3118
+ { when: { endFrame: { exists: true } }, then: {
3119
+ imageUrls: { disabled: true, reason: WAN_V3_FRAME_REF_REASON },
3120
+ videoUrls: { disabled: true, reason: WAN_V3_FRAME_REF_REASON },
3121
+ audioUrls: { disabled: true, reason: WAN_V3_FRAME_REF_REASON }
3122
+ } }
3123
+ ];
3097
3124
  var { MODELS: MODELS10 } = defineModels("wan", [
3098
3125
  // ── Video ─────────────────────────────────────────
3099
3126
  {
@@ -3259,9 +3286,72 @@ var { MODELS: MODELS10 } = defineModels("wan", [
3259
3286
  ...params.videoInput("Source Video"),
3260
3287
  ...params.imageInput(3, "Reference Images")
3261
3288
  }
3289
+ },
3290
+ // ── Wan 3.0 all-in-one Video ─────────────────────────
3291
+ {
3292
+ id: "wan-3.0-video",
3293
+ name: "Wan 3.0",
3294
+ modelId: "wan3.0-video",
3295
+ addedAt: "2026-08-03",
3296
+ // Single all-in-one endpoint — text, image/video/audio references, and
3297
+ // start/end frames. buildPayload registered in wan.payloads.ts.
3298
+ workflow: "wan/v3/video",
3299
+ estimatedTime: 120,
3300
+ release: "preview",
3301
+ mode: "video",
3302
+ inputType: "t2v",
3303
+ description: "Wan 3.0 all-in-one \u2014 text, image/video/audio references, and start/end frames with adaptive ratio, intelligent duration, and audio.",
3304
+ features: [feat("Image Input", "input"), feat("Video Input", "input"), feat("Audio", "audio"), feat("Start/End Frame", "frame"), feat("1080P", "resolution"), feat("Adaptive Ratio", "resolution")],
3305
+ constraints: wanV3Constraints,
3306
+ paramConfig: {
3307
+ ...params.prompt(),
3308
+ ...params.duration([5, 10, 15, 30], 5),
3309
+ ...params.resolution(["480P", "720P", "1080P"], "1080P"),
3310
+ ...params.aspectRatio(["16:9", "9:16", "1:1", "4:3", "3:4", "adaptive"]),
3311
+ ...params.generateAudio(true),
3312
+ ...params.startFrame(),
3313
+ ...params.endFrame(),
3314
+ ...params.imageInput(10, "Reference Images"),
3315
+ ...params.videoInputs(5, "Reference Videos", false),
3316
+ ...params.audioInputs(5, "Reference Audios"),
3317
+ ...p.boolean("enableThinking", false, "Deep Thinking"),
3318
+ ...p.boolean("watermark", false, "Watermark"),
3319
+ ...p.range("seed", 0, 2147483647, 0, { label: "Seed" })
3320
+ }
3262
3321
  }
3263
3322
  ]);
3264
3323
 
3324
+ // src/vendors/catalog/wan.payloads.ts
3325
+ var buildWanV3VideoPayload = (input) => {
3326
+ const media = [];
3327
+ if (input.startFrame) media.push({ type: "first_frame", url: input.startFrame });
3328
+ if (input.endFrame) media.push({ type: "last_frame", url: input.endFrame });
3329
+ if (input.imageUrls?.length) {
3330
+ for (const url of input.imageUrls) media.push({ type: "reference_image", url });
3331
+ }
3332
+ if (input.videoUrls?.length) {
3333
+ for (const url of input.videoUrls) media.push({ type: "reference_video", url });
3334
+ }
3335
+ if (input.audioUrls?.length) {
3336
+ for (const url of input.audioUrls) media.push({ type: "reference_audio", url });
3337
+ }
3338
+ return {
3339
+ model: "wan3.0-video",
3340
+ resolution: input.resolution ?? "1080P",
3341
+ ratio: input.aspectRatio ?? "16:9",
3342
+ duration: input.duration ?? 5,
3343
+ audio: input.generateAudio ?? true,
3344
+ enable_thinking: input.enableThinking ?? false,
3345
+ watermark: input.watermark ?? false,
3346
+ ...input.prompt ? { prompt: input.prompt } : {},
3347
+ ...media.length ? { media } : {},
3348
+ ...input.seed != null ? { seed: input.seed } : {}
3349
+ };
3350
+ };
3351
+ registerPayloads(MODELS10, {
3352
+ "wan-3.0-video": buildWanV3VideoPayload
3353
+ });
3354
+
3265
3355
  // src/vendors/catalog/luma.ts
3266
3356
  var buildLumaRay2Payload = (ctx) => {
3267
3357
  const keyframes = {};
@@ -10632,6 +10722,7 @@ var Wan27I2v = "wan-2.7-i2v";
10632
10722
  var Wan27R2v = "wan-2.7-r2v";
10633
10723
  var Wan27T2v = "wan-2.7-t2v";
10634
10724
  var Wan27VideoEdit = "wan-2.7-video-edit";
10725
+ var Wan30Video = "wan-3.0-video";
10635
10726
  var Models = {
10636
10727
  AsyncFlashV1,
10637
10728
  BytedanceOmnihumanV15,
@@ -10831,6 +10922,7 @@ var Models = {
10831
10922
  Wan27R2v,
10832
10923
  Wan27T2v,
10833
10924
  Wan27VideoEdit,
10925
+ Wan30Video,
10834
10926
  /** @deprecated Use the `catalog` accessor (`catalog.all()` / `catalog.find({ output, provider })`) instead. */
10835
10927
  list(filter) {
10836
10928
  if (!filter) return [...ALL_MODELS];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "3.30.1",
3
+ "version": "3.32.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",