@shop-os/modelkit 0.26.0 → 0.27.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/CHANGELOG.md CHANGED
@@ -9,7 +9,32 @@ header in the release PR.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
- ## [0.26.0] - Unreleased
12
+ ## [0.27.0] - Unreleased
13
+
14
+ ### Added
15
+ - Seven avatar rows on fal (ENG-4289): one photo and one speech clip make a talking video as long
16
+ as the speech. `heygen-avatar-6` and `heygen-avatar-6-turbo` (1080p or 2K, an optional motion
17
+ prompt), `kling-ai-avatar-v2-standard` and `kling-ai-avatar-v2-pro` (an optional prompt),
18
+ `veed-fabric-1.0` and `veed-fabric-1.0-fast` (480p or 720p, no prompt) and `sync-3-image-to-video` (no
19
+ prompt). They have `omnihuman-2`'s shape (`requires: ["references"]`, one reference image, one
20
+ reference audio, no `durations`), so a caller that runs that row runs these.
21
+ - Only Kling reports the output's length. The other five bill the `durationSeconds` of the audio
22
+ ref, so the caller must measure the audio and set it.
23
+ - VEED Fabric and sync-3 take public URLs only: a byte ref is refused before the call.
24
+
25
+ ### Not stated by the provider
26
+ - fal publishes no audio length limit for these endpoints. Kling uses its own API limit (2-300 s).
27
+ HeyGen (its own limit is 600 s), VEED Fabric and sync-3 use a kit cap of 300 s, the same as
28
+ `omnihuman-2`, so a hold on audio we cannot measure stays small.
29
+
30
+ ## [0.26.1] - Unreleased
31
+
32
+ ### Fixed
33
+ - `kling-image-4.0` declares `references.imagePixels: { minWidth: 300, minHeight: 300 }`, fal's
34
+ minimum (422 `image_too_small` on 256x256 stock backgrounds, prod COWORK-5S), so a caller's
35
+ conform step can resize a smaller reference instead of sending it.
36
+
37
+ ## [0.26.0] - 2026-11-19
13
38
 
14
39
  ### Added
15
40
  - ElevenLabs direct music and sound effects (`generateAudio` on the `elevenlabs` adapter, our own
package/dist/catalog.cjs CHANGED
@@ -459,7 +459,8 @@ var FAL_IMAGE_MODELS = [
459
459
  constraints: {
460
460
  aspectRatios: [...KLING_RATIOS, "adaptive"],
461
461
  sizes: ["2K", "4K", "8K"],
462
- references: { images: 10 },
462
+ // fal refuses a reference under 300x300 (422 image_too_small, prod COWORK-5S).
463
+ references: { images: 10, imagePixels: { minWidth: 300, minHeight: 300 } },
463
464
  supports: ["count"],
464
465
  prompt: { referenceSyntax: "numbered", maxChars: 21e3 }
465
466
  },
@@ -5506,10 +5507,119 @@ var TEXT_MODELS = [
5506
5507
  })
5507
5508
  ];
5508
5509
 
5509
- // src/catalog/video-families.ts
5510
- var VIDEO_USAGE = { unit: "seconds" };
5510
+ // src/catalog/video-avatars.ts
5511
5511
  var MB = 1024 * 1024;
5512
5512
  var KLING_LOGO = "https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@1.97.0/light/kling-color.png";
