@picsart/ai-sdk 5.15.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.
Files changed (3) hide show
  1. package/index.d.ts +0 -41
  2. package/index.js +9 -139
  3. 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 270+ visual effects to photos \u2014 single or dual-image scenes.",
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 = (modelName) => (input) => {
2128
- const imageUrls = input.imageUrls;
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: modelName,
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 = (modelName) => (input) => ({
2144
- model_name: modelName,
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-new-image": buildGenerations("kling-v2-new"),
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("kling-v2"),
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
@@ -10591,15 +10469,11 @@ var KlingAvatar = "kling-avatar";
10591
10469
  var KlingElements = "kling-elements";
10592
10470
  var KlingMotionControl = "kling-motion-control";
10593
10471
  var KlingMotionControlV3 = "kling-motion-control-v3";
10594
- var KlingMultiImage = "kling-multi-image";
10595
10472
  var KlingMultiImageV21 = "kling-multi-image-v2-1";
10596
10473
  var KlingO1Image = "kling-o1-image";
10597
10474
  var KlingT2a = "kling-t2a";
10598
- var KlingV15Image = "kling-v1-5-image";
10599
10475
  var KlingV21Image = "kling-v2-1-image";
10600
10476
  var KlingV26 = "kling-v2-6";
10601
- var KlingV2Image = "kling-v2-image";
10602
- var KlingV2NewImage = "kling-v2-new-image";
10603
10477
  var KlingV2a = "kling-v2a";
10604
10478
  var KlingV3 = "kling-v3";
10605
10479
  var KlingV3Omni = "kling-v3-omni";
@@ -10801,15 +10675,11 @@ var Models = {
10801
10675
  KlingElements,
10802
10676
  KlingMotionControl,
10803
10677
  KlingMotionControlV3,
10804
- KlingMultiImage,
10805
10678
  KlingMultiImageV21,
10806
10679
  KlingO1Image,
10807
10680
  KlingT2a,
10808
- KlingV15Image,
10809
10681
  KlingV21Image,
10810
10682
  KlingV26,
10811
- KlingV2Image,
10812
- KlingV2NewImage,
10813
10683
  KlingV2a,
10814
10684
  KlingV3,
10815
10685
  KlingV3Omni,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "5.15.0",
3
+ "version": "5.16.0",
4
4
  "type": "module",
5
5
  "description": "Type-safe SDK for 100+ AI models — image, video, audio, and text generation with Picsart",
6
6
  "license": "MIT",