@picsart/ai-sdk 5.17.0 → 5.18.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/_vendor/workflows-types/index.d.ts +2055 -1801
- package/index.d.ts +25 -0
- package/index.js +49 -21
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1516,6 +1516,21 @@ type ModelInputById = {
|
|
|
1516
1516
|
watermark?: boolean;
|
|
1517
1517
|
seed?: number;
|
|
1518
1518
|
};
|
|
1519
|
+
"wan-3.0-video-prime": {
|
|
1520
|
+
prompt: string;
|
|
1521
|
+
duration?: 5 | 10 | 15 | 30;
|
|
1522
|
+
resolution?: "480P" | "720P" | "1080P";
|
|
1523
|
+
aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "adaptive";
|
|
1524
|
+
generateAudio?: boolean;
|
|
1525
|
+
startFrame?: string;
|
|
1526
|
+
endFrame?: string;
|
|
1527
|
+
imageUrls?: string[];
|
|
1528
|
+
videoUrls?: string[];
|
|
1529
|
+
audioUrls?: string[];
|
|
1530
|
+
enableThinking?: boolean;
|
|
1531
|
+
watermark?: boolean;
|
|
1532
|
+
seed?: number;
|
|
1533
|
+
};
|
|
1519
1534
|
};
|
|
1520
1535
|
type TypedModelId = keyof ModelInputById;
|
|
1521
1536
|
type ModelInput<M extends TypedModelId> = ModelInputById[M];
|
|
@@ -2153,6 +2168,15 @@ interface ModelDefinition {
|
|
|
2153
2168
|
estimatedTime?: number | Record<string, number>;
|
|
2154
2169
|
editEstimatedTime?: number | Record<string, number>;
|
|
2155
2170
|
testTimeout?: number;
|
|
2171
|
+
/**
|
|
2172
|
+
* Per-model polling overrides for async jobs. Widens the global
|
|
2173
|
+
* 2s × 300-attempt (~10 min) default for models whose generations can
|
|
2174
|
+
* outlast it. Explicit per-call poll options still win.
|
|
2175
|
+
*/
|
|
2176
|
+
pollOptions?: {
|
|
2177
|
+
intervalMs?: number;
|
|
2178
|
+
maxAttempts?: number;
|
|
2179
|
+
};
|
|
2156
2180
|
}
|
|
2157
2181
|
|
|
2158
2182
|
/**
|
|
@@ -2637,6 +2661,7 @@ declare const Models: {
|
|
|
2637
2661
|
readonly Wan27T2v: "wan-2.7-t2v";
|
|
2638
2662
|
readonly Wan27VideoEdit: "wan-2.7-video-edit";
|
|
2639
2663
|
readonly Wan30Video: "wan-3.0-video";
|
|
2664
|
+
readonly Wan30VideoPrime: "wan-3.0-video-prime";
|
|
2640
2665
|
/** @deprecated Use the `catalog` accessor (`catalog.all()` / `catalog.find({ output, provider })`) instead. */
|
|
2641
2666
|
readonly list: (filter?: ModelFilter) => ModelDefinition[];
|
|
2642
2667
|
/** @deprecated Use `Model(id).validate(input)` instead. */
|
package/index.js
CHANGED
|
@@ -1201,6 +1201,7 @@ function defineModels(provider, configs) {
|
|
|
1201
1201
|
if (c.estimatedTime !== void 0) model.estimatedTime = c.estimatedTime;
|
|
1202
1202
|
if (c.editEstimatedTime !== void 0) model.editEstimatedTime = c.editEstimatedTime;
|
|
1203
1203
|
if (c.testTimeout !== void 0) model.testTimeout = c.testTimeout;
|
|
1204
|
+
if (c.pollOptions !== void 0) model.pollOptions = c.pollOptions;
|
|
1204
1205
|
if (c.badge !== void 0) model.badge = c.badge;
|
|
1205
1206
|
if (c.addedAt !== void 0) model.addedAt = c.addedAt;
|
|
1206
1207
|
if (c.disabled !== void 0) model.disabled = c.disabled;
|
|
@@ -2927,6 +2928,22 @@ var wanV3Constraints = [
|
|
|
2927
2928
|
audioUrls: { disabled: true, reason: WAN_V3_FRAME_REF_REASON }
|
|
2928
2929
|
} }
|
|
2929
2930
|
];
|
|
2931
|
+
var wanV3Features = [feat("Image Input", "input"), feat("Video Input", "input"), feat("Audio", "audio"), feat("Start/End Frame", "frame"), feat("1080P", "resolution"), feat("Adaptive Ratio", "resolution")];
|
|
2932
|
+
var wanV3ParamConfig = {
|
|
2933
|
+
...params.prompt(),
|
|
2934
|
+
...params.duration([5, 10, 15, 30], 5),
|
|
2935
|
+
...params.resolution(["480P", "720P", "1080P"], "1080P"),
|
|
2936
|
+
...params.aspectRatio(["16:9", "9:16", "1:1", "4:3", "3:4", "adaptive"]),
|
|
2937
|
+
...params.generateAudio(true),
|
|
2938
|
+
...params.startFrame(),
|
|
2939
|
+
...params.endFrame(),
|
|
2940
|
+
...params.imageInput(10, "Reference Images"),
|
|
2941
|
+
...params.videoInputs(5, "Reference Videos", false),
|
|
2942
|
+
...params.audioInputs(5, "Reference Audios"),
|
|
2943
|
+
...p.boolean("enableThinking", false, "Deep Thinking"),
|
|
2944
|
+
...p.boolean("watermark", false, "Watermark"),
|
|
2945
|
+
...p.range("seed", 0, 2147483647, 0, { label: "Seed" })
|
|
2946
|
+
};
|
|
2930
2947
|
var { MODELS: MODELS10 } = defineModels("wan", [
|
|
2931
2948
|
// ── Video ─────────────────────────────────────────
|
|
2932
2949
|
{
|
|
@@ -3094,6 +3111,10 @@ var { MODELS: MODELS10 } = defineModels("wan", [
|
|
|
3094
3111
|
}
|
|
3095
3112
|
},
|
|
3096
3113
|
// ── Wan 3.0 all-in-one Video ─────────────────────────
|
|
3114
|
+
// wan-3.0-video and wan-3.0-video-prime share the wan/v3/video workflow and
|
|
3115
|
+
// the full param surface — the backend `model` enum value (hardcoded per
|
|
3116
|
+
// entry in wan.payloads.ts) is the only wire difference. Prime is the same
|
|
3117
|
+
// model, up to 7x faster.
|
|
3097
3118
|
{
|
|
3098
3119
|
id: "wan-3.0-video",
|
|
3099
3120
|
name: "Wan 3.0",
|
|
@@ -3106,28 +3127,32 @@ var { MODELS: MODELS10 } = defineModels("wan", [
|
|
|
3106
3127
|
mode: "video",
|
|
3107
3128
|
inputType: "t2v",
|
|
3108
3129
|
description: "Wan 3.0 all-in-one \u2014 text, image/video/audio references, and start/end frames with adaptive ratio, intelligent duration, and audio.",
|
|
3109
|
-
features: [
|
|
3130
|
+
features: [...wanV3Features],
|
|
3110
3131
|
constraints: wanV3Constraints,
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3132
|
+
// Generations at 1080P / long durations can outlast the global 10-min
|
|
3133
|
+
// polling default — widen to 5s × 360 attempts (30 min).
|
|
3134
|
+
pollOptions: { intervalMs: 5e3, maxAttempts: 360 },
|
|
3135
|
+
paramConfig: { ...wanV3ParamConfig }
|
|
3136
|
+
},
|
|
3137
|
+
{
|
|
3138
|
+
id: "wan-3.0-video-prime",
|
|
3139
|
+
name: "Wan 3.0 Prime",
|
|
3140
|
+
modelId: "wan3.0-video-prime",
|
|
3141
|
+
addedAt: "2026-08-26",
|
|
3142
|
+
workflow: "wan/v3/video",
|
|
3143
|
+
estimatedTime: 30,
|
|
3144
|
+
mode: "video",
|
|
3145
|
+
inputType: "t2v",
|
|
3146
|
+
description: "Wan 3.0 Prime \u2014 the same all-in-one model as Wan 3.0, up to 7x faster.",
|
|
3147
|
+
features: [...wanV3Features],
|
|
3148
|
+
constraints: wanV3Constraints,
|
|
3149
|
+
pollOptions: { intervalMs: 5e3, maxAttempts: 360 },
|
|
3150
|
+
paramConfig: { ...wanV3ParamConfig }
|
|
3126
3151
|
}
|
|
3127
3152
|
]);
|
|
3128
3153
|
|
|
3129
3154
|
// src/vendors/catalog/wan.payloads.ts
|
|
3130
|
-
var
|
|
3155
|
+
var makeWanV3VideoPayload = (model) => (input) => {
|
|
3131
3156
|
const media = [];
|
|
3132
3157
|
if (input.startFrame) media.push({ type: "first_frame", url: input.startFrame });
|
|
3133
3158
|
if (input.endFrame) media.push({ type: "last_frame", url: input.endFrame });
|
|
@@ -3141,7 +3166,7 @@ var buildWanV3VideoPayload = (input) => {
|
|
|
3141
3166
|
for (const url of input.audioUrls) media.push({ type: "reference_audio", url });
|
|
3142
3167
|
}
|
|
3143
3168
|
return {
|
|
3144
|
-
model
|
|
3169
|
+
model,
|
|
3145
3170
|
resolution: input.resolution ?? "1080P",
|
|
3146
3171
|
ratio: input.aspectRatio ?? "16:9",
|
|
3147
3172
|
duration: input.duration ?? 5,
|
|
@@ -3154,7 +3179,8 @@ var buildWanV3VideoPayload = (input) => {
|
|
|
3154
3179
|
};
|
|
3155
3180
|
};
|
|
3156
3181
|
registerPayloads(MODELS10, {
|
|
3157
|
-
"wan-3.0-video":
|
|
3182
|
+
"wan-3.0-video": makeWanV3VideoPayload("wan3.0-video"),
|
|
3183
|
+
"wan-3.0-video-prime": makeWanV3VideoPayload("wan3.0-video-prime")
|
|
3158
3184
|
});
|
|
3159
3185
|
|
|
3160
3186
|
// src/vendors/catalog/luma.ts
|
|
@@ -9815,7 +9841,7 @@ function createClient(config) {
|
|
|
9815
9841
|
syncResponse.usage
|
|
9816
9842
|
);
|
|
9817
9843
|
}
|
|
9818
|
-
return client.run({ workflow, payload, signal });
|
|
9844
|
+
return client.run({ workflow, payload, signal }, model.pollOptions);
|
|
9819
9845
|
}
|
|
9820
9846
|
function buildDrivePayloadOptions(model, params2, options) {
|
|
9821
9847
|
const explicit = options?.drive;
|
|
@@ -9916,7 +9942,7 @@ function createClient(config) {
|
|
|
9916
9942
|
async result(handle, model, options) {
|
|
9917
9943
|
const resolved = resolveModel(model);
|
|
9918
9944
|
const contract = getModelContract(resolved.id);
|
|
9919
|
-
const completed = await client.result(handle, options);
|
|
9945
|
+
const completed = await client.result(handle, { ...resolved.pollOptions, ...options });
|
|
9920
9946
|
return parseResult(completed, resolved, contract);
|
|
9921
9947
|
},
|
|
9922
9948
|
/**
|
|
@@ -10608,6 +10634,7 @@ var Wan27R2v = "wan-2.7-r2v";
|
|
|
10608
10634
|
var Wan27T2v = "wan-2.7-t2v";
|
|
10609
10635
|
var Wan27VideoEdit = "wan-2.7-video-edit";
|
|
10610
10636
|
var Wan30Video = "wan-3.0-video";
|
|
10637
|
+
var Wan30VideoPrime = "wan-3.0-video-prime";
|
|
10611
10638
|
var Models = {
|
|
10612
10639
|
AsyncFlashV1,
|
|
10613
10640
|
BytedanceOmnihumanV15,
|
|
@@ -10814,6 +10841,7 @@ var Models = {
|
|
|
10814
10841
|
Wan27T2v,
|
|
10815
10842
|
Wan27VideoEdit,
|
|
10816
10843
|
Wan30Video,
|
|
10844
|
+
Wan30VideoPrime,
|
|
10817
10845
|
/** @deprecated Use the `catalog` accessor (`catalog.all()` / `catalog.find({ output, provider })`) instead. */
|
|
10818
10846
|
list(filter) {
|
|
10819
10847
|
if (!filter) return [...ALL_MODELS];
|