@picsart/ai-sdk 5.17.0 → 5.19.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 +2124 -1803
- package/index.d.ts +37 -0
- package/index.js +98 -21
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -288,6 +288,17 @@ type ModelInputById = {
|
|
|
288
288
|
imageUrls?: string[];
|
|
289
289
|
thinking?: "off" | "low" | "medium" | "high";
|
|
290
290
|
};
|
|
291
|
+
"gemini-omni-1.1-flash-preview": {
|
|
292
|
+
prompt: string;
|
|
293
|
+
aspectRatio?: "16:9" | "9:16";
|
|
294
|
+
resolution?: "360p" | "720p" | "1080p" | "4k";
|
|
295
|
+
duration?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
|
296
|
+
startFrame?: string;
|
|
297
|
+
endFrame?: string;
|
|
298
|
+
imageUrls?: string[];
|
|
299
|
+
videoUrl?: string;
|
|
300
|
+
videoUrls?: string[];
|
|
301
|
+
};
|
|
291
302
|
"gemini-omni-flash-preview": {
|
|
292
303
|
prompt: string;
|
|
293
304
|
aspectRatio?: "16:9" | "9:16";
|
|
@@ -1516,6 +1527,21 @@ type ModelInputById = {
|
|
|
1516
1527
|
watermark?: boolean;
|
|
1517
1528
|
seed?: number;
|
|
1518
1529
|
};
|
|
1530
|
+
"wan-3.0-video-prime": {
|
|
1531
|
+
prompt: string;
|
|
1532
|
+
duration?: 5 | 10 | 15 | 30;
|
|
1533
|
+
resolution?: "480P" | "720P" | "1080P";
|
|
1534
|
+
aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "adaptive";
|
|
1535
|
+
generateAudio?: boolean;
|
|
1536
|
+
startFrame?: string;
|
|
1537
|
+
endFrame?: string;
|
|
1538
|
+
imageUrls?: string[];
|
|
1539
|
+
videoUrls?: string[];
|
|
1540
|
+
audioUrls?: string[];
|
|
1541
|
+
enableThinking?: boolean;
|
|
1542
|
+
watermark?: boolean;
|
|
1543
|
+
seed?: number;
|
|
1544
|
+
};
|
|
1519
1545
|
};
|
|
1520
1546
|
type TypedModelId = keyof ModelInputById;
|
|
1521
1547
|
type ModelInput<M extends TypedModelId> = ModelInputById[M];
|
|
@@ -2153,6 +2179,15 @@ interface ModelDefinition {
|
|
|
2153
2179
|
estimatedTime?: number | Record<string, number>;
|
|
2154
2180
|
editEstimatedTime?: number | Record<string, number>;
|
|
2155
2181
|
testTimeout?: number;
|
|
2182
|
+
/**
|
|
2183
|
+
* Per-model polling overrides for async jobs. Widens the global
|
|
2184
|
+
* 2s × 300-attempt (~10 min) default for models whose generations can
|
|
2185
|
+
* outlast it. Explicit per-call poll options still win.
|
|
2186
|
+
*/
|
|
2187
|
+
pollOptions?: {
|
|
2188
|
+
intervalMs?: number;
|
|
2189
|
+
maxAttempts?: number;
|
|
2190
|
+
};
|
|
2156
2191
|
}
|
|
2157
2192
|
|
|
2158
2193
|
/**
|
|
@@ -2468,6 +2503,7 @@ declare const Models: {
|
|
|
2468
2503
|
readonly Gemini35FlashLite: "gemini-3.5-flash-lite";
|
|
2469
2504
|
readonly Gemini36Flash: "gemini-3.6-flash";
|
|
2470
2505
|
readonly Gemini37Flash: "gemini-3.7-flash";
|
|
2506
|
+
readonly GeminiOmni11FlashPreview: "gemini-omni-1.1-flash-preview";
|
|
2471
2507
|
readonly GeminiOmniFlashPreview: "gemini-omni-flash-preview";
|
|
2472
2508
|
readonly Gpt55: "gpt-5.5";
|
|
2473
2509
|
readonly GptImage1: "gpt-image-1";
|
|
@@ -2637,6 +2673,7 @@ declare const Models: {
|
|
|
2637
2673
|
readonly Wan27T2v: "wan-2.7-t2v";
|
|
2638
2674
|
readonly Wan27VideoEdit: "wan-2.7-video-edit";
|
|
2639
2675
|
readonly Wan30Video: "wan-3.0-video";
|
|
2676
|
+
readonly Wan30VideoPrime: "wan-3.0-video-prime";
|
|
2640
2677
|
/** @deprecated Use the `catalog` accessor (`catalog.all()` / `catalog.find({ output, provider })`) instead. */
|
|
2641
2678
|
readonly list: (filter?: ModelFilter) => ModelDefinition[];
|
|
2642
2679
|
/** @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
|
|
@@ -5727,9 +5753,56 @@ var { MODELS: MODELS22 } = defineModels("google", [
|
|
|
5727
5753
|
...params.imageInput(1, "Source Image", false, "asset"),
|
|
5728
5754
|
...params.videoInput("Source Video", "asset", false)
|
|
5729
5755
|
}
|
|
5756
|
+
},
|
|
5757
|
+
{
|
|
5758
|
+
id: "gemini-omni-1.1-flash-preview",
|
|
5759
|
+
name: "Gemini Omni 1.2 Flash",
|
|
5760
|
+
specName: "Gemini Omni 1.1 Flash Preview",
|
|
5761
|
+
addedAt: "2026-08-27",
|
|
5762
|
+
workflow: "gemini-omni/video",
|
|
5763
|
+
estimatedTime: { "360p": 30, "720p": 40, "1080p": 60, "4k": 90 },
|
|
5764
|
+
mode: "video",
|
|
5765
|
+
inputType: "t2v",
|
|
5766
|
+
description: "Gemini Omni with frame interpolation, video extension, reference-guided generation, and up to 4K output.",
|
|
5767
|
+
features: [feat("Start/End Frame", "input"), feat("Reference Images & Videos", "input"), feat("Video Extension", "input"), feat("4K", "resolution"), feat("3\u201310 sec", "duration")],
|
|
5768
|
+
paramConfig: {
|
|
5769
|
+
...params.prompt(),
|
|
5770
|
+
...params.aspectRatio(["16:9", "9:16"], "16:9"),
|
|
5771
|
+
...params.resolution(["360p", "720p", "1080p", "4k"], "720p"),
|
|
5772
|
+
...params.duration([3, 4, 5, 6, 7, 8, 9, 10], 8),
|
|
5773
|
+
...params.startFrame("Start Frame"),
|
|
5774
|
+
...params.endFrame("End Frame"),
|
|
5775
|
+
...params.imageInput(5, "Reference Images", false, "reference"),
|
|
5776
|
+
// Extension source: the worker extends the clip by up to 10s; input must be under 30s.
|
|
5777
|
+
...params.videoInput("Source Video", "asset", false, 30),
|
|
5778
|
+
...params.videoInputs(3, "Reference Videos")
|
|
5779
|
+
}
|
|
5730
5780
|
}
|
|
5731
5781
|
]);
|
|
5732
5782
|
|
|
5783
|
+
// src/vendors/catalog/gemini.payloads.ts
|
|
5784
|
+
function inferMimeType3(url) {
|
|
5785
|
+
return url.match(/\.png(\?|$)/i) ? "image/png" : "image/jpeg";
|
|
5786
|
+
}
|
|
5787
|
+
var toImage = (url) => ({ url, mimeType: inferMimeType3(url) });
|
|
5788
|
+
var buildOmniFlash11Payload = (input) => ({
|
|
5789
|
+
prompt: input.prompt,
|
|
5790
|
+
model: "gemini-omni-1.1-flash-preview",
|
|
5791
|
+
// Materialize the catalog defaults so direct SDK calls send the advertised
|
|
5792
|
+
// values rather than relying on the worker/vendor defaults.
|
|
5793
|
+
aspectRatio: input.aspectRatio ?? "16:9",
|
|
5794
|
+
durationSeconds: input.duration ?? 8,
|
|
5795
|
+
resolution: input.resolution ?? "720p",
|
|
5796
|
+
...input.startFrame ? { image: toImage(input.startFrame) } : {},
|
|
5797
|
+
...input.endFrame ? { lastFrame: toImage(input.endFrame) } : {},
|
|
5798
|
+
...input.imageUrls?.length ? { referenceImages: input.imageUrls.map(toImage) } : {},
|
|
5799
|
+
...input.videoUrl ? { video: { url: input.videoUrl } } : {},
|
|
5800
|
+
...input.videoUrls?.length ? { referenceVideos: input.videoUrls.map((url) => ({ url })) } : {}
|
|
5801
|
+
});
|
|
5802
|
+
registerPayloads(MODELS22, {
|
|
5803
|
+
"gemini-omni-1.1-flash-preview": buildOmniFlash11Payload
|
|
5804
|
+
});
|
|
5805
|
+
|
|
5733
5806
|
// src/vendors/catalog/openai.ts
|
|
5734
5807
|
var GPT_IMAGE_AR_TO_SIZE = {
|
|
5735
5808
|
"1:1": "1024x1024",
|
|
@@ -9815,7 +9888,7 @@ function createClient(config) {
|
|
|
9815
9888
|
syncResponse.usage
|
|
9816
9889
|
);
|
|
9817
9890
|
}
|
|
9818
|
-
return client.run({ workflow, payload, signal });
|
|
9891
|
+
return client.run({ workflow, payload, signal }, model.pollOptions);
|
|
9819
9892
|
}
|
|
9820
9893
|
function buildDrivePayloadOptions(model, params2, options) {
|
|
9821
9894
|
const explicit = options?.drive;
|
|
@@ -9916,7 +9989,7 @@ function createClient(config) {
|
|
|
9916
9989
|
async result(handle, model, options) {
|
|
9917
9990
|
const resolved = resolveModel(model);
|
|
9918
9991
|
const contract = getModelContract(resolved.id);
|
|
9919
|
-
const completed = await client.result(handle, options);
|
|
9992
|
+
const completed = await client.result(handle, { ...resolved.pollOptions, ...options });
|
|
9920
9993
|
return parseResult(completed, resolved, contract);
|
|
9921
9994
|
},
|
|
9922
9995
|
/**
|
|
@@ -10439,6 +10512,7 @@ var Gemini31FlashLiteImage = "gemini-3.1-flash-lite-image";
|
|
|
10439
10512
|
var Gemini35FlashLite = "gemini-3.5-flash-lite";
|
|
10440
10513
|
var Gemini36Flash = "gemini-3.6-flash";
|
|
10441
10514
|
var Gemini37Flash = "gemini-3.7-flash";
|
|
10515
|
+
var GeminiOmni11FlashPreview = "gemini-omni-1.1-flash-preview";
|
|
10442
10516
|
var GeminiOmniFlashPreview = "gemini-omni-flash-preview";
|
|
10443
10517
|
var Gpt55 = "gpt-5.5";
|
|
10444
10518
|
var GptImage1 = "gpt-image-1";
|
|
@@ -10608,6 +10682,7 @@ var Wan27R2v = "wan-2.7-r2v";
|
|
|
10608
10682
|
var Wan27T2v = "wan-2.7-t2v";
|
|
10609
10683
|
var Wan27VideoEdit = "wan-2.7-video-edit";
|
|
10610
10684
|
var Wan30Video = "wan-3.0-video";
|
|
10685
|
+
var Wan30VideoPrime = "wan-3.0-video-prime";
|
|
10611
10686
|
var Models = {
|
|
10612
10687
|
AsyncFlashV1,
|
|
10613
10688
|
BytedanceOmnihumanV15,
|
|
@@ -10645,6 +10720,7 @@ var Models = {
|
|
|
10645
10720
|
Gemini35FlashLite,
|
|
10646
10721
|
Gemini36Flash,
|
|
10647
10722
|
Gemini37Flash,
|
|
10723
|
+
GeminiOmni11FlashPreview,
|
|
10648
10724
|
GeminiOmniFlashPreview,
|
|
10649
10725
|
Gpt55,
|
|
10650
10726
|
GptImage1,
|
|
@@ -10814,6 +10890,7 @@ var Models = {
|
|
|
10814
10890
|
Wan27T2v,
|
|
10815
10891
|
Wan27VideoEdit,
|
|
10816
10892
|
Wan30Video,
|
|
10893
|
+
Wan30VideoPrime,
|
|
10817
10894
|
/** @deprecated Use the `catalog` accessor (`catalog.all()` / `catalog.find({ output, provider })`) instead. */
|
|
10818
10895
|
list(filter) {
|
|
10819
10896
|
if (!filter) return [...ALL_MODELS];
|