@picsart/ai-sdk 5.14.0 → 5.16.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 +0 -41
- package/index.js +12 -139
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -505,14 +505,6 @@ type ModelInputById = {
|
|
|
505
505
|
imageUrls: [string, ...string[]];
|
|
506
506
|
videoUrl: string;
|
|
507
507
|
};
|
|
508
|
-
"kling-multi-image": {
|
|
509
|
-
prompt?: string;
|
|
510
|
-
aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "4:3" | "3:2" | "2:3" | "3:4";
|
|
511
|
-
count?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
512
|
-
imageUrls: [string, ...string[]];
|
|
513
|
-
sceneImage?: string;
|
|
514
|
-
styleImage?: string;
|
|
515
|
-
};
|
|
516
508
|
"kling-multi-image-v2-1": {
|
|
517
509
|
prompt?: string;
|
|
518
510
|
aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "4:3" | "3:2" | "2:3" | "3:4";
|
|
@@ -532,16 +524,6 @@ type ModelInputById = {
|
|
|
532
524
|
prompt: string;
|
|
533
525
|
duration?: number;
|
|
534
526
|
};
|
|
535
|
-
"kling-v1-5-image": {
|
|
536
|
-
prompt: string;
|
|
537
|
-
aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "4:3" | "3:2" | "2:3" | "3:4";
|
|
538
|
-
count?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
539
|
-
negativePrompt?: string;
|
|
540
|
-
imageUrls: [string, ...string[]];
|
|
541
|
-
imageReference?: "subject" | "face";
|
|
542
|
-
imageWeight?: number;
|
|
543
|
-
humanFidelity?: number;
|
|
544
|
-
};
|
|
545
527
|
"kling-v2-1-image": {
|
|
546
528
|
prompt: string;
|
|
547
529
|
aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "4:3" | "3:2" | "2:3" | "3:4";
|
|
@@ -562,25 +544,6 @@ type ModelInputById = {
|
|
|
562
544
|
cfgScale?: number;
|
|
563
545
|
renderingSpeed?: "std" | "pro";
|
|
564
546
|
};
|
|
565
|
-
"kling-v2-image": {
|
|
566
|
-
prompt: string;
|
|
567
|
-
aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "4:3" | "3:2" | "2:3" | "3:4";
|
|
568
|
-
count?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
569
|
-
negativePrompt?: string;
|
|
570
|
-
imageUrls?: string[];
|
|
571
|
-
imageWeight?: number;
|
|
572
|
-
humanFidelity?: number;
|
|
573
|
-
};
|
|
574
|
-
"kling-v2-new-image": {
|
|
575
|
-
prompt: string;
|
|
576
|
-
aspectRatio?: "16:9" | "9:16" | "1:1" | "21:9" | "4:3" | "3:2" | "2:3" | "3:4";
|
|
577
|
-
count?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
578
|
-
negativePrompt?: string;
|
|
579
|
-
imageUrls: [string, ...string[]];
|
|
580
|
-
imageReference?: "subject" | "face";
|
|
581
|
-
imageWeight?: number;
|
|
582
|
-
humanFidelity?: number;
|
|
583
|
-
};
|
|
584
547
|
"kling-v2a": {
|
|
585
548
|
videoUrl: string;
|
|
586
549
|
};
|
|
@@ -2510,15 +2473,11 @@ declare const Models: {
|
|
|
2510
2473
|
readonly KlingElements: "kling-elements";
|
|
2511
2474
|
readonly KlingMotionControl: "kling-motion-control";
|
|
2512
2475
|
readonly KlingMotionControlV3: "kling-motion-control-v3";
|
|
2513
|
-
readonly KlingMultiImage: "kling-multi-image";
|
|
2514
2476
|
readonly KlingMultiImageV21: "kling-multi-image-v2-1";
|
|
2515
2477
|
readonly KlingO1Image: "kling-o1-image";
|
|
2516
2478
|
readonly KlingT2a: "kling-t2a";
|
|
2517
|
-
readonly KlingV15Image: "kling-v1-5-image";
|
|
2518
2479
|
readonly KlingV21Image: "kling-v2-1-image";
|
|
2519
2480
|
readonly KlingV26: "kling-v2-6";
|
|
2520
|
-
readonly KlingV2Image: "kling-v2-image";
|
|
2521
|
-
readonly KlingV2NewImage: "kling-v2-new-image";
|
|
2522
2481
|
readonly KlingV2a: "kling-v2a";
|
|
2523
2482
|
readonly KlingV3: "kling-v3";
|
|
2524
2483
|
readonly KlingV3Omni: "kling-v3-omni";
|
package/index.js
CHANGED
|
@@ -1285,20 +1285,6 @@ var paramPresets = {
|
|
|
1285
1285
|
var feat = (label, variant) => ({ label, variant });
|
|
1286
1286
|
|
|
1287
1287
|
// src/vendors/catalog/kling/params.ts
|
|
1288
|
-
var klingImageReference = {
|
|
1289
|
-
imageReference: {
|
|
1290
|
-
label: "Reference Mode",
|
|
1291
|
-
descriptor: {
|
|
1292
|
-
kind: "enum",
|
|
1293
|
-
valueType: "string",
|
|
1294
|
-
options: [
|
|
1295
|
-
{ id: "subject", label: "Subject" },
|
|
1296
|
-
{ id: "face", label: "Face" }
|
|
1297
|
-
],
|
|
1298
|
-
default: "subject"
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
};
|
|
1302
1288
|
var klingHumanFidelity = {
|
|
1303
1289
|
humanFidelity: {
|
|
1304
1290
|
label: "Face Fidelity",
|
|
@@ -1750,52 +1736,6 @@ var { MODELS } = defineModels("kling", [
|
|
|
1750
1736
|
}
|
|
1751
1737
|
},
|
|
1752
1738
|
// ── Image: Generations ──────────────────────────────────────────
|
|
1753
|
-
{
|
|
1754
|
-
id: "kling-v2-new-image",
|
|
1755
|
-
name: "Kling V2 New Image",
|
|
1756
|
-
modelId: "kling-v2-new",
|
|
1757
|
-
addedAt: "2026-03-25",
|
|
1758
|
-
workflow: "kling/v1/images/generations",
|
|
1759
|
-
estimatedTime: 15,
|
|
1760
|
-
mode: "image",
|
|
1761
|
-
inputType: "t2i",
|
|
1762
|
-
description: "Latest V2 image generation with optional restyle via image reference.",
|
|
1763
|
-
features: [feat("Image Input", "input"), feat("Negative Prompt", "characteristic")],
|
|
1764
|
-
paramConfig: {
|
|
1765
|
-
...params.prompt({ maxLength: 2500 }),
|
|
1766
|
-
...params.aspectRatio(KLING_IMAGE_AR),
|
|
1767
|
-
...params.count([1, 2, 3, 4, 5, 6, 7, 8, 9]),
|
|
1768
|
-
...params.negativePrompt(),
|
|
1769
|
-
...params.imageInput(1, "Restyle Image", true),
|
|
1770
|
-
// backend requires image despite t2i
|
|
1771
|
-
...klingImageReference,
|
|
1772
|
-
...params.imageWeight(0, 100, 50, 5),
|
|
1773
|
-
...klingHumanFidelity
|
|
1774
|
-
}
|
|
1775
|
-
},
|
|
1776
|
-
{
|
|
1777
|
-
id: "kling-v2-image",
|
|
1778
|
-
name: "Kling V2 Image",
|
|
1779
|
-
modelId: "kling-v2",
|
|
1780
|
-
addedAt: "2026-03-25",
|
|
1781
|
-
deprecated: true,
|
|
1782
|
-
// superseded by kling-v3-omni / kling-v3-pro
|
|
1783
|
-
workflow: "kling/v1/images/generations",
|
|
1784
|
-
estimatedTime: 15,
|
|
1785
|
-
mode: "image",
|
|
1786
|
-
inputType: "t2i",
|
|
1787
|
-
description: "Standard V2 image generation with optional restyle via image reference.",
|
|
1788
|
-
features: [feat("Image Input", "input"), feat("Negative Prompt", "characteristic")],
|
|
1789
|
-
paramConfig: {
|
|
1790
|
-
...params.prompt({ maxLength: 2500 }),
|
|
1791
|
-
...params.aspectRatio(KLING_IMAGE_AR),
|
|
1792
|
-
...params.count([1, 2, 3, 4, 5, 6, 7, 8, 9]),
|
|
1793
|
-
...params.negativePrompt(),
|
|
1794
|
-
...params.imageInput(1, "Restyle Image"),
|
|
1795
|
-
...params.imageWeight(0, 100, 50, 5),
|
|
1796
|
-
...klingHumanFidelity
|
|
1797
|
-
}
|
|
1798
|
-
},
|
|
1799
1739
|
{
|
|
1800
1740
|
id: "kling-v2-1-image",
|
|
1801
1741
|
name: "Kling V2.1 Image",
|
|
@@ -1819,61 +1759,7 @@ var { MODELS } = defineModels("kling", [
|
|
|
1819
1759
|
...klingHumanFidelity
|
|
1820
1760
|
}
|
|
1821
1761
|
},
|
|
1822
|
-
{
|
|
1823
|
-
id: "kling-v1-5-image",
|
|
1824
|
-
name: "Kling V1.5 Image",
|
|
1825
|
-
modelId: "kling-v1-5",
|
|
1826
|
-
addedAt: "2026-03-25",
|
|
1827
|
-
deprecated: true,
|
|
1828
|
-
// superseded by kling-v3-omni (4 generations behind)
|
|
1829
|
-
workflow: "kling/v1/images/generations",
|
|
1830
|
-
estimatedTime: 15,
|
|
1831
|
-
mode: "image",
|
|
1832
|
-
inputType: "t2i",
|
|
1833
|
-
description: "V1.5 image generation with subject and face reference support.",
|
|
1834
|
-
features: [feat("Image Input", "input"), feat("Negative Prompt", "characteristic")],
|
|
1835
|
-
paramConfig: {
|
|
1836
|
-
...params.prompt({ maxLength: 2500 }),
|
|
1837
|
-
...params.aspectRatio(KLING_IMAGE_AR),
|
|
1838
|
-
...params.count([1, 2, 3, 4, 5, 6, 7, 8, 9]),
|
|
1839
|
-
...params.negativePrompt(),
|
|
1840
|
-
...params.imageInput(1, "Restyle Image", true),
|
|
1841
|
-
...klingImageReference,
|
|
1842
|
-
...params.imageWeight(0, 100, 50, 5),
|
|
1843
|
-
...klingHumanFidelity
|
|
1844
|
-
}
|
|
1845
|
-
},
|
|
1846
1762
|
// ── Image: Multi-Image-to-Image ─────────────────────────────────
|
|
1847
|
-
{
|
|
1848
|
-
id: "kling-multi-image",
|
|
1849
|
-
name: "Kling Multi-Image",
|
|
1850
|
-
modelId: "kling-v2-multi",
|
|
1851
|
-
addedAt: "2026-03-25",
|
|
1852
|
-
deprecated: true,
|
|
1853
|
-
// V2 is 3 generations behind v3
|
|
1854
|
-
workflow: "kling/v1/images/multi-image-to-image",
|
|
1855
|
-
estimatedTime: 20,
|
|
1856
|
-
mode: "image",
|
|
1857
|
-
inputType: "i2i",
|
|
1858
|
-
description: "Compose up to 4 subject images into a new scene with optional prompt.",
|
|
1859
|
-
features: [feat("Multi-Image Input", "input")],
|
|
1860
|
-
paramConfig: {
|
|
1861
|
-
...params.prompt({ required: false, maxLength: 2500 }),
|
|
1862
|
-
...params.aspectRatio(KLING_IMAGE_AR, "16:9"),
|
|
1863
|
-
...params.count([1, 2, 3, 4, 5, 6, 7, 8, 9]),
|
|
1864
|
-
...params.imageInput(4, "Subject Images", true),
|
|
1865
|
-
sceneImage: {
|
|
1866
|
-
label: "Scene Reference",
|
|
1867
|
-
category: "reference",
|
|
1868
|
-
descriptor: { kind: "file", accept: "image" }
|
|
1869
|
-
},
|
|
1870
|
-
styleImage: {
|
|
1871
|
-
label: "Style Reference",
|
|
1872
|
-
category: "reference",
|
|
1873
|
-
descriptor: { kind: "file", accept: "image" }
|
|
1874
|
-
}
|
|
1875
|
-
}
|
|
1876
|
-
},
|
|
1877
1763
|
{
|
|
1878
1764
|
id: "kling-multi-image-v2-1",
|
|
1879
1765
|
name: "Kling Multi-Image V2.1",
|
|
@@ -1949,7 +1835,6 @@ var { MODELS } = defineModels("kling", [
|
|
|
1949
1835
|
}
|
|
1950
1836
|
}
|
|
1951
1837
|
},
|
|
1952
|
-
// ── Video: Video Effects ────────────────────────────────────────────
|
|
1953
1838
|
{
|
|
1954
1839
|
id: "kling-video-effects",
|
|
1955
1840
|
name: "Kling Video Effects",
|
|
@@ -1959,7 +1844,7 @@ var { MODELS } = defineModels("kling", [
|
|
|
1959
1844
|
mode: "video",
|
|
1960
1845
|
inputType: "i2v",
|
|
1961
1846
|
badge: ["new"],
|
|
1962
|
-
description: "Apply
|
|
1847
|
+
description: "Apply 190+ visual effects to photos \u2014 single or dual-image scenes.",
|
|
1963
1848
|
features: [feat("Image Input", "input"), feat("Video Effects", "characteristic")],
|
|
1964
1849
|
paramConfig: {
|
|
1965
1850
|
...params.catalog("templateId", {
|
|
@@ -2124,24 +2009,21 @@ var buildOmniImage = (modelName) => (input) => ({
|
|
|
2124
2009
|
...input.resolution ? { resolution: input.resolution } : {},
|
|
2125
2010
|
...input.imageUrls?.length ? { image_list: input.imageUrls.map((url) => ({ image_url: url })) } : {}
|
|
2126
2011
|
});
|
|
2127
|
-
var buildGenerations = (
|
|
2128
|
-
const
|
|
2129
|
-
const hasImage = !!imageUrls?.[0];
|
|
2130
|
-
const imageReference = hasImage && "imageReference" in input ? input.imageReference ?? (modelName === "kling-v1-5" ? "subject" : void 0) : void 0;
|
|
2012
|
+
var buildGenerations = (input) => {
|
|
2013
|
+
const hasImage = !!input.imageUrls?.[0];
|
|
2131
2014
|
return {
|
|
2132
2015
|
prompt: input.prompt,
|
|
2133
|
-
model_name:
|
|
2016
|
+
model_name: "kling-v2-1",
|
|
2134
2017
|
n: input.count ?? 1,
|
|
2135
2018
|
...input.aspectRatio ? { aspect_ratio: input.aspectRatio } : {},
|
|
2136
2019
|
...input.negativePrompt ? { negative_prompt: input.negativePrompt } : {},
|
|
2137
|
-
...hasImage ? { image: imageUrls[0] } : {},
|
|
2138
|
-
...imageReference ? { image_reference: imageReference } : {},
|
|
2020
|
+
...hasImage ? { image: input.imageUrls[0] } : {},
|
|
2139
2021
|
...hasImage && input.imageWeight != null ? { image_fidelity: input.imageWeight / 100 } : {},
|
|
2140
2022
|
...input.humanFidelity != null ? { human_fidelity: input.humanFidelity } : {}
|
|
2141
2023
|
};
|
|
2142
2024
|
};
|
|
2143
|
-
var buildMultiImage = (
|
|
2144
|
-
model_name:
|
|
2025
|
+
var buildMultiImage = (input) => ({
|
|
2026
|
+
model_name: "kling-v2-1",
|
|
2145
2027
|
n: input.count ?? 1,
|
|
2146
2028
|
...input.prompt ? { prompt: input.prompt } : {},
|
|
2147
2029
|
subject_image_list: (input.imageUrls ?? []).map((url) => ({ subject_image: url })),
|
|
@@ -2198,13 +2080,9 @@ registerPayloads(MODELS, {
|
|
|
2198
2080
|
"kling-3.0-image": buildOmniImage("kling-v3-omni"),
|
|
2199
2081
|
"kling-o1-image": buildOmniImage("kling-image-o1"),
|
|
2200
2082
|
// Generations
|
|
2201
|
-
"kling-v2-
|
|
2202
|
-
"kling-v2-image": buildGenerations("kling-v2"),
|
|
2203
|
-
"kling-v2-1-image": buildGenerations("kling-v2-1"),
|
|
2204
|
-
"kling-v1-5-image": buildGenerations("kling-v1-5"),
|
|
2083
|
+
"kling-v2-1-image": buildGenerations,
|
|
2205
2084
|
// Multi-image
|
|
2206
|
-
"kling-multi-image": buildMultiImage
|
|
2207
|
-
"kling-multi-image-v2-1": buildMultiImage("kling-v2-1"),
|
|
2085
|
+
"kling-multi-image-v2-1": buildMultiImage,
|
|
2208
2086
|
// Elements
|
|
2209
2087
|
"kling-elements": buildKlingElementsPayload,
|
|
2210
2088
|
// Video effects
|
|
@@ -5030,6 +4908,7 @@ var { MODELS: MODELS18 } = defineModels("pika", [
|
|
|
5030
4908
|
id: "pika-2.2",
|
|
5031
4909
|
name: "Pika",
|
|
5032
4910
|
addedAt: "2026-02-06",
|
|
4911
|
+
deprecated: true,
|
|
5033
4912
|
workflow: "pika-text-to-video-v2-2",
|
|
5034
4913
|
editWorkflow: "pika-image-to-video-v2-2",
|
|
5035
4914
|
buildPayload: buildPikaPayload,
|
|
@@ -5051,6 +4930,7 @@ var { MODELS: MODELS18 } = defineModels("pika", [
|
|
|
5051
4930
|
id: "pika-2.2-scenes",
|
|
5052
4931
|
name: "Pika Scenes",
|
|
5053
4932
|
addedAt: "2026-02-06",
|
|
4933
|
+
deprecated: true,
|
|
5054
4934
|
workflow: "pika-scenes-v2-2",
|
|
5055
4935
|
buildPayload: buildPikaScenesPayload,
|
|
5056
4936
|
estimatedTime: 55,
|
|
@@ -5070,6 +4950,7 @@ var { MODELS: MODELS18 } = defineModels("pika", [
|
|
|
5070
4950
|
id: "pika-2.2-frames",
|
|
5071
4951
|
name: "Pika Frames",
|
|
5072
4952
|
addedAt: "2026-02-06",
|
|
4953
|
+
deprecated: true,
|
|
5073
4954
|
workflow: "pika-frames-v2-2",
|
|
5074
4955
|
buildPayload: buildPikaFramesPayload,
|
|
5075
4956
|
estimatedTime: 50,
|
|
@@ -10588,15 +10469,11 @@ var KlingAvatar = "kling-avatar";
|
|
|
10588
10469
|
var KlingElements = "kling-elements";
|
|
10589
10470
|
var KlingMotionControl = "kling-motion-control";
|
|
10590
10471
|
var KlingMotionControlV3 = "kling-motion-control-v3";
|
|
10591
|
-
var KlingMultiImage = "kling-multi-image";
|
|
10592
10472
|
var KlingMultiImageV21 = "kling-multi-image-v2-1";
|
|
10593
10473
|
var KlingO1Image = "kling-o1-image";
|
|
10594
10474
|
var KlingT2a = "kling-t2a";
|
|
10595
|
-
var KlingV15Image = "kling-v1-5-image";
|
|
10596
10475
|
var KlingV21Image = "kling-v2-1-image";
|
|
10597
10476
|
var KlingV26 = "kling-v2-6";
|
|
10598
|
-
var KlingV2Image = "kling-v2-image";
|
|
10599
|
-
var KlingV2NewImage = "kling-v2-new-image";
|
|
10600
10477
|
var KlingV2a = "kling-v2a";
|
|
10601
10478
|
var KlingV3 = "kling-v3";
|
|
10602
10479
|
var KlingV3Omni = "kling-v3-omni";
|
|
@@ -10798,15 +10675,11 @@ var Models = {
|
|
|
10798
10675
|
KlingElements,
|
|
10799
10676
|
KlingMotionControl,
|
|
10800
10677
|
KlingMotionControlV3,
|
|
10801
|
-
KlingMultiImage,
|
|
10802
10678
|
KlingMultiImageV21,
|
|
10803
10679
|
KlingO1Image,
|
|
10804
10680
|
KlingT2a,
|
|
10805
|
-
KlingV15Image,
|
|
10806
10681
|
KlingV21Image,
|
|
10807
10682
|
KlingV26,
|
|
10808
|
-
KlingV2Image,
|
|
10809
|
-
KlingV2NewImage,
|
|
10810
10683
|
KlingV2a,
|
|
10811
10684
|
KlingV3,
|
|
10812
10685
|
KlingV3Omni,
|