@shop-os/modelkit 0.24.0 → 0.24.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/dist/index.js CHANGED
@@ -363,6 +363,34 @@ var FAL_IMAGE_MODELS = [
363
363
  logo: `${LOBE}/kling-color.png`
364
364
  }
365
365
  },
366
+ {
367
+ // kling/v4/text-to-image; references switch to kling/v4/image-to-image (up to 10,
368
+ // "@Image1".."@Image10"). Per output image: $0.063 at 2K, $0.094 at 4K (Kling price page,
369
+ // 2026-11-17); each reference adds $0.003, which we absorb. Native 8K is ENG-4137.
370
+ id: "kling-image-4.0",
371
+ aliases: [],
372
+ label: "Kling Image 4.0",
373
+ type: "image",
374
+ adapter: "fal",
375
+ providerModelId: "kling/v4/text-to-image",
376
+ lifecycle: "active",
377
+ exposure: EXPOSURE,
378
+ constraints: {
379
+ aspectRatios: [...KLING_RATIOS, "adaptive"],
380
+ sizes: ["2K", "4K"],
381
+ references: { images: 10 },
382
+ supports: ["count"],
383
+ prompt: { referenceSyntax: "numbered", maxChars: 21e3 }
384
+ },
385
+ defaults: { size: "2K", aspectRatio: "adaptive", count: 1 },
386
+ usage: { ...IMAGE_USAGE },
387
+ pricingKind: "image_size",
388
+ display: {
389
+ provider: "kuaishou",
390
+ description: "Kling Image 4.0 for photoreal text-to-image, long in-image text and multi-reference editing; takes a prompt and up to 10 reference images and outputs 2K or 4K.",
391
+ logo: `${LOBE}/kling-color.png`
392
+ }
393
+ },
366
394
  {
367
395
  // fal-ai/kling-image/v3/text-to-image; a reference switches to .../v3/image-to-image, which
368
396
  // takes exactly one image_url and no "auto" ratio. $0.028 per image.
@@ -9098,6 +9126,20 @@ var FAL_IMAGE_SPECS = /* @__PURE__ */ new Map([
9098
9126
  aspectRatios: KLING_RATIOS3
9099
9127
  }
9100
9128
  ],
9129
+ [
9130
+ // No output_format or seed field. Kling caps non-English prompts at 21,000 characters
9131
+ // (API update 2026-11-17), under the schema's 50,000.
9132
+ "kling/v4/text-to-image",
9133
+ {
9134
+ label: "Kling Image 4.0",
9135
+ maxReferences: 10,
9136
+ maxCount: 9,
9137
+ outputFormats: [],
9138
+ promptMax: 21e3,
9139
+ promptRequired: true,
9140
+ aspectRatios: [...KLING_RATIOS3, "adaptive"]
9141
+ }
9142
+ ],
9101
9143
  [
9102
9144
  "recraft/v4.1/flash/text-to-image",
9103
9145
  {
@@ -11882,13 +11924,13 @@ function minimaxH3Image(editEndpoint) {
11882
11924
  var H3_IMAGE_AREAS = { ...TIER_AREAS2, "4K": 4096 * 4096 };
11883
11925
  var MINIMAX_H3_IMAGE = minimaxH3Image("minimax/h3-image/edit");
11884
11926
  var MINIMAX_H3_IMAGE_HIGHSPEED = minimaxH3Image("minimax/h3-image/highspeed/edit");
11885
- function klingImage(editEndpoint, sizes, field) {
11927
+ function klingImage(editEndpoint, sizes, field, fallbackSize = "1K") {
11886
11928
  return {
11887
11929
  editEndpoint,
11888
11930
  build({ label, req, refs, edit: edit2 }, model) {
11889
11931
  const input = {
11890
11932
  prompt: req.prompt,
11891
- resolution: pick(model, label, "size", req.size ?? "1K", sizes)
11933
+ resolution: pick(model, label, "size", req.size ?? fallbackSize, sizes)
11892
11934
  };
11893
11935
  if (req.aspectRatio === "adaptive") {
11894
11936
  if (edit2) input["aspect_ratio"] = "auto";
@@ -11910,6 +11952,12 @@ var KLING_V3 = klingImage(
11910
11952
  { "1K": "1K", "2K": "2K" },
11911
11953
  "image_url"
11912
11954
  );
11955
+ var KLING_V42 = klingImage(
11956
+ "kling/v4/image-to-image",
11957
+ { "2K": "2K", "4K": "4K" },
11958
+ "image_urls",
11959
+ "2K"
11960
+ );
11913
11961
  var RECRAFT_SIZES = {
11914
11962
  "1:1": "square_hd",
11915
11963
  "4:3": "landscape_4_3",
@@ -11966,6 +12014,7 @@ var FAMILIES = /* @__PURE__ */ new Map([
11966
12014
  ["minimax/h3-image/highspeed/text-to-image", MINIMAX_H3_IMAGE_HIGHSPEED],
11967
12015
  ["fal-ai/kling-image/o3/text-to-image", KLING_O3],
11968
12016
  ["fal-ai/kling-image/v3/text-to-image", KLING_V3],
12017
+ ["kling/v4/text-to-image", KLING_V42],
11969
12018
  ["recraft/v4.1/flash/text-to-image", RECRAFT_FLASH],
11970
12019
  ["fal-ai/sensenova-u1-infographic", SENSENOVA],
11971
12020
  ["fal-ai/seedvr/upscale/image", SEEDVR]