@shop-os/modelkit 0.26.1 → 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,6 +9,24 @@ header in the release PR.
9
9
 
10
10
  ## [Unreleased]
11
11
 
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
+
12
30
  ## [0.26.1] - Unreleased
13
31
 
14
32
  ### Fixed
package/dist/catalog.cjs CHANGED
@@ -5507,10 +5507,119 @@ var TEXT_MODELS = [
5507
5507
  })
5508
5508
  ];
5509
5509
 
5510
- // src/catalog/video-families.ts
5511
- var VIDEO_USAGE = { unit: "seconds" };
5510
+ // src/catalog/video-avatars.ts
5512
5511
  var MB = 1024 * 1024;
5513
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";
5514
5623
  var MINIMAX_LOGO4 = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/f4c2e906-28b7-4a4a-b491-df8fef7808ed.png";
5515
5624
  var BYTEDANCE_LOGO = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/3bba5d81-4e57-4e71-911b-cdfa05acca2c_compressed.png";
5516
5625
  var XAI_LOGO = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/858b7fcc-9bd5-411d-aea1-a7b35ecfffab_compressed.png";
@@ -5568,7 +5677,7 @@ function klingMotionControl(tier) {
5568
5677
  pricingKind: "video_per_second",
5569
5678
  display: {
5570
5679
  provider: "kuaishou",
5571
- logo: KLING_LOGO,
5680
+ logo: KLING_LOGO2,
5572
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.`
5573
5682
  },
5574
5683
  capabilities: {}
@@ -5601,7 +5710,7 @@ var VIDEO_FAMILY_MODELS = [
5601
5710
  pricingKind: "video_per_second",
5602
5711
  display: {
5603
5712
  provider: "kuaishou",
5604
- logo: KLING_LOGO,
5713
+ logo: KLING_LOGO2,
5605
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."
5606
5715
  },
5607
5716
  capabilities: { lastFrameRequiresFirstFrame: true }
@@ -5632,7 +5741,7 @@ var VIDEO_FAMILY_MODELS = [
5632
5741
  pricingKind: "video_per_second",
5633
5742
  display: {
5634
5743
  provider: "kuaishou",
5635
- logo: KLING_LOGO,
5744
+ logo: KLING_LOGO2,
5636
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."
5637
5746
  },
5638
5747
  capabilities: { acceptsSourceVideo: true, videoEdit: true }
@@ -5676,7 +5785,7 @@ var VIDEO_FAMILY_MODELS = [
5676
5785
  pricingKind: "video_per_second",
5677
5786
  display: {
5678
5787
  provider: "kuaishou",
5679
- logo: KLING_LOGO,
5788
+ logo: KLING_LOGO2,
5680
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."
5681
5790
  },
5682
5791
  capabilities: { lastFrameRequiresFirstFrame: true }
@@ -5710,7 +5819,7 @@ var VIDEO_FAMILY_MODELS = [
5710
5819
  pricingKind: "video_per_second",
5711
5820
  display: {
5712
5821
  provider: "kuaishou",
5713
- logo: KLING_LOGO,
5822
+ logo: KLING_LOGO2,
5714
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."
5715
5824
  },
5716
5825
  capabilities: { acceptsSourceVideo: true, videoEdit: true }
@@ -5751,7 +5860,7 @@ var VIDEO_FAMILY_MODELS = [
5751
5860
  pricingKind: "video_per_second",
5752
5861
  display: {
5753
5862
  provider: "kuaishou",
5754
- logo: KLING_LOGO,
5863
+ logo: KLING_LOGO2,
5755
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."
5756
5865
  }
5757
5866
  },
@@ -5791,7 +5900,7 @@ var VIDEO_FAMILY_MODELS = [
5791
5900
  pricingKind: "video_per_second",
5792
5901
  display: {
5793
5902
  provider: "kuaishou",
5794
- logo: KLING_LOGO,
5903
+ logo: KLING_LOGO2,
5795
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."
5796
5905
  },
5797
5906
  capabilities: { acceptsSourceVideo: true, videoEdit: true }
@@ -5818,7 +5927,7 @@ var VIDEO_FAMILY_MODELS = [
5818
5927
  ...NO_REFERENCES,
5819
5928
  audios: 1,
5820
5929
  audioSeconds: { min: 2 },
5821
- audioMaxBytes: 15 * MB
5930
+ audioMaxBytes: 15 * MB2
5822
5931
  },
5823
5932
  supports: ["seed", "promptExpansion", "lastFrame", "safetyChecker"],
5824
5933
  prompt: H3_PROMPT,
@@ -6017,7 +6126,7 @@ var VIDEO_FAMILY_MODELS = [
6017
6126
  audioOnly: false,
6018
6127
  audioSeconds: { min: 3, max: 12 },
6019
6128
  audioFormats: ["mp3"],
6020
- audioMaxBytes: 50 * MB
6129
+ audioMaxBytes: 50 * MB2
6021
6130
  },
6022
6131
  // Sound (dialogue and effects) is a reference-to-video option; image-to-video is silent.
6023
6132
  supports: ["seed", "generateAudio", "safetyChecker"],
@@ -6058,7 +6167,7 @@ var VIDEO_FAMILY_MODELS = [
6058
6167
  audioOnly: false,
6059
6168
  audioSeconds: { min: 4, max: 300 },
6060
6169
  audioFormats: ["wav", "mp3"],
6061
- audioMaxBytes: 15 * MB,
6170
+ audioMaxBytes: 15 * MB2,
6062
6171
  min: { images: 1, audios: 1 }
6063
6172
  },
6064
6173
  requires: ["references"],
@@ -7161,6 +7270,7 @@ var VIDEO_MODELS = [
7161
7270
  capabilities: {}
7162
7271
  },
7163
7272
  ...VIDEO_FAMILY_MODELS,
7273
+ ...VIDEO_AVATAR_MODELS,
7164
7274
  ...LUMA_VIDEO_MODELS
7165
7275
  ];
7166
7276
 
@@ -9977,6 +10087,15 @@ var KLING_O3_IMAGE_CAP = 7;
9977
10087
  var KLING_V4_IMAGE_CAP = 10;
9978
10088
  var TURBO_AUDIO_MIN_SECONDS = 2;
9979
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
+ ];
9980
10099
  function missing(message) {
9981
10100
  return { code: "missing_input", message };
9982
10101
  }
@@ -10110,7 +10229,10 @@ function viduQ4(req) {
10110
10229
  }
10111
10230
  return req.firstFrame === void 0 ? missing("needs a start frame or reference images") : void 0;
10112
10231
  }
10113
- function omnihuman(req) {
10232
+ function isPublicUrl(ref) {
10233
+ return "url" in ref && !ref.url.startsWith("data:");
10234
+ }
10235
+ function imageAndAudio(req, audioSeconds) {
10114
10236
  const frames = noFrames(req);
10115
10237
  if (frames !== void 0) return frames;
10116
10238
  if (count(req.referenceVideos) > 0) return unsupported2("takes no reference videos");
@@ -10122,9 +10244,12 @@ function omnihuman(req) {
10122
10244
  if (extraImages.length > 0 || extraAudios.length > 0) {
10123
10245
  return unsupported2("takes exactly one image and one audio clip");
10124
10246
  }
10125
- 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);
10126
10251
  }
10127
- var RULES = /* @__PURE__ */ new Map([
10252
+ var RULES = new Map([
10128
10253
  [MOTION_PRO, motionControl],
10129
10254
  [MOTION_STANDARD, motionControl],
10130
10255
  [O3_REFERENCE, o3Reference],
@@ -10141,7 +10266,10 @@ var RULES = /* @__PURE__ */ new Map([
10141
10266
  [HAPPY_HORSE, happyHorse],
10142
10267
  [HAPPY_HORSE_EDIT, happyHorseEdit],
10143
10268
  [VIDU_Q4, viduQ4],
10144
- [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
+ )
10145
10273
  ]);
10146
10274
  function falVideoProblem(providerModelId, req) {
10147
10275
  return RULES.get(providerModelId.toLowerCase())?.(req);