@picsart/ai-sdk 6.44.0 → 6.46.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 +32 -0
- package/index.js +172 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -141,6 +141,12 @@ type ModelInputById = {
|
|
|
141
141
|
turboMode?: boolean;
|
|
142
142
|
seed?: number;
|
|
143
143
|
};
|
|
144
|
+
"bytedance-omnihuman-v2.0": {
|
|
145
|
+
prompt?: string;
|
|
146
|
+
imageUrls: [string, ...string[]];
|
|
147
|
+
audioUrl: string;
|
|
148
|
+
enableWatermark?: boolean;
|
|
149
|
+
};
|
|
144
150
|
"bytedance-video-enhance": {
|
|
145
151
|
videoUrl: string;
|
|
146
152
|
quality?: "standard" | "professional";
|
|
@@ -1034,6 +1040,29 @@ type ModelInputById = {
|
|
|
1034
1040
|
resolution?: "720p" | "1080p";
|
|
1035
1041
|
startFrame?: string;
|
|
1036
1042
|
};
|
|
1043
|
+
"kling-v4": {
|
|
1044
|
+
prompt: string;
|
|
1045
|
+
aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9";
|
|
1046
|
+
duration?: number;
|
|
1047
|
+
resolution?: "720p" | "1080p";
|
|
1048
|
+
startFrame?: string;
|
|
1049
|
+
imageUrls?: string[];
|
|
1050
|
+
endFrame?: string;
|
|
1051
|
+
};
|
|
1052
|
+
"kling-v4-omni": {
|
|
1053
|
+
prompt: string;
|
|
1054
|
+
aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "adaptive";
|
|
1055
|
+
duration?: number;
|
|
1056
|
+
resolution?: "720p" | "1080p";
|
|
1057
|
+
startFrame?: string;
|
|
1058
|
+
endFrame?: string;
|
|
1059
|
+
imageUrls?: string[];
|
|
1060
|
+
videoUrl?: string;
|
|
1061
|
+
referType?: "feature" | "base";
|
|
1062
|
+
elementList?: Array<{
|
|
1063
|
+
element_id: string;
|
|
1064
|
+
}>;
|
|
1065
|
+
};
|
|
1037
1066
|
"kling-video-effects": {
|
|
1038
1067
|
templateId?: string;
|
|
1039
1068
|
imageUrls: [string, ...string[]];
|
|
@@ -3535,6 +3564,7 @@ declare function createClient(config: ClientConfig): AiClient;
|
|
|
3535
3564
|
declare const Models: {
|
|
3536
3565
|
readonly AsyncFlashV1: "async-flash-v1";
|
|
3537
3566
|
readonly BytedanceOmnihumanV15: "bytedance-omnihuman-v1.5";
|
|
3567
|
+
readonly BytedanceOmnihumanV20: "bytedance-omnihuman-v2.0";
|
|
3538
3568
|
readonly BytedanceVideoEnhance: "bytedance-video-enhance";
|
|
3539
3569
|
readonly BytedanceVideoUpscaler: "bytedance-video-upscaler";
|
|
3540
3570
|
readonly CaptionsaiVideoCaptions: "captionsai-video-captions";
|
|
@@ -3661,6 +3691,8 @@ declare const Models: {
|
|
|
3661
3691
|
readonly KlingV3: "kling-v3";
|
|
3662
3692
|
readonly KlingV3Omni: "kling-v3-omni";
|
|
3663
3693
|
readonly KlingV3Turbo: "kling-v3-turbo";
|
|
3694
|
+
readonly KlingV4: "kling-v4";
|
|
3695
|
+
readonly KlingV4Omni: "kling-v4-omni";
|
|
3664
3696
|
readonly KlingVideoEffects: "kling-video-effects";
|
|
3665
3697
|
readonly KlingVideoO1: "kling-video-o1";
|
|
3666
3698
|
readonly Ltx23A2v: "ltx-2.3-a2v";
|
package/index.js
CHANGED
|
@@ -1425,10 +1425,25 @@ var klingOmniAdvancedParams = {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
}
|
|
1427
1427
|
};
|
|
1428
|
+
var klingV4OmniElementList = {
|
|
1429
|
+
elementList: {
|
|
1430
|
+
label: "Element References",
|
|
1431
|
+
descriptor: {
|
|
1432
|
+
kind: "object",
|
|
1433
|
+
array: { max: 7 },
|
|
1434
|
+
fields: {
|
|
1435
|
+
element_id: { kind: "text" }
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
};
|
|
1428
1440
|
|
|
1429
1441
|
// src/vendors/catalog/kling/index.ts
|
|
1430
1442
|
var V3_DURATION = { min: 3, max: 15 };
|
|
1431
1443
|
var V26_DURATIONS = [5, 10];
|
|
1444
|
+
var V4_DURATION = { min: 3, max: 30 };
|
|
1445
|
+
var V4_PROMPT_MAX = 26e3;
|
|
1446
|
+
var V4_MAX_MIDDLE_FRAMES = 8;
|
|
1432
1447
|
var KLING_IMAGE_AR = ["16:9", "9:16", "1:1", "21:9", "4:3", "3:2", "2:3", "3:4"];
|
|
1433
1448
|
var klingV3ProVideoBase = {
|
|
1434
1449
|
workflow: "kling-text-to-video",
|
|
@@ -1470,6 +1485,27 @@ var klingV3TurboVideoBase = {
|
|
|
1470
1485
|
...params.startFrame("Start Frame")
|
|
1471
1486
|
}
|
|
1472
1487
|
};
|
|
1488
|
+
var klingV4VideoBase = {
|
|
1489
|
+
workflow: "kling-text-to-video",
|
|
1490
|
+
editWorkflow: "kling-image-to-video",
|
|
1491
|
+
mode: "video",
|
|
1492
|
+
inputType: "t2v",
|
|
1493
|
+
features: [
|
|
1494
|
+
feat("Image Input", "input"),
|
|
1495
|
+
feat("Start/Middle/End Frames", "frame"),
|
|
1496
|
+
feat("1080p", "resolution"),
|
|
1497
|
+
feat("30 sec", "duration")
|
|
1498
|
+
],
|
|
1499
|
+
paramConfig: {
|
|
1500
|
+
...params.prompt({ maxLength: V4_PROMPT_MAX }),
|
|
1501
|
+
...params.aspectRatio(["16:9", "9:16", "1:1", "21:9"]),
|
|
1502
|
+
...params.durationRange(V4_DURATION.min, V4_DURATION.max, 5),
|
|
1503
|
+
...params.resolution(["720p", "1080p"], "720p"),
|
|
1504
|
+
...params.startFrame("Start Frame"),
|
|
1505
|
+
...params.imageInput(V4_MAX_MIDDLE_FRAMES, "Middle Frames", false, "asset"),
|
|
1506
|
+
...params.endFrame("End Frame")
|
|
1507
|
+
}
|
|
1508
|
+
};
|
|
1473
1509
|
var klingV26VideoBase = {
|
|
1474
1510
|
...klingV3ProVideoBase,
|
|
1475
1511
|
features: [
|
|
@@ -1523,6 +1559,28 @@ var { MODELS } = defineModels("kling", [
|
|
|
1523
1559
|
badge: ["new"],
|
|
1524
1560
|
description: "Faster V3 variant \u2014 long-form video up to 15s with native audio, start/end frame control, and 720p/1080p output."
|
|
1525
1561
|
},
|
|
1562
|
+
// ── Video: Kling 4.0 (resolution-tiered T2V + keyframe I2V) ───────
|
|
1563
|
+
{
|
|
1564
|
+
...klingV4VideoBase,
|
|
1565
|
+
id: "kling-v4",
|
|
1566
|
+
name: "Kling 4.0",
|
|
1567
|
+
modelId: "kling-v4",
|
|
1568
|
+
addedAt: "2026-10-16",
|
|
1569
|
+
// Observed on the vendor (2026-10-16): ~3-5 min for 5s, ~7 min for 30s.
|
|
1570
|
+
estimatedTime: 240,
|
|
1571
|
+
editEstimatedTime: 240,
|
|
1572
|
+
badge: ["new"],
|
|
1573
|
+
description: "Kling 4.0 \u2014 video up to 30s at 720p or 1080p, with start, middle and end keyframes.",
|
|
1574
|
+
constraints: [
|
|
1575
|
+
// Worker: image-to-video needs the start frame (`image`); middle and
|
|
1576
|
+
// end frames are added around it. (Raw API callers may instead pass the
|
|
1577
|
+
// start frame as imageUrls[0] — the builder handles that.)
|
|
1578
|
+
{ when: { startFrame: { exists: false } }, then: {
|
|
1579
|
+
imageUrls: { disabled: true, reason: "Middle frames require a start frame." },
|
|
1580
|
+
endFrame: { disabled: true, reason: "End frame requires a start frame." }
|
|
1581
|
+
} }
|
|
1582
|
+
]
|
|
1583
|
+
},
|
|
1526
1584
|
// ── Video: Kling V2.6 (consolidated: std/pro via renderingSpeed) ──
|
|
1527
1585
|
{
|
|
1528
1586
|
...klingV26VideoBase,
|
|
@@ -1585,6 +1643,37 @@ var { MODELS } = defineModels("kling", [
|
|
|
1585
1643
|
} }
|
|
1586
1644
|
]
|
|
1587
1645
|
},
|
|
1646
|
+
// ── Video: Kling 4.0 Omni (dedicated /omni-video/kling-4.0 tasks API) ──
|
|
1647
|
+
{
|
|
1648
|
+
id: "kling-v4-omni",
|
|
1649
|
+
name: "Kling 4.0 Omni",
|
|
1650
|
+
modelId: "kling-v4-omni",
|
|
1651
|
+
addedAt: "2026-10-16",
|
|
1652
|
+
workflow: "kling-omni-video",
|
|
1653
|
+
// Observed on the vendor (2026-10-16): ~2.5-5.5 min for 5s.
|
|
1654
|
+
estimatedTime: 240,
|
|
1655
|
+
mode: "video",
|
|
1656
|
+
inputType: "t2v",
|
|
1657
|
+
badge: ["new"],
|
|
1658
|
+
description: "Kling 4.0 Omni \u2014 up to 30s at 720p or 1080p from text, frames, reference images, a reference or base video, and elements.",
|
|
1659
|
+
features: [feat("Image + Video Input", "input"), feat("1080p", "resolution"), feat("30 sec", "duration")],
|
|
1660
|
+
// Same slot layout as kling-v3-omni (payloads.ts folds them into
|
|
1661
|
+
// image_list / video_list), minus what the 4.0 API dropped: no audio,
|
|
1662
|
+
// mode tiers, multi-shot or keep_original_sound.
|
|
1663
|
+
paramConfig: {
|
|
1664
|
+
...params.prompt({ maxLength: V4_PROMPT_MAX }),
|
|
1665
|
+
...params.aspectRatio(["16:9", "9:16", "1:1", "21:9", "adaptive"]),
|
|
1666
|
+
...params.durationRange(V4_DURATION.min, V4_DURATION.max, 5),
|
|
1667
|
+
...params.resolution(["720p", "1080p"], "720p"),
|
|
1668
|
+
...params.startFrame("First Frame"),
|
|
1669
|
+
...params.endFrame("End Frame"),
|
|
1670
|
+
// Vendor cap: 10 images in total — 2 frame slots + 8 reference images.
|
|
1671
|
+
...params.imageInput(8, "Reference Images"),
|
|
1672
|
+
...params.videoInput("Reference Video", "reference", false),
|
|
1673
|
+
...klingOmniReferType,
|
|
1674
|
+
...klingV4OmniElementList
|
|
1675
|
+
}
|
|
1676
|
+
},
|
|
1588
1677
|
{
|
|
1589
1678
|
id: "kling-video-o1",
|
|
1590
1679
|
name: "Kling Video O1",
|
|
@@ -1990,6 +2079,23 @@ var buildKlingV3TurboPayload = (input) => ({
|
|
|
1990
2079
|
resolution: input.resolution ?? "720p",
|
|
1991
2080
|
...input.startFrame ? { image: input.startFrame } : {}
|
|
1992
2081
|
});
|
|
2082
|
+
var buildKlingV4Payload = (input) => {
|
|
2083
|
+
const startFrame = input.startFrame || input.imageUrls?.[0];
|
|
2084
|
+
const middleFrames = (input.startFrame ? input.imageUrls : input.imageUrls?.slice(1)) ?? [];
|
|
2085
|
+
if (input.endFrame && !startFrame) {
|
|
2086
|
+
throw new ApiError("Kling 4.0: an end frame requires a start frame.", { status: 400, code: "validation_error" });
|
|
2087
|
+
}
|
|
2088
|
+
return {
|
|
2089
|
+
prompt: input.prompt,
|
|
2090
|
+
aspect_ratio: input.aspectRatio ?? "16:9",
|
|
2091
|
+
duration: String(input.duration ?? 5),
|
|
2092
|
+
model_name: "kling-v4",
|
|
2093
|
+
resolution: input.resolution ?? "720p",
|
|
2094
|
+
...startFrame ? { image: startFrame } : {},
|
|
2095
|
+
...middleFrames.length > 0 ? { image_middle: middleFrames } : {},
|
|
2096
|
+
...input.endFrame ? { image_tail: input.endFrame } : {}
|
|
2097
|
+
};
|
|
2098
|
+
};
|
|
1993
2099
|
var buildKlingV26Payload = (input) => {
|
|
1994
2100
|
const hasEndFrame = !!(input.startFrame && input.endFrame);
|
|
1995
2101
|
const hasSound = (input.generateAudio ?? true) && !hasEndFrame;
|
|
@@ -2041,6 +2147,24 @@ var buildOmniV3 = (input) => {
|
|
|
2041
2147
|
...hasSound ? { sound: "on" } : {}
|
|
2042
2148
|
};
|
|
2043
2149
|
};
|
|
2150
|
+
var buildOmniV4 = (input) => {
|
|
2151
|
+
const imageList = [
|
|
2152
|
+
...input.startFrame ? [{ image_url: input.startFrame, type: "first_frame" }] : [],
|
|
2153
|
+
...input.endFrame ? [{ image_url: input.endFrame, type: "end_frame" }] : [],
|
|
2154
|
+
...(input.imageUrls ?? []).map((image_url) => ({ image_url }))
|
|
2155
|
+
];
|
|
2156
|
+
const videoList = input.videoUrl ? [{ video_url: input.videoUrl, refer_type: input.referType ?? "feature" }] : [];
|
|
2157
|
+
return {
|
|
2158
|
+
prompt: input.prompt,
|
|
2159
|
+
model_name: "kling-v4-omni",
|
|
2160
|
+
aspect_ratio: input.aspectRatio ?? "16:9",
|
|
2161
|
+
duration: String(input.duration ?? 5),
|
|
2162
|
+
resolution: input.resolution ?? "720p",
|
|
2163
|
+
...imageList.length ? { image_list: imageList } : {},
|
|
2164
|
+
...videoList.length ? { video_list: videoList } : {},
|
|
2165
|
+
...stringElementList(input.elementList)
|
|
2166
|
+
};
|
|
2167
|
+
};
|
|
2044
2168
|
var buildVideoO1 = (input) => {
|
|
2045
2169
|
const hasSound = input.generateAudio ?? true;
|
|
2046
2170
|
return {
|
|
@@ -2160,9 +2284,11 @@ registerPayloads(MODELS, {
|
|
|
2160
2284
|
// Combined-entry video — primary slot
|
|
2161
2285
|
"kling-v3": klingV3Builder,
|
|
2162
2286
|
"kling-v3-turbo": buildKlingV3TurboPayload,
|
|
2287
|
+
"kling-v4": buildKlingV4Payload,
|
|
2163
2288
|
"kling-v2-6": buildKlingV26Payload,
|
|
2164
2289
|
// Omni video
|
|
2165
2290
|
"kling-v3-omni": buildOmniV3,
|
|
2291
|
+
"kling-v4-omni": buildOmniV4,
|
|
2166
2292
|
"kling-video-o1": buildVideoO1,
|
|
2167
2293
|
// Motion control
|
|
2168
2294
|
"kling-motion-control-v3": buildMotionControl("kling-v3"),
|
|
@@ -2187,6 +2313,7 @@ registerPayloads(MODELS, {
|
|
|
2187
2313
|
registerEditPayloads(MODELS, {
|
|
2188
2314
|
"kling-v3": klingV3Builder,
|
|
2189
2315
|
"kling-v3-turbo": buildKlingV3TurboPayload,
|
|
2316
|
+
"kling-v4": buildKlingV4Payload,
|
|
2190
2317
|
"kling-v2-6": buildKlingV26Payload
|
|
2191
2318
|
});
|
|
2192
2319
|
|
|
@@ -2882,6 +3009,37 @@ var { MODELS: MODELS6 } = defineModels("bytedance", [
|
|
|
2882
3009
|
...p.range("seed", -1, 2147483647, -1)
|
|
2883
3010
|
}
|
|
2884
3011
|
},
|
|
3012
|
+
{
|
|
3013
|
+
id: "bytedance-omnihuman-v2.0",
|
|
3014
|
+
name: "ByteDance OmniHuman 2.0",
|
|
3015
|
+
addedAt: "2026-10-16",
|
|
3016
|
+
workflow: "bytedance/omnihuman/v2.0",
|
|
3017
|
+
// Pricing key of the direct BytePlus Vision AI integration. The catalog `id`
|
|
3018
|
+
// keeps its `v2.0` spelling for stability, so the backend key is spelled out.
|
|
3019
|
+
// Priced per second of output video (equal to the driving audio length).
|
|
3020
|
+
modelId: "bytedance-omnihuman-2.0",
|
|
3021
|
+
// Output video length equals the driving audio (4..300s), so wall time scales
|
|
3022
|
+
// with the clip. Representative mid-length figure, mirroring v1.5 — not a ceiling.
|
|
3023
|
+
estimatedTime: 250,
|
|
3024
|
+
mode: "video",
|
|
3025
|
+
inputType: "i2v",
|
|
3026
|
+
release: "preview",
|
|
3027
|
+
description: "Animate one or more subjects with realistic body movement driven by audio.",
|
|
3028
|
+
features: [
|
|
3029
|
+
feat("Image Input", "input"),
|
|
3030
|
+
feat("Audio Input", "audio"),
|
|
3031
|
+
feat("Multi-Subject", "quality")
|
|
3032
|
+
],
|
|
3033
|
+
paramConfig: {
|
|
3034
|
+
// Optional prompt steers scene/movement/camera, NOT lip-sync (the audio does).
|
|
3035
|
+
...params.prompt({ required: false }),
|
|
3036
|
+
// v2.0 takes an array of source images (person, pet or character).
|
|
3037
|
+
...params.imageInput(4, "Source Image(s)", true),
|
|
3038
|
+
...params.audioInput("Audio Track", true),
|
|
3039
|
+
// Vendor default is watermark-on; pass false for an un-watermarked result.
|
|
3040
|
+
...p.boolean("enableWatermark", true, "Watermark")
|
|
3041
|
+
}
|
|
3042
|
+
},
|
|
2885
3043
|
{
|
|
2886
3044
|
id: "bytedance-video-enhance",
|
|
2887
3045
|
name: "ByteDance Video Enhance",
|
|
@@ -2943,9 +3101,16 @@ var buildBytedanceOmniHumanPayload = (input) => ({
|
|
|
2943
3101
|
...input.turboMode ? { turbo_mode: true } : {},
|
|
2944
3102
|
...input.seed != null && input.seed !== -1 ? { seed: input.seed } : {}
|
|
2945
3103
|
});
|
|
3104
|
+
var buildBytedanceOmniHumanV2Payload = (input) => ({
|
|
3105
|
+
image_urls: input.imageUrls,
|
|
3106
|
+
audio_url: input.audioUrl,
|
|
3107
|
+
enable_watermark: input.enableWatermark,
|
|
3108
|
+
...input.prompt ? { prompt: input.prompt } : {}
|
|
3109
|
+
});
|
|
2946
3110
|
registerPayloads(MODELS6, {
|
|
2947
3111
|
"bytedance-video-enhance": buildBytedanceVideoEnhancePayload,
|
|
2948
|
-
"bytedance-omnihuman-v1.5": buildBytedanceOmniHumanPayload
|
|
3112
|
+
"bytedance-omnihuman-v1.5": buildBytedanceOmniHumanPayload,
|
|
3113
|
+
"bytedance-omnihuman-v2.0": buildBytedanceOmniHumanV2Payload
|
|
2949
3114
|
});
|
|
2950
3115
|
|
|
2951
3116
|
// src/vendors/catalog/videography.ts
|
|
@@ -15095,6 +15260,7 @@ function createClient(config) {
|
|
|
15095
15260
|
// src/generated/model-constants.ts
|
|
15096
15261
|
var AsyncFlashV1 = "async-flash-v1";
|
|
15097
15262
|
var BytedanceOmnihumanV15 = "bytedance-omnihuman-v1.5";
|
|
15263
|
+
var BytedanceOmnihumanV20 = "bytedance-omnihuman-v2.0";
|
|
15098
15264
|
var BytedanceVideoEnhance = "bytedance-video-enhance";
|
|
15099
15265
|
var BytedanceVideoUpscaler = "bytedance-video-upscaler";
|
|
15100
15266
|
var CaptionsaiVideoCaptions = "captionsai-video-captions";
|
|
@@ -15221,6 +15387,8 @@ var KlingV2a = "kling-v2a";
|
|
|
15221
15387
|
var KlingV3 = "kling-v3";
|
|
15222
15388
|
var KlingV3Omni = "kling-v3-omni";
|
|
15223
15389
|
var KlingV3Turbo = "kling-v3-turbo";
|
|
15390
|
+
var KlingV4 = "kling-v4";
|
|
15391
|
+
var KlingV4Omni = "kling-v4-omni";
|
|
15224
15392
|
var KlingVideoEffects = "kling-video-effects";
|
|
15225
15393
|
var KlingVideoO1 = "kling-video-o1";
|
|
15226
15394
|
var Ltx23A2v = "ltx-2.3-a2v";
|
|
@@ -15366,6 +15534,7 @@ var Wan30VideoPrime = "wan-3.0-video-prime";
|
|
|
15366
15534
|
var Models = {
|
|
15367
15535
|
AsyncFlashV1,
|
|
15368
15536
|
BytedanceOmnihumanV15,
|
|
15537
|
+
BytedanceOmnihumanV20,
|
|
15369
15538
|
BytedanceVideoEnhance,
|
|
15370
15539
|
BytedanceVideoUpscaler,
|
|
15371
15540
|
CaptionsaiVideoCaptions,
|
|
@@ -15492,6 +15661,8 @@ var Models = {
|
|
|
15492
15661
|
KlingV3,
|
|
15493
15662
|
KlingV3Omni,
|
|
15494
15663
|
KlingV3Turbo,
|
|
15664
|
+
KlingV4,
|
|
15665
|
+
KlingV4Omni,
|
|
15495
15666
|
KlingVideoEffects,
|
|
15496
15667
|
KlingVideoO1,
|
|
15497
15668
|
Ltx23A2v,
|