5513
+ var VEED_LOGO = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/d540d2bb-0022-4371-8889-48aefaf46bbe.png";
5514
+ var SYNC_LOGO2 = "https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@1.97.0/light/sync.png";
5515
+ var KIT_AUDIO_CAP_SECONDS = 300;
5516
+ function avatar(row2) {
5517
+ const { min, max, formats, maxBytes } = row2.audio;
5518
+ return {
5519
+ id: row2.id,
5520
+ aliases: row2.aliases,
5521
+ label: row2.label,
5522
+ type: "video",
5523
+ adapter: "fal",
5524
+ providerModelId: row2.providerModelId,
5525
+ lifecycle: "active",
5526
+ exposure: ["cowork", "space_builder"],
5527
+ constraints: {
5528
+ ...row2.resolutions !== void 0 && { resolutions: [...row2.resolutions] },
5529
+ references: {
5530
+ images: 1,
5531
+ videos: 0,
5532
+ audios: 1,
5533
+ audioOnly: false,
5534
+ audioSeconds: { ...min !== void 0 && { min }, max },
5535
+ audioFormats: formats,
5536
+ ...maxBytes !== void 0 && { audioMaxBytes: maxBytes },
5537
+ min: { images: 1, audios: 1 }
5538
+ },
5539
+ requires: ["references"],
5540
+ supports: [],
5541
+ ...row2.promptMaxChars === void 0 ? { noPrompt: true } : { prompt: { referenceSyntax: "descriptive", maxChars: row2.promptMaxChars } },
5542
+ audio: "always"
5543
+ },
5544
+ defaults: row2.resolutions === void 0 ? {} : { resolution: row2.resolutions[0] },
5545
+ usage: { unit: "seconds" },
5546
+ pricingKind: "video_per_second",
5547
+ display: {
5548
+ provider: row2.provider,
5549
+ ...row2.logo !== void 0 && { logo: row2.logo },
5550
+ description: row2.description
5551
+ },
5552
+ capabilities: {}
5553
+ };
5554
+ }
5555
+ function heygenAvatar6(tier) {
5556
+ const turbo = tier === "turbo";
5557
+ return avatar({
5558
+ id: turbo ? "heygen-avatar-6-turbo" : "heygen-avatar-6",
5559
+ aliases: [],
5560
+ label: turbo ? "HeyGen Avatar 6 Turbo" : "HeyGen Avatar 6",
5561
+ providerModelId: turbo ? "heygen/avatar-6/turbo/image-to-video" : "heygen/avatar-6/image-to-video",
5562
+ provider: "heygen",
5563
+ description: turbo ? "HeyGen Avatar 6 Turbo: the lower-cost tier; turns one photo of a person and a speech clip of up to 5 minutes into a talking video as long as the speech, at 1080p or 2K, with an optional motion prompt." : "HeyGen Avatar 6: turns one photo of a person and a speech clip of up to 5 minutes into a talking video as long as the speech, at 1080p or 2K, with an optional motion prompt.",
5564
+ audio: { max: KIT_AUDIO_CAP_SECONDS, formats: ["wav", "mp3"], maxBytes: 50 * MB },
5565
+ resolutions: ["1080p", "2k"],
5566
+ promptMaxChars: 1200
5567
+ });
5568
+ }
5569
+ function klingAvatar(tier) {
5570
+ const label = tier === "pro" ? "Pro" : "Standard";
5571
+ return avatar({
5572
+ id: `kling-ai-avatar-v2-${tier}`,
5573
+ aliases: [],
5574
+ label: `Kling AI Avatar 2.0 ${label}`,
5575
+ providerModelId: `fal-ai/kling-video/ai-avatar/v2/${tier}`,
5576
+ provider: "kuaishou",
5577
+ logo: KLING_LOGO,
5578
+ description: `Kuaishou Kling AI Avatar 2.0 (${label}): turns one image of a person, animal or character and a 2-300 second audio clip into a talking video as long as the audio.`,
5579
+ audio: { min: 2, max: 300, formats: ["mp3", "wav", "m4a", "aac"], maxBytes: 5 * MB },
5580
+ promptMaxChars: 2500
5581
+ });
5582
+ }
5583
+ function veedFabric(tier) {
5584
+ const fast = tier === "fast";
5585
+ return avatar({
5586
+ id: fast ? "veed-fabric-1.0-fast" : "veed-fabric-1.0",
5587
+ aliases: [fast ? "veed/fabric-1.0/fast" : "veed/fabric-1.0"],
5588
+ label: fast ? "VEED Fabric 1.0 Fast" : "VEED Fabric 1.0",
5589
+ providerModelId: fast ? "veed/fabric-1.0/fast" : "veed/fabric-1.0",
5590
+ provider: "veed",
5591
+ logo: VEED_LOGO,
5592
+ description: fast ? "VEED Fabric 1.0 Fast: the quicker tier; turns one image and a speech clip into a lip-synced talking video as long as the speech, at 480p or 720p." : "VEED Fabric 1.0: turns one image and a speech clip into a lip-synced talking video as long as the speech, at 480p or 720p.",
5593
+ audio: { max: KIT_AUDIO_CAP_SECONDS, formats: ["mp3", "ogg", "wav", "m4a", "aac"] },
5594
+ resolutions: ["720p", "480p"]
5595
+ });
5596
+ }
5597
+ var VIDEO_AVATAR_MODELS = [
5598
+ heygenAvatar6("regular"),
5599
+ heygenAvatar6("turbo"),
5600
+ klingAvatar("standard"),
5601
+ klingAvatar("pro"),
5602
+ veedFabric("regular"),
5603
+ veedFabric("fast"),
5604
+ // https://fal.ai/models/fal-ai/sync-lipsync/v3/image-to-video/api: image_url and audio_url
5605
+ // only; the video matches the audio's length. sync takes WAV or MP3
5606
+ // (https://sync.so/docs/quickstart); the length is the kit cap.
5607
+ avatar({
5608
+ id: "sync-3-image-to-video",
5609
+ aliases: ["fal-ai/sync-lipsync/v3/image-to-video"],
5610
+ label: "Sync 3 Avatar",
5611
+ providerModelId: "fal-ai/sync-lipsync/v3/image-to-video",
5612
+ provider: "sync",
5613
+ logo: SYNC_LOGO2,
5614
+ description: "Sync 3 (sync-3) image-to-video: animates the face in one image so it lip-syncs to a speech clip, as long as the speech.",
5615
+ audio: { max: KIT_AUDIO_CAP_SECONDS, formats: ["wav", "mp3"] }
5616
+ })
5617
+ ];
5618
+
5619
+ // src/catalog/video-families.ts
5620
+ var VIDEO_USAGE = { unit: "seconds" };
5621
+ var MB2 = 1024 * 1024;
5622
+ var KLING_LOGO2 = "https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@1.97.0/light/kling-color.png";
5513
5623
  var MINIMAX_LOGO4 = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/f4c2e906-28b7-4a4a-b491-df8fef7808ed.png";
