@picsart/ai-sdk 6.37.0 → 6.39.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 +9 -2
- package/index.js +99 -22
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -517,6 +517,12 @@ type ModelInputById = {
|
|
|
517
517
|
voiceName: string;
|
|
518
518
|
}>;
|
|
519
519
|
};
|
|
520
|
+
"gemini-4-argon": {
|
|
521
|
+
prompt: string;
|
|
522
|
+
imageUrls?: string[];
|
|
523
|
+
videoUrl?: string;
|
|
524
|
+
thinking?: "off" | "low" | "high";
|
|
525
|
+
};
|
|
520
526
|
"gemini-nano-banana-2.1": {
|
|
521
527
|
prompt: string;
|
|
522
528
|
aspectRatio?: "1:1" | "16:9" | "9:16" | "3:4" | "4:3" | "2:3" | "21:9" | "auto";
|
|
@@ -1065,7 +1071,7 @@ type ModelInputById = {
|
|
|
1065
1071
|
negativePrompt?: string;
|
|
1066
1072
|
aspectRatio?: "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16" | "9:21";
|
|
1067
1073
|
resolution?: "480p" | "720p" | "1080p";
|
|
1068
|
-
|
|
1074
|
+
duration?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
|
|
1069
1075
|
fps?: number;
|
|
1070
1076
|
sourceScale?: number;
|
|
1071
1077
|
videoStrength?: number;
|
|
@@ -2098,7 +2104,7 @@ type ModelInputById = {
|
|
|
2098
2104
|
type TypedModelId = keyof ModelInputById;
|
|
2099
2105
|
type ModelInput<M extends TypedModelId> = ModelInputById[M];
|
|
2100
2106
|
/** IDs of text-generation (LLM) models — narrows generateText(). */
|
|
2101
|
-
type TextModelId = "claude-fable-5" | "claude-fable-5-1" | "claude-haiku-4-5" | "claude-haiku-5-5" | "claude-opus-4-8" | "claude-opus-5" | "claude-sonnet-4-5" | "claude-sonnet-4-6" | "claude-sonnet-5" | "eleven-speech-to-text" | "gemini-2.5-flash" | "gemini-3-pro" | "gemini-3.5-flash-lite" | "gemini-3.6-flash" | "gemini-3.7-flash" | "gemini-3.8-flash" | "gpt-4.1-mini" | "gpt-4.1-nano" | "gpt-4o" | "gpt-4o-mini" | "gpt-5" | "gpt-5-mini" | "gpt-5.1" | "gpt-5.2" | "gpt-5.5" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-6-astra" | "gpt-6-luna" | "gpt-6-sol" | "grok-4.7" | "kimi-k3";
|
|
2107
|
+
type TextModelId = "claude-fable-5" | "claude-fable-5-1" | "claude-haiku-4-5" | "claude-haiku-5-5" | "claude-opus-4-8" | "claude-opus-5" | "claude-sonnet-4-5" | "claude-sonnet-4-6" | "claude-sonnet-5" | "eleven-speech-to-text" | "gemini-2.5-flash" | "gemini-3-pro" | "gemini-3.5-flash-lite" | "gemini-3.6-flash" | "gemini-3.7-flash" | "gemini-3.8-flash" | "gemini-4-argon" | "gpt-4.1-mini" | "gpt-4.1-nano" | "gpt-4o" | "gpt-4o-mini" | "gpt-5" | "gpt-5-mini" | "gpt-5.1" | "gpt-5.2" | "gpt-5.5" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-6-astra" | "gpt-6-luna" | "gpt-6-sol" | "grok-4.7" | "kimi-k3";
|
|
2102
2108
|
type TextModelInputById = Pick<ModelInputById, TextModelId>;
|
|
2103
2109
|
/** IDs of structured-output (json-mode) models — narrows run()'s result type. */
|
|
2104
2110
|
type JsonModelId = "typesafe-evaluate";
|
|
@@ -3515,6 +3521,7 @@ declare const Models: {
|
|
|
3515
3521
|
readonly Gemini38Flash: "gemini-3.8-flash";
|
|
3516
3522
|
readonly Gemini38FlashLiteTts: "gemini-3.8-flash-lite-tts";
|
|
3517
3523
|
readonly Gemini38FlashTts: "gemini-3.8-flash-tts";
|
|
3524
|
+
readonly Gemini4Argon: "gemini-4-argon";
|
|
3518
3525
|
readonly GeminiNanoBanana21: "gemini-nano-banana-2.1";
|
|
3519
3526
|
readonly GeminiOmni11FlashPreview: "gemini-omni-1.1-flash-preview";
|
|
3520
3527
|
readonly GeminiOmniFlashPreview: "gemini-omni-flash-preview";
|
package/index.js
CHANGED
|
@@ -2198,6 +2198,47 @@ var LTX_23_REFRAME_RESOLUTIONS = ["720p", "1080p"];
|
|
|
2198
2198
|
var LTX_23_REFRAME_AR = ["16:9", "9:16", "1:1", "4:5", "5:4"];
|
|
2199
2199
|
var LTX_23_OUTPAINT_RESOLUTIONS = ["480p", "720p", "1080p"];
|
|
2200
2200
|
var LTX_23_OUTPAINT_AR = ["21:9", "16:9", "4:3", "1:1", "3:4", "9:16", "9:21"];
|
|
2201
|
+
var LTX_23_OUTPAINT_DURATIONS = [
|
|
2202
|
+
1,
|
|
2203
|
+
2,
|
|
2204
|
+
3,
|
|
2205
|
+
4,
|
|
2206
|
+
5,
|
|
2207
|
+
6,
|
|
2208
|
+
7,
|
|
2209
|
+
8,
|
|
2210
|
+
9,
|
|
2211
|
+
10,
|
|
2212
|
+
11,
|
|
2213
|
+
12,
|
|
2214
|
+
13,
|
|
2215
|
+
14,
|
|
2216
|
+
15,
|
|
2217
|
+
16,
|
|
2218
|
+
17,
|
|
2219
|
+
18,
|
|
2220
|
+
19,
|
|
2221
|
+
20
|
|
2222
|
+
];
|
|
2223
|
+
var LTX_23_OUTPAINT_MIN_FRAMES = 9;
|
|
2224
|
+
var LTX_23_OUTPAINT_MAX_FRAMES = 481;
|
|
2225
|
+
var LTX_23_OUTPAINT_FPS_MAX = 60;
|
|
2226
|
+
var ltxOutpaintDurationConstraints = [];
|
|
2227
|
+
for (let fps = 1; fps <= LTX_23_OUTPAINT_FPS_MAX; fps++) {
|
|
2228
|
+
const allowed = LTX_23_OUTPAINT_DURATIONS.filter(
|
|
2229
|
+
(d) => d * fps >= LTX_23_OUTPAINT_MIN_FRAMES && d * fps <= LTX_23_OUTPAINT_MAX_FRAMES
|
|
2230
|
+
);
|
|
2231
|
+
if (allowed.length === LTX_23_OUTPAINT_DURATIONS.length) continue;
|
|
2232
|
+
ltxOutpaintDurationConstraints.push({
|
|
2233
|
+
when: { fps: { is: fps } },
|
|
2234
|
+
then: {
|
|
2235
|
+
duration: {
|
|
2236
|
+
allowed,
|
|
2237
|
+
reason: `At ${fps} fps the clip must run ${allowed[0]}\u2013${allowed[allowed.length - 1]}s (the ${LTX_23_OUTPAINT_MIN_FRAMES}\u2013${LTX_23_OUTPAINT_MAX_FRAMES}-frame window).`
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
});
|
|
2241
|
+
}
|
|
2201
2242
|
var LTX_25_AR = ["16:9", "9:16"];
|
|
2202
2243
|
var LTX_25_PRO_RESOLUTIONS = ["720p", "1080p"];
|
|
2203
2244
|
var LTX_25_FAST_RESOLUTIONS = ["720p", "1080p", "1440p", "2160p"];
|
|
@@ -2543,8 +2584,11 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
|
|
|
2543
2584
|
...params.negativePrompt(),
|
|
2544
2585
|
...params.aspectRatio(LTX_23_OUTPAINT_AR),
|
|
2545
2586
|
...params.resolution(LTX_23_OUTPAINT_RESOLUTIONS, "720p"),
|
|
2546
|
-
|
|
2547
|
-
|
|
2587
|
+
// Duration is an enum; fps stays a slider. The per-fps constraint below
|
|
2588
|
+
// trims the duration options, and the builder derives the wire's num_frames
|
|
2589
|
+
// (clamped) from duration × fps.
|
|
2590
|
+
...params.duration(LTX_23_OUTPAINT_DURATIONS, 6),
|
|
2591
|
+
...p.range("fps", 1, 60, 24, { step: 1, label: "FPS" }),
|
|
2548
2592
|
// 1.0 fits the source as large as the canvas allows; lower values zoom it
|
|
2549
2593
|
// out and leave a wider generated border, which the vendor calls less stable.
|
|
2550
2594
|
...p.range("sourceScale", 0.25, 1, 1, { step: 0.05, label: "Source Scale" }),
|
|
@@ -2559,7 +2603,10 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
|
|
|
2559
2603
|
...p.boolean("enableSafetyChecker", true, "Safety Checker"),
|
|
2560
2604
|
// Default-less on purpose: unset means the vendor picks a random seed.
|
|
2561
2605
|
...params.seed()
|
|
2562
|
-
}
|
|
2606
|
+
},
|
|
2607
|
+
// Raising fps packs more frames per second, so it shortens the longest clip
|
|
2608
|
+
// that fits the vendor's 481-frame ceiling — hence the duration options trim.
|
|
2609
|
+
constraints: ltxOutpaintDurationConstraints
|
|
2563
2610
|
},
|
|
2564
2611
|
// ── LTX 2.5 ──────────────────────────────────────────────────────
|
|
2565
2612
|
// One entry per tier: text-to-video on `workflow`, image-to-video on
|
|
@@ -10455,6 +10502,24 @@ var { MODELS: OPENAI_LLM } = defineModels("openai", [
|
|
|
10455
10502
|
}
|
|
10456
10503
|
]);
|
|
10457
10504
|
var { MODELS: GEMINI_LLM } = defineModels("google", [
|
|
10505
|
+
{
|
|
10506
|
+
id: "gemini-4-argon",
|
|
10507
|
+
name: "Gemini 4 Argon",
|
|
10508
|
+
workflow: "gemini",
|
|
10509
|
+
addedAt: "2026-10-14",
|
|
10510
|
+
estimatedTime: 8,
|
|
10511
|
+
mode: "text",
|
|
10512
|
+
inputType: "v2t",
|
|
10513
|
+
badge: ["premium"],
|
|
10514
|
+
description: "Google\u2019s flagship Gemini 4 reasoning model \u2014 text, image, and video with deep reasoning and 1M-token context.",
|
|
10515
|
+
features: [feat("Vision", "input"), feat("Video Input", "input"), feat("Thinking", "characteristic")],
|
|
10516
|
+
paramConfig: {
|
|
10517
|
+
...params.prompt(),
|
|
10518
|
+
...params.imageInput(8, "Images"),
|
|
10519
|
+
...params.videoInput("Video", "reference", false),
|
|
10520
|
+
...thinkingParam(["low", "high"])
|
|
10521
|
+
}
|
|
10522
|
+
},
|
|
10458
10523
|
{
|
|
10459
10524
|
id: "gemini-3-pro",
|
|
10460
10525
|
name: "Gemini 3 Pro",
|
|
@@ -10675,6 +10740,7 @@ registerPayloads(MODELS35, {
|
|
|
10675
10740
|
"gpt-4o-mini": buildOpenAiPayload("gpt-4o-mini"),
|
|
10676
10741
|
"gpt-4.1-mini": buildOpenAiPayload("gpt-4.1-mini"),
|
|
10677
10742
|
"gpt-4.1-nano": buildOpenAiPayload("gpt-4.1-nano"),
|
|
10743
|
+
"gemini-4-argon": buildGeminiPayload("gemini-4-argon"),
|
|
10678
10744
|
"gemini-3-pro": buildGeminiPayload("gemini-3-pro-preview"),
|
|
10679
10745
|
// Flash models route through chat-completions (OpenAI-shaped), not the
|
|
10680
10746
|
// native `gemini` workflow.
|
|
@@ -11043,25 +11109,34 @@ var buildLtx23ReframePayload = (input) => ({
|
|
|
11043
11109
|
...input.resolution ? { resolution: input.resolution } : {},
|
|
11044
11110
|
...input.aspectRatio ? { aspect_ratio: input.aspectRatio } : {}
|
|
11045
11111
|
});
|
|
11046
|
-
var
|
|
11047
|
-
|
|
11048
|
-
|
|
11049
|
-
|
|
11050
|
-
|
|
11051
|
-
|
|
11052
|
-
|
|
11053
|
-
|
|
11054
|
-
|
|
11055
|
-
|
|
11056
|
-
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
}
|
|
11112
|
+
var OUTPAINT_NUM_FRAMES_MIN = 9;
|
|
11113
|
+
var OUTPAINT_NUM_FRAMES_MAX = 481;
|
|
11114
|
+
var buildLtx23OutpaintPayload = (input) => {
|
|
11115
|
+
const fps = input.fps ?? 24;
|
|
11116
|
+
const numFrames = input.duration != null ? Math.min(
|
|
11117
|
+
OUTPAINT_NUM_FRAMES_MAX,
|
|
11118
|
+
Math.max(OUTPAINT_NUM_FRAMES_MIN, Math.round(input.duration * fps))
|
|
11119
|
+
) : void 0;
|
|
11120
|
+
return {
|
|
11121
|
+
prompt: input.prompt,
|
|
11122
|
+
video_url: input.videoUrl,
|
|
11123
|
+
...input.negativePrompt ? { negative_prompt: input.negativePrompt } : {},
|
|
11124
|
+
...input.aspectRatio ? { aspect_ratio: input.aspectRatio } : {},
|
|
11125
|
+
...input.resolution ? { output_resolution: input.resolution } : {},
|
|
11126
|
+
...numFrames != null ? { num_frames: numFrames } : {},
|
|
11127
|
+
...input.fps != null ? { frames_per_second: input.fps } : {},
|
|
11128
|
+
...input.sourceScale != null ? { source_scale: input.sourceScale } : {},
|
|
11129
|
+
...input.videoStrength != null ? { video_strength: input.videoStrength } : {},
|
|
11130
|
+
...input.cfgScale != null ? { guidance_scale: input.cfgScale } : {},
|
|
11131
|
+
...input.numInferenceSteps != null ? { num_inference_steps: input.numInferenceSteps } : {},
|
|
11132
|
+
...input.videoQuality ? { video_quality: input.videoQuality } : {},
|
|
11133
|
+
...input.videoWriteMode ? { video_write_mode: input.videoWriteMode } : {},
|
|
11134
|
+
...input.seed != null ? { seed: input.seed } : {},
|
|
11135
|
+
enable_prompt_expansion: input.enhancePrompt ?? true,
|
|
11136
|
+
generate_audio: input.generateAudio ?? true,
|
|
11137
|
+
enable_safety_checker: input.enableSafetyChecker ?? true
|
|
11138
|
+
};
|
|
11139
|
+
};
|
|
11065
11140
|
registerPayloads(MODELS2, {
|
|
11066
11141
|
"ltx-v2.5-pro": buildLtx25ProT2VPayload,
|
|
11067
11142
|
"ltx-v2.5-fast": buildLtx25FastT2VPayload,
|
|
@@ -14697,6 +14772,7 @@ var Gemini37Flash = "gemini-3.7-flash";
|
|
|
14697
14772
|
var Gemini38Flash = "gemini-3.8-flash";
|
|
14698
14773
|
var Gemini38FlashLiteTts = "gemini-3.8-flash-lite-tts";
|
|
14699
14774
|
var Gemini38FlashTts = "gemini-3.8-flash-tts";
|
|
14775
|
+
var Gemini4Argon = "gemini-4-argon";
|
|
14700
14776
|
var GeminiNanoBanana21 = "gemini-nano-banana-2.1";
|
|
14701
14777
|
var GeminiOmni11FlashPreview = "gemini-omni-1.1-flash-preview";
|
|
14702
14778
|
var GeminiOmniFlashPreview = "gemini-omni-flash-preview";
|
|
@@ -14961,6 +15037,7 @@ var Models = {
|
|
|
14961
15037
|
Gemini38Flash,
|
|
14962
15038
|
Gemini38FlashLiteTts,
|
|
14963
15039
|
Gemini38FlashTts,
|
|
15040
|
+
Gemini4Argon,
|
|
14964
15041
|
GeminiNanoBanana21,
|
|
14965
15042
|
GeminiOmni11FlashPreview,
|
|
14966
15043
|
GeminiOmniFlashPreview,
|