@picsart/ai-sdk 3.28.0 → 3.29.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.
- package/index.d.ts +13 -2
- package/index.js +90 -8
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -334,6 +334,16 @@ type ModelInputById = {
|
|
|
334
334
|
prompt: string;
|
|
335
335
|
voiceId?: "eve" | "ara" | "rex" | "sal" | "leo";
|
|
336
336
|
};
|
|
337
|
+
"hailuo-03": {
|
|
338
|
+
prompt: string;
|
|
339
|
+
startFrame?: string;
|
|
340
|
+
endFrame?: string;
|
|
341
|
+
imageUrls?: string[];
|
|
342
|
+
videoUrls?: string[];
|
|
343
|
+
audioUrls?: string[];
|
|
344
|
+
duration?: 5 | 10 | 15;
|
|
345
|
+
aspectRatio?: "adaptive" | "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
|
|
346
|
+
};
|
|
337
347
|
"hailuo-2.3": {
|
|
338
348
|
prompt: string;
|
|
339
349
|
enhancePrompt?: boolean;
|
|
@@ -1854,7 +1864,7 @@ interface ModelMeta {
|
|
|
1854
1864
|
readonly features: ModelFeature[];
|
|
1855
1865
|
readonly badges: BadgeType[];
|
|
1856
1866
|
readonly provider: ProviderInfo;
|
|
1857
|
-
/** Release / availability tier
|
|
1867
|
+
/** Release / availability tier. Absent on the definition ⇒ `'production'`. */
|
|
1858
1868
|
readonly release: ReleaseTag;
|
|
1859
1869
|
}
|
|
1860
1870
|
/** Parameter operations — fluent access to model params, schemas, defaults. */
|
|
@@ -2190,6 +2200,7 @@ declare const Models: {
|
|
|
2190
2200
|
readonly GrokImagineVideo: "grok-imagine-video";
|
|
2191
2201
|
readonly GrokImagineVideo15: "grok-imagine-video-1.5";
|
|
2192
2202
|
readonly GrokTts: "grok-tts";
|
|
2203
|
+
readonly Hailuo03: "hailuo-03";
|
|
2193
2204
|
readonly Hailuo23: "hailuo-2.3";
|
|
2194
2205
|
readonly Hailuo23Fast: "hailuo-2.3-fast";
|
|
2195
2206
|
readonly Hailuo23FastPro: "hailuo-2.3-fast-pro";
|
|
@@ -2470,7 +2481,7 @@ declare const releaseOf: (m: ModelDefinition) => ReleaseTag;
|
|
|
2470
2481
|
* `disabled` and `deprecated` are hard hides layered on top of `release`: a
|
|
2471
2482
|
* model carrying either is never visible, regardless of its release tag or the
|
|
2472
2483
|
* requested set. (`disabled` is being phased out in favour of
|
|
2473
|
-
* `release: 'preview'
|
|
2484
|
+
* `release: 'preview'`, but is still honoured during the migration.)
|
|
2474
2485
|
*/
|
|
2475
2486
|
declare function isVisibleForReleases(m: ModelDefinition, releases?: readonly ReleaseTag[]): boolean;
|
|
2476
2487
|
|
package/index.js
CHANGED
|
@@ -2842,6 +2842,57 @@ var buildI2V = (withDuration) => (ctx) => ({
|
|
|
2842
2842
|
...ctx.enhancePrompt !== void 0 ? { prompt_optimizer: ctx.enhancePrompt } : {},
|
|
2843
2843
|
...withDuration && ctx.duration ? { duration: String(ctx.duration) } : {}
|
|
2844
2844
|
});
|
|
2845
|
+
var buildMinimaxH3 = (ctx) => {
|
|
2846
|
+
const content = [{ type: "text", text: ctx.prompt }];
|
|
2847
|
+
if (ctx.startFrame) content.push({ type: "image_url", image_url: { url: ctx.startFrame }, role: "first_frame" });
|
|
2848
|
+
if (ctx.endFrame) content.push({ type: "image_url", image_url: { url: ctx.endFrame }, role: "last_frame" });
|
|
2849
|
+
for (const url of ctx.imageUrls ?? []) content.push({ type: "image_url", image_url: { url }, role: "reference_image" });
|
|
2850
|
+
for (const url of ctx.videoUrls ?? []) content.push({ type: "video_url", video_url: { url }, role: "reference_video" });
|
|
2851
|
+
for (const url of ctx.audioUrls ?? []) content.push({ type: "audio_url", audio_url: { url }, role: "reference_audio" });
|
|
2852
|
+
return {
|
|
2853
|
+
model: "MiniMax-H3",
|
|
2854
|
+
content,
|
|
2855
|
+
resolution: "2K",
|
|
2856
|
+
...ctx.duration ? { duration: ctx.duration } : {},
|
|
2857
|
+
...ctx.aspectRatio ? { ratio: ctx.aspectRatio } : {}
|
|
2858
|
+
};
|
|
2859
|
+
};
|
|
2860
|
+
var FRAME_REF_EXCLUSIVE = "First/last frame and reference inputs cannot be combined.";
|
|
2861
|
+
var LAST_NEEDS_FIRST = "An end frame requires a start frame.";
|
|
2862
|
+
var AUDIO_NEEDS_VISUAL = "Reference audio needs a reference image or video.";
|
|
2863
|
+
var hailuo03Constraints = [
|
|
2864
|
+
// Frame roles ⊥ reference roles (declared both ways so either input disables the other).
|
|
2865
|
+
{ when: { startFrame: { exists: true } }, then: {
|
|
2866
|
+
imageUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE },
|
|
2867
|
+
videoUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE },
|
|
2868
|
+
audioUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE }
|
|
2869
|
+
} },
|
|
2870
|
+
{ when: { endFrame: { exists: true } }, then: {
|
|
2871
|
+
imageUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE },
|
|
2872
|
+
videoUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE },
|
|
2873
|
+
audioUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE }
|
|
2874
|
+
} },
|
|
2875
|
+
{ when: { imageUrls: { exists: true } }, then: {
|
|
2876
|
+
startFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE },
|
|
2877
|
+
endFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE }
|
|
2878
|
+
} },
|
|
2879
|
+
{ when: { videoUrls: { exists: true } }, then: {
|
|
2880
|
+
startFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE },
|
|
2881
|
+
endFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE }
|
|
2882
|
+
} },
|
|
2883
|
+
{ when: { audioUrls: { exists: true } }, then: {
|
|
2884
|
+
startFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE },
|
|
2885
|
+
endFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE }
|
|
2886
|
+
} },
|
|
2887
|
+
// last_frame requires first_frame.
|
|
2888
|
+
{ when: { startFrame: { exists: false } }, then: {
|
|
2889
|
+
endFrame: { disabled: true, reason: LAST_NEEDS_FIRST }
|
|
2890
|
+
} },
|
|
2891
|
+
// reference_audio cannot be the only reference input.
|
|
2892
|
+
{ when: { imageUrls: { exists: false }, videoUrls: { exists: false } }, then: {
|
|
2893
|
+
audioUrls: { disabled: true, reason: AUDIO_NEEDS_VISUAL }
|
|
2894
|
+
} }
|
|
2895
|
+
];
|
|
2845
2896
|
var base = {
|
|
2846
2897
|
mode: "video"
|
|
2847
2898
|
};
|
|
@@ -2923,6 +2974,36 @@ var { MODELS: MODELS9 } = defineModels("minimax", [
|
|
|
2923
2974
|
...params.enhancePrompt(),
|
|
2924
2975
|
...params.imageInput(1, "Start Image", true)
|
|
2925
2976
|
}
|
|
2977
|
+
},
|
|
2978
|
+
{
|
|
2979
|
+
...base,
|
|
2980
|
+
id: "hailuo-03",
|
|
2981
|
+
name: "Hailuo 03",
|
|
2982
|
+
modelId: "minimax-h3",
|
|
2983
|
+
addedAt: "2026-07-30",
|
|
2984
|
+
inputType: "t2v",
|
|
2985
|
+
workflow: "minimax/v2/video-generation",
|
|
2986
|
+
buildPayload: buildMinimaxH3,
|
|
2987
|
+
estimatedTime: 300,
|
|
2988
|
+
description: "MiniMax H3 2K video from text, start/last frame, or image/video/audio references.",
|
|
2989
|
+
features: [
|
|
2990
|
+
feat("Start Frame", "frame"),
|
|
2991
|
+
feat("End Frame", "frame"),
|
|
2992
|
+
feat("Reference Video", "input"),
|
|
2993
|
+
feat("2K", "resolution"),
|
|
2994
|
+
feat("15 sec", "duration")
|
|
2995
|
+
],
|
|
2996
|
+
paramConfig: {
|
|
2997
|
+
...params.prompt(),
|
|
2998
|
+
...params.startFrame(),
|
|
2999
|
+
...params.endFrame(),
|
|
3000
|
+
...params.imageInput(3, "Reference Images", false),
|
|
3001
|
+
...params.videoInputs(1, "Reference Videos", false),
|
|
3002
|
+
...params.audioInputs(1, "Reference Audios", false),
|
|
3003
|
+
...params.duration([5, 10, 15]),
|
|
3004
|
+
...p.aspectRatio(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "adaptive")
|
|
3005
|
+
},
|
|
3006
|
+
constraints: hailuo03Constraints
|
|
2926
3007
|
}
|
|
2927
3008
|
]);
|
|
2928
3009
|
|
|
@@ -3422,7 +3503,7 @@ var { MODELS: MODELS11 } = defineModels("luma", [
|
|
|
3422
3503
|
},
|
|
3423
3504
|
// ── Ray 3.2 (early access) — buildPayload registered in luma.payloads.ts ──
|
|
3424
3505
|
{
|
|
3425
|
-
// modelId defaults to id ('luma-ray-3.2') — matches the pricing
|
|
3506
|
+
// modelId defaults to id ('luma-ray-3.2') — matches the backend pricing key.
|
|
3426
3507
|
id: "luma-ray-3.2",
|
|
3427
3508
|
name: "Luma Ray 3.2",
|
|
3428
3509
|
addedAt: "2026-06-11",
|
|
@@ -4079,9 +4160,9 @@ var { MODELS: MODELS14 } = defineModels("seedream", [
|
|
|
4079
4160
|
estimatedTime: { "1K": 20, "2K": 35 },
|
|
4080
4161
|
mode: "image",
|
|
4081
4162
|
inputType: "t2i",
|
|
4082
|
-
//
|
|
4083
|
-
//
|
|
4084
|
-
//
|
|
4163
|
+
// The backend gates 5.0-pro to 1K/2K — it rejects 3K/4K ("not supported by
|
|
4164
|
+
// model seedream_5_0_pro"). Single-image only (no group/sequential), up to
|
|
4165
|
+
// 10 reference images.
|
|
4085
4166
|
description: "Top-tier single-image generation with up to 10 reference images and 2K detail.",
|
|
4086
4167
|
features: [feat("Multi-Image Input", "input"), feat("2K", "resolution")],
|
|
4087
4168
|
// Single-image only (no sequential/batch) → no `count` param, unlike the V2 models.
|
|
@@ -4105,9 +4186,9 @@ var { MODELS: MODELS14 } = defineModels("seedream", [
|
|
|
4105
4186
|
mode: "image",
|
|
4106
4187
|
inputType: "t2i",
|
|
4107
4188
|
badge: ["popular"],
|
|
4108
|
-
//
|
|
4109
|
-
//
|
|
4110
|
-
//
|
|
4189
|
+
// The backend gates 5.0-lite to 2K/3K — it rejects 4K ("not supported by
|
|
4190
|
+
// model seedream_5_0_lite") even though the SeedreamResolution enum defines
|
|
4191
|
+
// a 4K member. Boundary-verified 2026-05-25.
|
|
4111
4192
|
description: "Speedy 3K output with negative prompt and dual-image input support.",
|
|
4112
4193
|
features: [feat("Multi-Image Input", "input"), feat("3K", "resolution")],
|
|
4113
4194
|
paramConfig: {
|
|
@@ -6619,7 +6700,6 @@ var { MODELS: MODELS27 } = defineModels("ideogram", [
|
|
|
6619
6700
|
{
|
|
6620
6701
|
id: "ideogram-p-image",
|
|
6621
6702
|
name: "Ideogram P-Image",
|
|
6622
|
-
release: "preview",
|
|
6623
6703
|
addedAt: "2026-07-28",
|
|
6624
6704
|
workflow: "ideogram/p-image/generate",
|
|
6625
6705
|
buildPayload: buildIdeogramPImagePayload,
|
|
@@ -10409,6 +10489,7 @@ var GrokImagineImageQuality = "grok-imagine-image-quality";
|
|
|
10409
10489
|
var GrokImagineVideo = "grok-imagine-video";
|
|
10410
10490
|
var GrokImagineVideo15 = "grok-imagine-video-1.5";
|
|
10411
10491
|
var GrokTts = "grok-tts";
|
|
10492
|
+
var Hailuo03 = "hailuo-03";
|
|
10412
10493
|
var Hailuo23 = "hailuo-2.3";
|
|
10413
10494
|
var Hailuo23Fast = "hailuo-2.3-fast";
|
|
10414
10495
|
var Hailuo23FastPro = "hailuo-2.3-fast-pro";
|
|
@@ -10607,6 +10688,7 @@ var Models = {
|
|
|
10607
10688
|
GrokImagineVideo,
|
|
10608
10689
|
GrokImagineVideo15,
|
|
10609
10690
|
GrokTts,
|
|
10691
|
+
Hailuo03,
|
|
10610
10692
|
Hailuo23,
|
|
10611
10693
|
Hailuo23Fast,
|
|
10612
10694
|
Hailuo23FastPro,
|