5514
5624
  var BYTEDANCE_LOGO = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/3bba5d81-4e57-4e71-911b-cdfa05acca2c_compressed.png";
5515
5625
  var XAI_LOGO = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/858b7fcc-9bd5-411d-aea1-a7b35ecfffab_compressed.png";
@@ -5567,7 +5677,7 @@ function klingMotionControl(tier) {
5567
5677
  pricingKind: "video_per_second",
5568
5678
  display: {
5569
5679
  provider: "kuaishou",
5570
- logo: KLING_LOGO,
5680
+ logo: KLING_LOGO2,
5571
5681
  description: `Kuaishou Kling 3.0 Motion Control (${label}): a character image performs the motion of a 3-30 second reference video, keeping its timing and sound.`
5572
5682
  },
5573
5683
  capabilities: {}
@@ -5600,7 +5710,7 @@ var VIDEO_FAMILY_MODELS = [
5600
5710
  pricingKind: "video_per_second",
5601
5711
  display: {
5602
5712
  provider: "kuaishou",
5603
- logo: KLING_LOGO,
5713
+ logo: KLING_LOGO2,
5604
5714
  description: "Kuaishou Kling O3 Pro: text, start/end frames and up to 7 reference images in one 3-15 second clip with consistent characters and optional native audio."
5605
5715
  },
5606
5716
  capabilities: { lastFrameRequiresFirstFrame: true }
@@ -5631,7 +5741,7 @@ var VIDEO_FAMILY_MODELS = [
5631
5741
  pricingKind: "video_per_second",
5632
5742
  display: {
5633
5743
  provider: "kuaishou",
5634
- logo: KLING_LOGO,
5744
+ logo: KLING_LOGO2,
5635
5745
  description: "Kuaishou Kling O3 Pro video edit: change a 3-15 second clip with a prompt and up to 4 reference images while keeping its motion and timing."
5636
5746
  },
5637
5747
  capabilities: { acceptsSourceVideo: true, videoEdit: true }
@@ -5675,7 +5785,7 @@ var VIDEO_FAMILY_MODELS = [
5675
5785
  pricingKind: "video_per_second",
5676
5786
  display: {
5677
5787
  provider: "kuaishou",
5678
- logo: KLING_LOGO,
5788
+ logo: KLING_LOGO2,
5679
5789
  description: "Kuaishou Kling 4.0: text-to-video, start/end frames, or reference-to-video from up to 10 images and 5 videos (30 seconds combined), up to 30 seconds at 720p or 1080p. Prompts name references @Image1, @Video1."
5680
5790
  },
5681
5791
  capabilities: { lastFrameRequiresFirstFrame: true }
@@ -5709,7 +5819,7 @@ var VIDEO_FAMILY_MODELS = [
5709
5819
  pricingKind: "video_per_second",
5710
5820
  display: {
5711
5821
  provider: "kuaishou",
5712
- logo: KLING_LOGO,
5822
+ logo: KLING_LOGO2,
5713
5823
  description: "Kuaishou Kling 4.0 video edit: change a 3-30 second clip with a prompt and up to 10 reference images, at 720p or 1080p, as long as the source or a set 3-30 seconds. Prompts name the source @Video1 and images @Image1."
5714
5824
  },
5715
5825
  capabilities: { acceptsSourceVideo: true, videoEdit: true }
@@ -5750,7 +5860,7 @@ var VIDEO_FAMILY_MODELS = [
5750
5860
  pricingKind: "video_per_second",
5751
5861
  display: {
5752
5862
  provider: "kuaishou",
5753
- logo: KLING_LOGO,
5863
+ logo: KLING_LOGO2,
5754
5864
  description: "Kuaishou Kling 4.0 Flash: fast text-to-video, a start frame, or reference-to-video from up to 10 images and 5 videos (20 seconds combined), 3 to 20 seconds at 720p. Prompts name references @Image1, @Video1."
5755
5865
  }
5756
5866
  },
@@ -5790,7 +5900,7 @@ var VIDEO_FAMILY_MODELS = [
5790
5900
  pricingKind: "video_per_second",
5791
5901
  display: {
5792
5902
  provider: "kuaishou",
5793
- logo: KLING_LOGO,
5903
+ logo: KLING_LOGO2,
5794
5904
  description: "Kuaishou Kling 4.0 Flash video edit: change a 3-20 second clip with a prompt, up to 10 reference images and 4 reference videos (20 seconds in all with the source), at 720p, as long as the source or a set 3-20 seconds. Prompts name the source @Video1."
5795
5905
  },
5796
5906
  capabilities: { acceptsSourceVideo: true, videoEdit: true }
@@ -5817,7 +5927,7 @@ var VIDEO_FAMILY_MODELS = [
5817
5927
  ...NO_REFERENCES,
5818
5928
  audios: 1,
5819
5929
  audioSeconds: { min: 2 },
5820
- audioMaxBytes: 15 * MB
5930
+ audioMaxBytes: 15 * MB2
5821
5931
  },
5822
5932
  supports: ["seed", "promptExpansion", "lastFrame", "safetyChecker"],
5823
5933
  prompt: H3_PROMPT,
@@ -6016,7 +6126,7 @@ var VIDEO_FAMILY_MODELS = [
6016
6126
  audioOnly: false,
6017
6127
  audioSeconds: { min: 3, max: 12 },
6018
6128
  audioFormats: ["mp3"],
6019
- audioMaxBytes: 50 * MB
6129
+ audioMaxBytes: 50 * MB2
6020
6130
  },
6021
6131
  // Sound (dialogue and effects) is a reference-to-video option; image-to-video is silent.
6022
6132
  supports: ["seed", "generateAudio", "safetyChecker"],
@@ -6057,7 +6167,7 @@ var VIDEO_FAMILY_MODELS = [
6057
6167
  audioOnly: false,
6058
6168
  audioSeconds: { min: 4, max: 300 },
6059
6169
  audioFormats: ["wav", "mp3"],
6060
- audioMaxBytes: 15 * MB,
6170
+ audioMaxBytes: 15 * MB2,
6061
6171
  min: { images: 1, audios: 1 }
6062
6172
  },
6063
6173
  requires: ["references"],
@@ -7160,6 +7270,7 @@ var VIDEO_MODELS = [
7160
7270
  capabilities: {}
7161
7271
  },
7162
7272
  ...VIDEO_FAMILY_MODELS,
7273
+ ...VIDEO_AVATAR_MODELS,
7163
7274
  ...LUMA_VIDEO_MODELS
7164
7275
  ];
7165
7276
 
@@ -9976,6 +10087,15 @@ var KLING_O3_IMAGE_CAP = 7;
9976
10087
  var KLING_V4_IMAGE_CAP = 10;
9977
10088
  var TURBO_AUDIO_MIN_SECONDS = 2;
9978
10089
  var OMNIHUMAN_AUDIO_SECONDS = { min: 4, max: 300 };
10090
+ var AVATAR_AUDIO = [
10091
+ ["heygen/avatar-6/image-to-video", { max: 300 }],
10092
+ ["heygen/avatar-6/turbo/image-to-video", { max: 300 }],
10093
+ ["fal-ai/kling-video/ai-avatar/v2/standard", { min: 2, max: 300 }],
10094
+ ["fal-ai/kling-video/ai-avatar/v2/pro", { min: 2, max: 300 }],
10095
+ ["veed/fabric-1.0", { max: 300, urlOnly: true }],
10096
+ ["veed/fabric-1.0/fast", { max: 300, urlOnly: true }],
10097
+ ["fal-ai/sync-lipsync/v3/image-to-video", { max: 300, urlOnly: true }]
10098
+ ];
9979
10099
  function missing(message) {
9980
10100
  return { code: "missing_input", message };
9981
10101
  }
@@ -10109,7 +10229,10 @@ function viduQ4(req) {
10109
10229
  }
10110
10230
  return req.firstFrame === void 0 ? missing("needs a start frame or reference images") : void 0;
10111
10231
  }
10112
- function omnihuman(req) {
10232
+ function isPublicUrl(ref) {
10233
+ return "url" in ref && !ref.url.startsWith("data:");
10234
+ }
10235
+ function imageAndAudio(req, audioSeconds) {
10113
10236
  const frames = noFrames(req);
10114
10237
  if (frames !== void 0) return frames;
10115
10238
  if (count(req.referenceVideos) > 0) return unsupported2("takes no reference videos");
@@ -10121,9 +10244,12 @@ function omnihuman(req) {
10121
10244
  if (extraImages.length > 0 || extraAudios.length > 0) {
10122
10245
  return unsupported2("takes exactly one image and one audio clip");
10123
10246
  }
10124
- return inputSeconds("audio", audio, OMNIHUMAN_AUDIO_SECONDS);
10247
+ if (audioSeconds.urlOnly === true && !(isPublicUrl(image) && isPublicUrl(audio))) {
10248
+ return unsupported2("takes its image and audio as public URLs, not inline bytes");
10249
+ }
10250
+ return inputSeconds("audio", audio, audioSeconds);
10125
10251
  }
10126
- var RULES = /* @__PURE__ */ new Map([
10252
+ var RULES = new Map([
10127
10253
  [MOTION_PRO, motionControl],
10128
10254
  [MOTION_STANDARD, motionControl],
10129
10255
  [O3_REFERENCE, o3Reference],
@@ -10140,7 +10266,10 @@ var RULES = /* @__PURE__ */ new Map([
10140
10266
  [HAPPY_HORSE, happyHorse],
10141
10267
  [HAPPY_HORSE_EDIT, happyHorseEdit],
10142
10268
  [VIDU_Q4, viduQ4],
10143
- [OMNIHUMAN_V2, omnihuman]
10269
+ [OMNIHUMAN_V2, (req) => imageAndAudio(req, OMNIHUMAN_AUDIO_SECONDS)],
10270
+ ...AVATAR_AUDIO.map(
10271
+ ([id, limits]) => [id, (req) => imageAndAudio(req, limits)]
10272
+ )
10144
10273
  ]);
10145
10274
  function falVideoProblem(providerModelId, req) {
10146
10275
  return RULES.get(providerModelId.toLowerCase())?.(req);