@picsart/ai-sdk 3.30.0 → 3.31.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 +16 -0
- package/index.js +91 -8
- 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,71 @@ 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
|
+
mode: "video",
|
|
3301
|
+
inputType: "t2v",
|
|
3302
|
+
description: "Wan 3.0 all-in-one \u2014 text, image/video/audio references, and start/end frames with adaptive ratio, intelligent duration, and audio.",
|
|
3303
|
+
features: [feat("Image Input", "input"), feat("Video Input", "input"), feat("Audio", "audio"), feat("Start/End Frame", "frame"), feat("1080P", "resolution"), feat("Adaptive Ratio", "resolution")],
|
|
3304
|
+
constraints: wanV3Constraints,
|
|
3305
|
+
paramConfig: {
|
|
3306
|
+
...params.prompt(),
|
|
3307
|
+
...params.duration([5, 10, 15, 30], 5),
|
|
3308
|
+
...params.resolution(["480P", "720P", "1080P"], "1080P"),
|
|
3309
|
+
...params.aspectRatio(["16:9", "9:16", "1:1", "4:3", "3:4", "adaptive"]),
|
|
3310
|
+
...params.generateAudio(true),
|
|
3311
|
+
...params.startFrame(),
|
|
3312
|
+
...params.endFrame(),
|
|
3313
|
+
...params.imageInput(10, "Reference Images"),
|
|
3314
|
+
...params.videoInputs(5, "Reference Videos", false),
|
|
3315
|
+
...params.audioInputs(5, "Reference Audios"),
|
|
3316
|
+
...p.boolean("enableThinking", false, "Deep Thinking"),
|
|
3317
|
+
...p.boolean("watermark", false, "Watermark"),
|
|
3318
|
+
...p.range("seed", 0, 2147483647, 0, { label: "Seed" })
|
|
3319
|
+
}
|
|
3262
3320
|
}
|
|
3263
3321
|
]);
|
|
3264
3322
|
|
|
3323
|
+
// src/vendors/catalog/wan.payloads.ts
|
|
3324
|
+
var buildWanV3VideoPayload = (input) => {
|
|
3325
|
+
const media = [];
|
|
3326
|
+
if (input.startFrame) media.push({ type: "first_frame", url: input.startFrame });
|
|
3327
|
+
if (input.endFrame) media.push({ type: "last_frame", url: input.endFrame });
|
|
3328
|
+
if (input.imageUrls?.length) {
|
|
3329
|
+
for (const url of input.imageUrls) media.push({ type: "reference_image", url });
|
|
3330
|
+
}
|
|
3331
|
+
if (input.videoUrls?.length) {
|
|
3332
|
+
for (const url of input.videoUrls) media.push({ type: "reference_video", url });
|
|
3333
|
+
}
|
|
3334
|
+
if (input.audioUrls?.length) {
|
|
3335
|
+
for (const url of input.audioUrls) media.push({ type: "reference_audio", url });
|
|
3336
|
+
}
|
|
3337
|
+
return {
|
|
3338
|
+
model: "wan3.0-video",
|
|
3339
|
+
resolution: input.resolution ?? "1080P",
|
|
3340
|
+
ratio: input.aspectRatio ?? "16:9",
|
|
3341
|
+
duration: input.duration ?? 5,
|
|
3342
|
+
audio: input.generateAudio ?? true,
|
|
3343
|
+
enable_thinking: input.enableThinking ?? false,
|
|
3344
|
+
watermark: input.watermark ?? false,
|
|
3345
|
+
...input.prompt ? { prompt: input.prompt } : {},
|
|
3346
|
+
...media.length ? { media } : {},
|
|
3347
|
+
...input.seed != null ? { seed: input.seed } : {}
|
|
3348
|
+
};
|
|
3349
|
+
};
|
|
3350
|
+
registerPayloads(MODELS10, {
|
|
3351
|
+
"wan-3.0-video": buildWanV3VideoPayload
|
|
3352
|
+
});
|
|
3353
|
+
|
|
3265
3354
|
// src/vendors/catalog/luma.ts
|
|
3266
3355
|
var buildLumaRay2Payload = (ctx) => {
|
|
3267
3356
|
const keyframes = {};
|
|
@@ -6525,14 +6614,6 @@ var { MODELS: MODELS25 } = defineModels("heygen", [
|
|
|
6525
6614
|
id: "heygen-video-avatar",
|
|
6526
6615
|
modelId: "heygen-avatar-iv",
|
|
6527
6616
|
addedAt: "2026-03-17",
|
|
6528
|
-
// Disabled 2026-05-08 because the avatar list carried no way to tell an
|
|
6529
|
-
// Avatar IV-compatible avatar from an incompatible one, so picks were
|
|
6530
|
-
// rejected at submit. The worker now serves `heygen/v1/avatars/list` from
|
|
6531
|
-
// HeyGen v3 looks filtered by `supported_api_engines`, so every id it offers
|
|
6532
|
-
// is one the engine accepts. Kept at `preview` until that runs on
|
|
6533
|
-
// production — the tag is opt-in, so only stage surfaces asking for it will
|
|
6534
|
-
// list the model.
|
|
6535
|
-
release: "preview",
|
|
6536
6617
|
name: "HeyGen Video Avatar",
|
|
6537
6618
|
workflow: "heygen/v1/video/generate",
|
|
6538
6619
|
buildPayload: buildHeyGenVideoAvatarPayload,
|
|
@@ -10640,6 +10721,7 @@ var Wan27I2v = "wan-2.7-i2v";
|
|
|
10640
10721
|
var Wan27R2v = "wan-2.7-r2v";
|
|
10641
10722
|
var Wan27T2v = "wan-2.7-t2v";
|
|
10642
10723
|
var Wan27VideoEdit = "wan-2.7-video-edit";
|
|
10724
|
+
var Wan30Video = "wan-3.0-video";
|
|
10643
10725
|
var Models = {
|
|
10644
10726
|
AsyncFlashV1,
|
|
10645
10727
|
BytedanceOmnihumanV15,
|
|
@@ -10839,6 +10921,7 @@ var Models = {
|
|
|
10839
10921
|
Wan27R2v,
|
|
10840
10922
|
Wan27T2v,
|
|
10841
10923
|
Wan27VideoEdit,
|
|
10924
|
+
Wan30Video,
|
|
10842
10925
|
/** @deprecated Use the `catalog` accessor (`catalog.all()` / `catalog.find({ output, provider })`) instead. */
|
|
10843
10926
|
list(filter) {
|
|
10844
10927
|
if (!filter) return [...ALL_MODELS];
|