@nodaro/shared 3.38.0 → 3.40.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/dist/{chunk-AQA6YXY5.cjs → chunk-25PAKSMK.cjs} +50 -38
- package/dist/chunk-25PAKSMK.cjs.map +1 -0
- package/dist/{chunk-5OED47LE.js → chunk-2BJADMEX.js} +3 -3
- package/dist/{chunk-5OED47LE.js.map → chunk-2BJADMEX.js.map} +1 -1
- package/dist/{chunk-YNJ44IAL.cjs → chunk-4IWVZR44.cjs} +5 -5
- package/dist/{chunk-YNJ44IAL.cjs.map → chunk-4IWVZR44.cjs.map} +1 -1
- package/dist/{chunk-33QG2DOW.cjs → chunk-4LKEOIOT.cjs} +6 -6
- package/dist/{chunk-33QG2DOW.cjs.map → chunk-4LKEOIOT.cjs.map} +1 -1
- package/dist/{chunk-ZG4XSEZV.js → chunk-5CKTBGB6.js} +71 -2
- package/dist/chunk-5CKTBGB6.js.map +1 -0
- package/dist/{chunk-BDSFMY4X.js → chunk-5J5L26IZ.js} +5 -5
- package/dist/{chunk-BDSFMY4X.js.map → chunk-5J5L26IZ.js.map} +1 -1
- package/dist/{chunk-VRLRPGO7.js → chunk-A4NDZBSJ.js} +93 -11
- package/dist/chunk-A4NDZBSJ.js.map +1 -0
- package/dist/{chunk-KOP7UTQR.cjs → chunk-ADYPAGQF.cjs} +71 -2
- package/dist/chunk-ADYPAGQF.cjs.map +1 -0
- package/dist/{chunk-HABDAHZR.cjs → chunk-BOUEGYGI.cjs} +118 -28
- package/dist/chunk-BOUEGYGI.cjs.map +1 -0
- package/dist/{chunk-JLKZEKQ3.cjs → chunk-BWQRAQUD.cjs} +43 -43
- package/dist/{chunk-JLKZEKQ3.cjs.map → chunk-BWQRAQUD.cjs.map} +1 -1
- package/dist/{chunk-MSIIC6MY.cjs → chunk-DJIRIBKX.cjs} +4 -4
- package/dist/{chunk-MSIIC6MY.cjs.map → chunk-DJIRIBKX.cjs.map} +1 -1
- package/dist/{chunk-XA53RUSD.js → chunk-E4MLBJKG.js} +8 -8
- package/dist/{chunk-XA53RUSD.js.map → chunk-E4MLBJKG.js.map} +1 -1
- package/dist/chunk-FVZMFDRO.js +23 -0
- package/dist/chunk-FVZMFDRO.js.map +1 -0
- package/dist/{chunk-DKTRVOU5.js → chunk-GNY2S63W.js} +4 -4
- package/dist/{chunk-DKTRVOU5.js.map → chunk-GNY2S63W.js.map} +1 -1
- package/dist/{chunk-YHCG3HOR.js → chunk-GXTWKAJF.js} +3 -3
- package/dist/{chunk-YHCG3HOR.js.map → chunk-GXTWKAJF.js.map} +1 -1
- package/dist/{chunk-DE3PEIIP.cjs → chunk-IKCFSNNH.cjs} +21 -21
- package/dist/{chunk-DE3PEIIP.cjs.map → chunk-IKCFSNNH.cjs.map} +1 -1
- package/dist/{chunk-BYP62B7F.cjs → chunk-JN3V33AN.cjs} +6 -6
- package/dist/{chunk-BYP62B7F.cjs.map → chunk-JN3V33AN.cjs.map} +1 -1
- package/dist/{chunk-QXTCIJP5.js → chunk-LOTL72UI.js} +3 -3
- package/dist/{chunk-QXTCIJP5.js.map → chunk-LOTL72UI.js.map} +1 -1
- package/dist/{chunk-7QITUDRT.js → chunk-MLB6YNLS.js} +4 -4
- package/dist/{chunk-7QITUDRT.js.map → chunk-MLB6YNLS.js.map} +1 -1
- package/dist/{chunk-JABZNRXL.cjs → chunk-N2KG5AMQ.cjs} +4 -4
- package/dist/{chunk-JABZNRXL.cjs.map → chunk-N2KG5AMQ.cjs.map} +1 -1
- package/dist/{chunk-THGNDVVH.js → chunk-NRSYWQKM.js} +16 -4
- package/dist/chunk-NRSYWQKM.js.map +1 -0
- package/dist/{chunk-IIGKJYWL.js → chunk-PYDZ7ZGH.js} +3 -3
- package/dist/{chunk-IIGKJYWL.js.map → chunk-PYDZ7ZGH.js.map} +1 -1
- package/dist/{chunk-ENFBA33M.cjs → chunk-RLVZ3RLE.cjs} +8 -8
- package/dist/{chunk-ENFBA33M.cjs.map → chunk-RLVZ3RLE.cjs.map} +1 -1
- package/dist/{chunk-JMUHMLJP.js → chunk-SYUY7GNT.js} +7 -5
- package/dist/chunk-SYUY7GNT.js.map +1 -0
- package/dist/{chunk-VRUN5TG2.cjs → chunk-TUUEQ2WR.cjs} +8 -8
- package/dist/{chunk-VRUN5TG2.cjs.map → chunk-TUUEQ2WR.cjs.map} +1 -1
- package/dist/{chunk-HZ46RDLD.cjs → chunk-VNC5DNIQ.cjs} +11 -11
- package/dist/{chunk-HZ46RDLD.cjs.map → chunk-VNC5DNIQ.cjs.map} +1 -1
- package/dist/{chunk-MSDECC3A.cjs → chunk-VSDJCJKP.cjs} +44 -42
- package/dist/chunk-VSDJCJKP.cjs.map +1 -0
- package/dist/{chunk-GW54ANCH.js → chunk-X7IRSO4L.js} +3 -3
- package/dist/{chunk-GW54ANCH.js.map → chunk-X7IRSO4L.js.map} +1 -1
- package/dist/chunk-XOZIHGR5.cjs +27 -0
- package/dist/chunk-XOZIHGR5.cjs.map +1 -0
- package/dist/{chunk-YSEM7JDE.cjs → chunk-YEET2QGF.cjs} +4 -4
- package/dist/{chunk-YSEM7JDE.cjs.map → chunk-YEET2QGF.cjs.map} +1 -1
- package/dist/{chunk-CMH2ACOX.js → chunk-YEZ2YUKK.js} +3 -3
- package/dist/{chunk-CMH2ACOX.js.map → chunk-YEZ2YUKK.js.map} +1 -1
- package/dist/{chunk-SPP6HQMM.js → chunk-YX5FW7ON.js} +39 -5
- package/dist/chunk-YX5FW7ON.js.map +1 -0
- package/dist/{chunk-75ZMA34U.cjs → chunk-ZAOBNW6Y.cjs} +47 -11
- package/dist/chunk-ZAOBNW6Y.cjs.map +1 -0
- package/dist/{chunk-AZBIXGM5.js → chunk-ZXIP5T5V.js} +3 -3
- package/dist/{chunk-AZBIXGM5.js.map → chunk-ZXIP5T5V.js.map} +1 -1
- package/dist/entries/apps.cjs +42 -42
- package/dist/entries/apps.js +7 -7
- package/dist/entries/credits.cjs +150 -150
- package/dist/entries/credits.d.cts +1 -1
- package/dist/entries/credits.d.ts +1 -1
- package/dist/entries/credits.js +7 -7
- package/dist/entries/llm-models.d.cts +1 -1
- package/dist/entries/llm-models.d.ts +1 -1
- package/dist/entries/model-catalog.cjs +66 -66
- package/dist/entries/model-catalog.d.cts +2 -2
- package/dist/entries/model-catalog.d.ts +2 -2
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +261 -229
- package/dist/entries/models.d.cts +17 -3
- package/dist/entries/models.d.ts +17 -3
- package/dist/entries/models.js +4 -4
- package/dist/entries/nodes.cjs +206 -206
- package/dist/entries/nodes.d.cts +1 -1
- package/dist/entries/nodes.d.ts +1 -1
- package/dist/entries/nodes.js +8 -8
- package/dist/entries/pipeline.cjs +149 -149
- package/dist/entries/pipeline.d.cts +1 -1
- package/dist/entries/pipeline.d.ts +1 -1
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +123 -115
- package/dist/entries/video.d.cts +26 -1
- package/dist/entries/video.d.ts +26 -1
- package/dist/entries/video.js +4 -4
- package/dist/index.cjs +1044 -1004
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +17 -17
- package/dist/{model-catalog-I48SvalA.d.ts → model-catalog-dQPdLltX.d.cts} +11 -0
- package/dist/{model-catalog-I48SvalA.d.cts → model-catalog-dQPdLltX.d.ts} +11 -0
- package/dist/{model-constants-C43YS07I.d.ts → model-constants-B5ka4TQr.d.cts} +61 -6
- package/dist/{model-constants-C43YS07I.d.cts → model-constants-B5ka4TQr.d.ts} +61 -6
- package/package.json +1 -1
- package/src/__tests__/cast-swap-limits.test.ts +9 -0
- package/src/__tests__/gvp-supported-providers.test.ts +8 -1
- package/src/__tests__/kling4-catalog.test.ts +129 -0
- package/src/__tests__/video-character-refs.test.ts +3 -2
- package/src/cast-swap-limits.ts +9 -0
- package/src/credit-identifiers.ts +6 -0
- package/src/entries/models.ts +8 -0
- package/src/entries/video.ts +2 -0
- package/src/model-catalog.ts +82 -0
- package/src/model-constants.ts +151 -3
- package/src/node-default-mappings.ts +3 -0
- package/src/video-character-refs.ts +67 -0
- package/src/video-ui-defaults.ts +8 -5
- package/dist/chunk-75ZMA34U.cjs.map +0 -1
- package/dist/chunk-AQA6YXY5.cjs.map +0 -1
- package/dist/chunk-HABDAHZR.cjs.map +0 -1
- package/dist/chunk-JMUHMLJP.js.map +0 -1
- package/dist/chunk-KOP7UTQR.cjs.map +0 -1
- package/dist/chunk-MSDECC3A.cjs.map +0 -1
- package/dist/chunk-SPP6HQMM.js.map +0 -1
- package/dist/chunk-THGNDVVH.js.map +0 -1
- package/dist/chunk-VRLRPGO7.js.map +0 -1
- package/dist/chunk-W4GABGRD.js +0 -21
- package/dist/chunk-W4GABGRD.js.map +0 -1
- package/dist/chunk-XJ3HJSO5.cjs +0 -25
- package/dist/chunk-XJ3HJSO5.cjs.map +0 -1
- package/dist/chunk-ZG4XSEZV.js.map +0 -1
|
@@ -352,13 +352,13 @@ type ImageGenProvider = typeof IMAGE_GEN_PROVIDERS[number];
|
|
|
352
352
|
type ImageI2IProvider = typeof IMAGE_I2I_PROVIDERS[number];
|
|
353
353
|
type ImageEditProvider = typeof IMAGE_EDIT_PROVIDERS[number];
|
|
354
354
|
/** Image-to-video providers */
|
|
355
|
-
declare const IMAGE_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5"];
|
|
355
|
+
declare const IMAGE_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5"];
|
|
356
356
|
type ImageToVideoProvider = typeof IMAGE_TO_VIDEO_PROVIDERS[number];
|
|
357
357
|
/** Text-to-video providers */
|
|
358
|
-
declare const TEXT_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "grok", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "wan", "hailuo-standard", "bytedance-lite", "bytedance-pro", "wan-turbo", "wan-2.7-t2v", "happyhorse", "runway-kie", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", "kling-3-omni", "kling-master", "hailuo-2.3", "hailuo-2.3-pro", "bytedance-pro-fast", "happyhorse-ref2v", "vidu-q4"];
|
|
358
|
+
declare const TEXT_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "grok", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "wan", "hailuo-standard", "bytedance-lite", "bytedance-pro", "wan-turbo", "wan-2.7-t2v", "happyhorse", "runway-kie", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", "kling-3-omni", "kling-master", "hailuo-2.3", "hailuo-2.3-pro", "bytedance-pro-fast", "happyhorse-ref2v", "vidu-q4"];
|
|
359
359
|
type TextToVideoProvider = typeof TEXT_TO_VIDEO_PROVIDERS[number];
|
|
360
360
|
/** Unified video-generation providers (image-to-video ∪ text-to-video) for the generate-video node. */
|
|
361
|
-
declare const VIDEO_GEN_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", ...("seedance-2-5" | "minimax" | "veo3" | "kling-3.0" | "seedance-2" | "veo3.1" | "wan-turbo" | "bytedance-lite" | "kling-turbo" | "hailuo-standard" | "grok" | "minimax-h3" | "hailuo-2.3-pro" | "hailuo-2.3" | "veo3_lite" | "gemini-omni-video" | "gemini-omni-flash" | "kling" | "kling-master" | "kling-3-omni" | "grok-imagine-video-1.5" | "seedance" | "seedance-2-fast" | "seedance-2-mini" | "wan-3" | "wan-3-prime" | "wan" | "wan-2.7-t2v" | "ltx-2.3-pro" | "ltx-2.3-fast" | "happyhorse" | "happyhorse-ref2v" | "vidu-q4" | "bytedance-pro" | "bytedance-pro-fast" | "runway-kie")[]];
|
|
361
|
+
declare const VIDEO_GEN_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", ...("seedance-2-5" | "minimax" | "veo3" | "kling-3.0" | "seedance-2" | "veo3.1" | "wan-turbo" | "bytedance-lite" | "kling-turbo" | "hailuo-standard" | "grok" | "minimax-h3" | "hailuo-2.3-pro" | "hailuo-2.3" | "veo3_lite" | "gemini-omni-video" | "gemini-omni-flash" | "kling" | "kling-master" | "kling-3-omni" | "kling-4" | "kling-4-keyframes" | "grok-imagine-video-1.5" | "seedance" | "seedance-2-fast" | "seedance-2-mini" | "wan-3" | "wan-3-prime" | "wan" | "wan-2.7-t2v" | "ltx-2.3-pro" | "ltx-2.3-fast" | "happyhorse" | "happyhorse-ref2v" | "vidu-q4" | "bytedance-pro" | "bytedance-pro-fast" | "runway-kie")[]];
|
|
362
362
|
type VideoGenProvider = typeof VIDEO_GEN_PROVIDERS[number];
|
|
363
363
|
/**
|
|
364
364
|
* Video models that expose DISTINCT provider ids per mode (text-to-video vs
|
|
@@ -434,8 +434,9 @@ declare function videoProviderReferenceSyntax(provider: string | undefined): Vid
|
|
|
434
434
|
/**
|
|
435
435
|
* Reference-capable video models whose start/end frames ride a channel of
|
|
436
436
|
* their OWN (separate frame parameters next to the reference list), so a frame
|
|
437
|
-
* never occupies a reference seat
|
|
438
|
-
* `end_image
|
|
437
|
+
* never occupies a reference seat: `kling-3-omni` (Replicate `start_image` /
|
|
438
|
+
* `end_image`, no dispatch path today) and Kling 4.0 Keyframes (KIE
|
|
439
|
+
* `first_frame_url` / `last_frame_url` beside its in-between `keyframe_urls`).
|
|
439
440
|
*/
|
|
440
441
|
declare const VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL: ReadonlySet<string>;
|
|
441
442
|
/**
|
|
@@ -854,6 +855,34 @@ declare const VIDU_Q4_DEFAULT_RESOLUTION = "720p";
|
|
|
854
855
|
* never disagree.
|
|
855
856
|
*/
|
|
856
857
|
declare function normalizeViduQ4Resolution(resolution: string | undefined): "540p" | "720p" | "1080p" | "2k" | "4k";
|
|
858
|
+
/**
|
|
859
|
+
* Kling 4.0 family — two Nodaro ids over KIE's two Kling 4.0 endpoints:
|
|
860
|
+
* `kling-4` → `kling-4.0/reference-to-video`, `kling-4-keyframes` →
|
|
861
|
+
* `kling-4.0/keyframe-to-video`. Exact-membership set.
|
|
862
|
+
*/
|
|
863
|
+
declare const KLING_4_PROVIDERS: Set<string>;
|
|
864
|
+
declare function isKling4Provider(provider: string | undefined): provider is "kling-4" | "kling-4-keyframes";
|
|
865
|
+
/** Kling 4.0 resolution rendered when the param is omitted or unknown — KIE's
|
|
866
|
+
* own default and the tier the bare credit identifier prices. */
|
|
867
|
+
declare const KLING_4_DEFAULT_RESOLUTION = "720p";
|
|
868
|
+
/**
|
|
869
|
+
* SINGLE normalization for the Kling 4.0 resolution lever. The KIE wire enum is
|
|
870
|
+
* lowercase ("720p" | "1080p"), the same spelling as the catalog and the credit
|
|
871
|
+
* identifiers; this folds case and collapses anything else to
|
|
872
|
+
* {@link KLING_4_DEFAULT_RESOLUTION}. The runner sends what this returns and
|
|
873
|
+
* the credit identifier bills what this returns.
|
|
874
|
+
*/
|
|
875
|
+
declare function normalizeKling4Resolution(resolution: string | undefined): "720p" | "1080p";
|
|
876
|
+
/** Most in-between frames Kling 4.0 Keyframes takes (`keyframe_urls`). */
|
|
877
|
+
declare const KLING_4_MAX_MIDDLE_FRAMES = 8;
|
|
878
|
+
/**
|
|
879
|
+
* How many frames IN ALL (start + in-between + end) Kling 4.0 Keyframes
|
|
880
|
+
* accepts for a clip of `durationSec` seconds — KIE's own table
|
|
881
|
+
* (docs.kie.ai/market/kling/v4-keyframe-to-video): 3s → 4, 4s → 5 … 8s → 9,
|
|
882
|
+
* 9s or longer → 10. Live-verified 2026-10-23: 5 frames at 3s is a 422
|
|
883
|
+
* "duration 3s allows at most 4 frames (first + keyframes + last), got 5".
|
|
884
|
+
*/
|
|
885
|
+
declare function kling4KeyframeFrameCap(durationSec: number | string | undefined): number;
|
|
857
886
|
/**
|
|
858
887
|
* Google Gemini Omni family — the KIE "gemini-omni-video" market model and its
|
|
859
888
|
* faster/cheaper "google/gemini-omni-flash-1-1" sibling. Both take the SAME
|
|
@@ -1137,6 +1166,14 @@ declare const VIDEO_REF_LIMITS_BY_PROVIDER: Record<string, {
|
|
|
1137
1166
|
audio?: number;
|
|
1138
1167
|
characters?: number;
|
|
1139
1168
|
voices?: number;
|
|
1169
|
+
/**
|
|
1170
|
+
* Cap on ALL materials together (images + videos + characters + audio),
|
|
1171
|
+
* when the provider counts them as one budget (Kling 4.0: 15). Absent ⇒
|
|
1172
|
+
* no combined cap beyond the per-kind ones — and, for a model declaring
|
|
1173
|
+
* `characters`, the Gemini Omni input-unit budget applies instead
|
|
1174
|
+
* (`videoCharacterRefProblem`).
|
|
1175
|
+
*/
|
|
1176
|
+
materials?: number;
|
|
1140
1177
|
} | undefined>;
|
|
1141
1178
|
/** Per-reference-video duration bounds, in seconds. */
|
|
1142
1179
|
interface RefVideoDurationLimit {
|
|
@@ -1185,6 +1222,24 @@ declare function checkRefVideoDurations(provider: string, durationsSec: readonly
|
|
|
1185
1222
|
ok: false;
|
|
1186
1223
|
message: string;
|
|
1187
1224
|
};
|
|
1225
|
+
/**
|
|
1226
|
+
* Members of RESOLUTION_DURATION_PRICING that bill a run carrying a reference
|
|
1227
|
+
* VIDEO at a different per-second rate: their identifier gains a `-ref` suffix
|
|
1228
|
+
* after the resolution (`kling-4:8s:720p-ref`). The rate is per second of the
|
|
1229
|
+
* BILLED duration, which the reference-video billing rule
|
|
1230
|
+
* (backend ee/billing/ref-video-billing.ts) computes from the probed clips.
|
|
1231
|
+
*/
|
|
1232
|
+
declare const VIDEO_REF_RATE_PROVIDERS: Set<string>;
|
|
1233
|
+
/**
|
|
1234
|
+
* Video models whose reference-VIDEO runs also bill the clips' own seconds:
|
|
1235
|
+
* the Seedance 2 family (`unit × (input + output)`) and the
|
|
1236
|
+
* VIDEO_REF_RATE_PROVIDERS (Kling 4.0: `unit × (output + max(output, input))`).
|
|
1237
|
+
* The reservation holds the worst case from the probed clips and the
|
|
1238
|
+
* settlement meters down to what was delivered (backend
|
|
1239
|
+
* ee/billing/seedance2-ref-video-credits.ts) — this is the one gate every lane
|
|
1240
|
+
* (routes, orchestrator, worker settlement, reconcile) asks.
|
|
1241
|
+
*/
|
|
1242
|
+
declare function billsReferenceVideoSeconds(provider: string | undefined): boolean;
|
|
1188
1243
|
/**
|
|
1189
1244
|
* Video generation models whose provider API natively accepts a "match the
|
|
1190
1245
|
* visual input's aspect" token, mapped to that provider's EXACT token.
|
|
@@ -1591,4 +1646,4 @@ declare function applyDefaultVideoSelection<D>(input: {
|
|
|
1591
1646
|
duration: D | number | undefined;
|
|
1592
1647
|
};
|
|
1593
1648
|
|
|
1594
|
-
export { IMAGE_TO_VIDEO_PROVIDERS as $, AI_WRITER_PROVIDERS as A, GVP_ANCHOR_CHOICES as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, GEMINI_OMNI_PROVIDERS as G, GVP_DEFAULT_PROVIDER as H, GVP_END_FRAME_PROVIDERS as I, GVP_EXTEND_PROVIDERS as J, GVP_SUPPORTED_PROVIDERS as K, type GvpAnchorChoice as L, type GvpAnchorWireMode as M, HIGH_QUALITY_PROVIDERS as N, I2I_MASK_SUPPORT as O, I2I_STRENGTH_SUPPORT as P, IDEOGRAM_PROVIDERS as Q, IMAGE_ASPECT_RATIO_VALUES as R, IMAGE_EDIT_PROVIDERS as S, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as T, IMAGE_GEN_PROVIDERS as U, IMAGE_I2I_PROVIDERS as V, IMAGE_MASK_MODE as W, IMAGE_PROMPT_MAX as X, IMAGE_QUALITY_VALUES as Y, IMAGE_RENDERING_SPEED_VALUES as Z, IMAGE_RESOLUTION_VALUES as _, ASPECT_RATIO_DIMENSIONS as a,
|
|
1649
|
+
export { IMAGE_TO_VIDEO_PROVIDERS as $, AI_WRITER_PROVIDERS as A, GVP_ANCHOR_CHOICES as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, GEMINI_OMNI_PROVIDERS as G, GVP_DEFAULT_PROVIDER as H, GVP_END_FRAME_PROVIDERS as I, GVP_EXTEND_PROVIDERS as J, GVP_SUPPORTED_PROVIDERS as K, type GvpAnchorChoice as L, type GvpAnchorWireMode as M, HIGH_QUALITY_PROVIDERS as N, I2I_MASK_SUPPORT as O, I2I_STRENGTH_SUPPORT as P, IDEOGRAM_PROVIDERS as Q, IMAGE_ASPECT_RATIO_VALUES as R, IMAGE_EDIT_PROVIDERS as S, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as T, IMAGE_GEN_PROVIDERS as U, IMAGE_I2I_PROVIDERS as V, IMAGE_MASK_MODE as W, IMAGE_PROMPT_MAX as X, IMAGE_QUALITY_VALUES as Y, IMAGE_RENDERING_SPEED_VALUES as Z, IMAGE_RESOLUTION_VALUES as _, ASPECT_RATIO_DIMENSIONS as a, SEED_SUPPORT as a$, type ImageAspectRatio as a0, type ImageEditProvider as a1, type ImageEditTargetResolution as a2, type ImageGenProvider as a3, type ImageI2IProvider as a4, type ImageMaskMode as a5, type ImageQuality as a6, type ImageRenderingSpeed as a7, type ImageResolution as a8, type ImageToVideoProvider as a9, NATIVE_NEGATIVE_VIDEO_PROVIDERS as aA, NEGATIVE_PROMPT_MAX as aB, OBJECT_MOTION_PROVIDERS as aC, type ObjectMotionProvider as aD, PRICING_DEFAULT_DURATION_SEC as aE, PRICING_DEFAULT_RESOLUTION as aF, PROMPT_HARD_CEILING as aG, QA_CHECK_PROVIDERS as aH, type QaCheckProvider as aI, REF_IMAGE_MAX_LIMITS as aJ, RENDERING_SPEED_SUPPORT as aK, REPLICATE_LIP_SYNC_PROVIDERS as aL, type RefAudioCheck as aM, type RefAudioProbe as aN, type RefAudioRule as aO, type RefVideoDurationLimit as aP, SCRIPT_PROVIDERS as aQ, SEEDANCE_2_5_REF_LIMITS as aR, SEEDANCE_2_CONTINUATION_REF_SEC as aS, SEEDANCE_2_EXTEND_STITCH as aT, SEEDANCE_2_PROVIDERS as aU, SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER as aV, SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC as aW, SEEDANCE_2_REF_LIMITS as aX, SEEDANCE_LIP_SYNC_PROVIDERS as aY, SEEDANCE_VIDEO_EDIT_PROVIDERS as aZ, SEEDANCE_VIDEO_EDIT_SHAPE as a_, KLING_4_DEFAULT_RESOLUTION as aa, KLING_4_MAX_MIDDLE_FRAMES as ab, KLING_4_PROVIDERS as ac, LIP_SYNC_PROVIDERS as ad, LLM_TEXT_INPUT_MAX as ae, LOCATION_ATMOSPHERE_PROVIDERS as af, type LipSyncProvider as ag, type LocationAtmosphereProvider as ah, MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER as ai, MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER as aj, MAX_TTS_CHARS_BY_PROVIDER as ak, MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER as al, MINIMAX_H3_DEFAULT_RESOLUTION as am, MINIMAX_H3_PROVIDERS as an, MODELS_WITH_REFERENCE_IMAGE_SUPPORT as ao, MODIFY_IMAGE_PROVIDERS as ap, MOTION_TRANSFER_PROVIDERS as aq, MUSIC_CREDIT_ID as ar, MUSIC_PROVIDERS as as, MUSIC_PROVIDER_LABELS as at, type ModelPromptingStyle as au, type ModifyImageProvider as av, type MotionTransferProviderType as aw, type MusicProvider as ax, NATIVE_ADAPTIVE_ASPECT as ay, NATIVE_NEGATIVE_PROMPT_MODELS as az, AUDIO_ADDON_PROVIDERS as b, type VideoToVideoNodeProvider as b$, SUNO_ACTIVE_MODELS as b0, SUNO_ADD_TRACK_MODELS as b1, SUNO_DURATION_MODELS as b2, SUNO_HARD_CEILING as b3, SUNO_LEGACY_MODELS as b4, SUNO_MODELS as b5, SUNO_TEXT_MAX as b6, SUNO_TITLE_MAX as b7, type SceneInputMode as b8, SceneInputModeSchema as b9, VIDEO_DURATION_TIERS as bA, VIDEO_GEN_COLLAPSED_T2V_IDS as bB, VIDEO_GEN_PROVIDERS as bC, VIDEO_INPUT_LIP_SYNC_PROVIDERS as bD, VIDEO_MODEL_CAPS as bE, VIDEO_MODE_ALIASES as bF, VIDEO_PROMPT_MAX as bG, VIDEO_PROVIDERS_REQUIRING_IMAGE as bH, VIDEO_PROVIDERS_WITHOUT_DISPATCH as bI, VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL as bJ, VIDEO_REF_AUDIO_RULES as bK, VIDEO_REF_LIMITS_BY_PROVIDER as bL, VIDEO_REF_RATE_PROVIDERS as bM, VIDEO_REF_VIDEO_DURATION_LIMITS as bN, VIDEO_TO_VIDEO_NODE_PROVIDERS as bO, VIDEO_TO_VIDEO_PROVIDERS as bP, VIDEO_UPSCALE_PROVIDERS as bQ, VIDEO_VARIABLE_PRICING as bR, VIDU_Q4_DEFAULT_RESOLUTION as bS, VIDU_Q4_PROVIDERS as bT, VOICE_DESIGN_MODELS as bU, type VideoAudioCapability as bV, type VideoAudioMode as bW, type VideoGenProvider as bX, type VideoModeAlias as bY, type VideoModelCapabilities as bZ, type VideoReferenceSyntax as b_, type ScriptProvider as ba, type SeedanceVideoEditProvider as bb, type SunoAddTrackModel as bc, type SunoModel as bd, T2I_TO_I2I_VARIANT as be, TASK_CHAINED_EDIT_PROVIDERS as bf, TASK_CHAINED_EDIT_PROVIDER_IDS as bg, TEXT_TO_AUDIO_PROVIDERS as bh, TEXT_TO_VIDEO_PROVIDERS as bi, TRANSCRIBE_LANES as bj, TRANSCRIBE_PROVIDERS as bk, TRANSCRIBE_PROVIDER_CAPABILITIES as bl, TTS_PROVIDERS as bm, TTS_TEXT_MAX as bn, TWO_K_RESOLUTION_PROVIDERS as bo, type TaskChainedEditProvider as bp, type TextToAudioProvider as bq, type TextToVideoProvider as br, type TranscribeLane as bs, type TranscribeProvider as bt, type TtsProvider as bu, UPSCALE_IMAGE_PROVIDERS as bv, type UpscaleImageProvider as bw, VARIABLE_PRICING_MODELS as bx, VEO_PROVIDERS as by, VIDEO_AUDIO_CAPABILITY as bz, type AiWriterProvider as c, videoProviderRefModeFrameSeats as c$, type VideoToVideoProvider as c0, type VideoUpscaleProvider as c1, type VoiceDesignModel as c2, WAN_3_DEFAULT_RESOLUTION as c3, WAN_3_PROVIDERS as c4, applyDefaultVideoSelection as c5, applyVideoAudioToggle as c6, applyVideoNegativePrompt as c7, billsReferenceVideoSeconds as c8, checkRefAudioRules as c9, minSegmentSecFor as cA, modelsForInputMode as cB, normalizeKling4Resolution as cC, normalizeMinimaxH3Resolution as cD, normalizeViduQ4Resolution as cE, normalizeWan3Resolution as cF, preferredInputModeForModel as cG, pricedOutputDurationSec as cH, resolveGvpAnchorWire as cI, resolveMusicProvider as cJ, resolveVideoModeForInputs as cK, resolveVideoProviderForMode as cL, seedance2AudioLimitSec as cM, segmentDurationsFor as cN, snapToNearestDuration as cO, sunoModelHonoursDuration as cP, supportsAutoVideoDuration as cQ, supportsEndAnchor as cR, supportsExtendRender as cS, transcribeLaneSupportsWordTimestamps as cT, transcribeProvidersWithWordTimestamps as cU, videoDefaultDurationSec as cV, videoModelCanSpeakDialogue as cW, videoModelSupportsAudio as cX, videoNegativeSuffix as cY, videoProviderAppendsFrames as cZ, videoProviderFoldsLoneEndFrame as c_, checkRefVideoDurations as ca, defaultVideoAspectRatio as cb, findSeedance2AudioOverLimit as cc, getMaxImagePromptChars as cd, getMaxNegativePromptChars as ce, getMaxSunoPromptChars as cf, getMaxSunoStyleChars as cg, getMaxTtsChars as ch, getMaxVideoPromptChars as ci, getVideoAudioCapability as cj, hasContiguousSegmentDurations as ck, imageReferenceLimit as cl, isGeminiOmniProvider as cm, isGvpSupportedProvider as cn, isKling4Provider as co, isLegacySunoModel as cp, isMinimaxH3Provider as cq, isSeedance2Provider as cr, isSeedanceVideoEditProvider as cs, isVeoProvider as ct, isViduQ4Provider as cu, isWan3Provider as cv, kling4KeyframeFrameCap as cw, maxSegmentSecFor as cx, maxSegmentsFor as cy, maxVideoDurationSec as cz, COMPOSER_PLAN_FIELDS as d, videoProviderReferenceSyntax as d0, videoProviderRequiresImage as d1, videoProviderRunsFromReferences as d2, COMPOSER_PLAN_MAP as e, CREDIT_BASE_USD as f, type CharacterMotionProvider as g, DEFAULT_MUSIC_PROVIDER as h, DEFAULT_REF_IMAGE_MAX as i, DEFAULT_SUNO_MODEL as j, DEFAULT_TEXT_TO_AUDIO_PROVIDER as k, DEFAULT_TRANSCRIBE_NODE_PROVIDER as l, DEFAULT_TRANSCRIBE_PROVIDER as m, DEFAULT_TTS_PROVIDER as n, DEFAULT_VIDEO_DURATION_SEC as o, DEFAULT_VIDEO_PROVIDER as p, DEFAULT_VOICE_DESIGN_MODEL as q, DIALOGUE_PROVIDERS as r, DURATION_PRICED_PROVIDERS as s, type DialogueProvider as t, type ExtendVideoProvider as u, FAL_LIP_SYNC_PROVIDERS as v, FLEXIBLE_INPUT_LIP_SYNC_PROVIDERS as w, FRAME_MODE_ADAPTIVE_ONLY_ASPECT as x, type FaceSwapProvider as y, GUIDANCE_SCALE_SUPPORT as z };
|
|
@@ -352,13 +352,13 @@ type ImageGenProvider = typeof IMAGE_GEN_PROVIDERS[number];
|
|
|
352
352
|
type ImageI2IProvider = typeof IMAGE_I2I_PROVIDERS[number];
|
|
353
353
|
type ImageEditProvider = typeof IMAGE_EDIT_PROVIDERS[number];
|
|
354
354
|
/** Image-to-video providers */
|
|
355
|
-
declare const IMAGE_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5"];
|
|
355
|
+
declare const IMAGE_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5"];
|
|
356
356
|
type ImageToVideoProvider = typeof IMAGE_TO_VIDEO_PROVIDERS[number];
|
|
357
357
|
/** Text-to-video providers */
|
|
358
|
-
declare const TEXT_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "grok", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "wan", "hailuo-standard", "bytedance-lite", "bytedance-pro", "wan-turbo", "wan-2.7-t2v", "happyhorse", "runway-kie", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", "kling-3-omni", "kling-master", "hailuo-2.3", "hailuo-2.3-pro", "bytedance-pro-fast", "happyhorse-ref2v", "vidu-q4"];
|
|
358
|
+
declare const TEXT_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "grok", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "wan", "hailuo-standard", "bytedance-lite", "bytedance-pro", "wan-turbo", "wan-2.7-t2v", "happyhorse", "runway-kie", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", "kling-3-omni", "kling-master", "hailuo-2.3", "hailuo-2.3-pro", "bytedance-pro-fast", "happyhorse-ref2v", "vidu-q4"];
|
|
359
359
|
type TextToVideoProvider = typeof TEXT_TO_VIDEO_PROVIDERS[number];
|
|
360
360
|
/** Unified video-generation providers (image-to-video ∪ text-to-video) for the generate-video node. */
|
|
361
|
-
declare const VIDEO_GEN_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", ...("seedance-2-5" | "minimax" | "veo3" | "kling-3.0" | "seedance-2" | "veo3.1" | "wan-turbo" | "bytedance-lite" | "kling-turbo" | "hailuo-standard" | "grok" | "minimax-h3" | "hailuo-2.3-pro" | "hailuo-2.3" | "veo3_lite" | "gemini-omni-video" | "gemini-omni-flash" | "kling" | "kling-master" | "kling-3-omni" | "grok-imagine-video-1.5" | "seedance" | "seedance-2-fast" | "seedance-2-mini" | "wan-3" | "wan-3-prime" | "wan" | "wan-2.7-t2v" | "ltx-2.3-pro" | "ltx-2.3-fast" | "happyhorse" | "happyhorse-ref2v" | "vidu-q4" | "bytedance-pro" | "bytedance-pro-fast" | "runway-kie")[]];
|
|
361
|
+
declare const VIDEO_GEN_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", ...("seedance-2-5" | "minimax" | "veo3" | "kling-3.0" | "seedance-2" | "veo3.1" | "wan-turbo" | "bytedance-lite" | "kling-turbo" | "hailuo-standard" | "grok" | "minimax-h3" | "hailuo-2.3-pro" | "hailuo-2.3" | "veo3_lite" | "gemini-omni-video" | "gemini-omni-flash" | "kling" | "kling-master" | "kling-3-omni" | "kling-4" | "kling-4-keyframes" | "grok-imagine-video-1.5" | "seedance" | "seedance-2-fast" | "seedance-2-mini" | "wan-3" | "wan-3-prime" | "wan" | "wan-2.7-t2v" | "ltx-2.3-pro" | "ltx-2.3-fast" | "happyhorse" | "happyhorse-ref2v" | "vidu-q4" | "bytedance-pro" | "bytedance-pro-fast" | "runway-kie")[]];
|
|
362
362
|
type VideoGenProvider = typeof VIDEO_GEN_PROVIDERS[number];
|
|
363
363
|
/**
|
|
364
364
|
* Video models that expose DISTINCT provider ids per mode (text-to-video vs
|
|
@@ -434,8 +434,9 @@ declare function videoProviderReferenceSyntax(provider: string | undefined): Vid
|
|
|
434
434
|
/**
|
|
435
435
|
* Reference-capable video models whose start/end frames ride a channel of
|
|
436
436
|
* their OWN (separate frame parameters next to the reference list), so a frame
|
|
437
|
-
* never occupies a reference seat
|
|
438
|
-
* `end_image
|
|
437
|
+
* never occupies a reference seat: `kling-3-omni` (Replicate `start_image` /
|
|
438
|
+
* `end_image`, no dispatch path today) and Kling 4.0 Keyframes (KIE
|
|
439
|
+
* `first_frame_url` / `last_frame_url` beside its in-between `keyframe_urls`).
|
|
439
440
|
*/
|
|
440
441
|
declare const VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL: ReadonlySet<string>;
|
|
441
442
|
/**
|
|
@@ -854,6 +855,34 @@ declare const VIDU_Q4_DEFAULT_RESOLUTION = "720p";
|
|
|
854
855
|
* never disagree.
|
|
855
856
|
*/
|
|
856
857
|
declare function normalizeViduQ4Resolution(resolution: string | undefined): "540p" | "720p" | "1080p" | "2k" | "4k";
|
|
858
|
+
/**
|
|
859
|
+
* Kling 4.0 family — two Nodaro ids over KIE's two Kling 4.0 endpoints:
|
|
860
|
+
* `kling-4` → `kling-4.0/reference-to-video`, `kling-4-keyframes` →
|
|
861
|
+
* `kling-4.0/keyframe-to-video`. Exact-membership set.
|
|
862
|
+
*/
|
|
863
|
+
declare const KLING_4_PROVIDERS: Set<string>;
|
|
864
|
+
declare function isKling4Provider(provider: string | undefined): provider is "kling-4" | "kling-4-keyframes";
|
|
865
|
+
/** Kling 4.0 resolution rendered when the param is omitted or unknown — KIE's
|
|
866
|
+
* own default and the tier the bare credit identifier prices. */
|
|
867
|
+
declare const KLING_4_DEFAULT_RESOLUTION = "720p";
|
|
868
|
+
/**
|
|
869
|
+
* SINGLE normalization for the Kling 4.0 resolution lever. The KIE wire enum is
|
|
870
|
+
* lowercase ("720p" | "1080p"), the same spelling as the catalog and the credit
|
|
871
|
+
* identifiers; this folds case and collapses anything else to
|
|
872
|
+
* {@link KLING_4_DEFAULT_RESOLUTION}. The runner sends what this returns and
|
|
873
|
+
* the credit identifier bills what this returns.
|
|
874
|
+
*/
|
|
875
|
+
declare function normalizeKling4Resolution(resolution: string | undefined): "720p" | "1080p";
|
|
876
|
+
/** Most in-between frames Kling 4.0 Keyframes takes (`keyframe_urls`). */
|
|
877
|
+
declare const KLING_4_MAX_MIDDLE_FRAMES = 8;
|
|
878
|
+
/**
|
|
879
|
+
* How many frames IN ALL (start + in-between + end) Kling 4.0 Keyframes
|
|
880
|
+
* accepts for a clip of `durationSec` seconds — KIE's own table
|
|
881
|
+
* (docs.kie.ai/market/kling/v4-keyframe-to-video): 3s → 4, 4s → 5 … 8s → 9,
|
|
882
|
+
* 9s or longer → 10. Live-verified 2026-10-23: 5 frames at 3s is a 422
|
|
883
|
+
* "duration 3s allows at most 4 frames (first + keyframes + last), got 5".
|
|
884
|
+
*/
|
|
885
|
+
declare function kling4KeyframeFrameCap(durationSec: number | string | undefined): number;
|
|
857
886
|
/**
|
|
858
887
|
* Google Gemini Omni family — the KIE "gemini-omni-video" market model and its
|
|
859
888
|
* faster/cheaper "google/gemini-omni-flash-1-1" sibling. Both take the SAME
|
|
@@ -1137,6 +1166,14 @@ declare const VIDEO_REF_LIMITS_BY_PROVIDER: Record<string, {
|
|
|
1137
1166
|
audio?: number;
|
|
1138
1167
|
characters?: number;
|
|
1139
1168
|
voices?: number;
|
|
1169
|
+
/**
|
|
1170
|
+
* Cap on ALL materials together (images + videos + characters + audio),
|
|
1171
|
+
* when the provider counts them as one budget (Kling 4.0: 15). Absent ⇒
|
|
1172
|
+
* no combined cap beyond the per-kind ones — and, for a model declaring
|
|
1173
|
+
* `characters`, the Gemini Omni input-unit budget applies instead
|
|
1174
|
+
* (`videoCharacterRefProblem`).
|
|
1175
|
+
*/
|
|
1176
|
+
materials?: number;
|
|
1140
1177
|
} | undefined>;
|
|
1141
1178
|
/** Per-reference-video duration bounds, in seconds. */
|
|
1142
1179
|
interface RefVideoDurationLimit {
|
|
@@ -1185,6 +1222,24 @@ declare function checkRefVideoDurations(provider: string, durationsSec: readonly
|
|
|
1185
1222
|
ok: false;
|
|
1186
1223
|
message: string;
|
|
1187
1224
|
};
|
|
1225
|
+
/**
|
|
1226
|
+
* Members of RESOLUTION_DURATION_PRICING that bill a run carrying a reference
|
|
1227
|
+
* VIDEO at a different per-second rate: their identifier gains a `-ref` suffix
|
|
1228
|
+
* after the resolution (`kling-4:8s:720p-ref`). The rate is per second of the
|
|
1229
|
+
* BILLED duration, which the reference-video billing rule
|
|
1230
|
+
* (backend ee/billing/ref-video-billing.ts) computes from the probed clips.
|
|
1231
|
+
*/
|
|
1232
|
+
declare const VIDEO_REF_RATE_PROVIDERS: Set<string>;
|
|
1233
|
+
/**
|
|
1234
|
+
* Video models whose reference-VIDEO runs also bill the clips' own seconds:
|
|
1235
|
+
* the Seedance 2 family (`unit × (input + output)`) and the
|
|
1236
|
+
* VIDEO_REF_RATE_PROVIDERS (Kling 4.0: `unit × (output + max(output, input))`).
|
|
1237
|
+
* The reservation holds the worst case from the probed clips and the
|
|
1238
|
+
* settlement meters down to what was delivered (backend
|
|
1239
|
+
* ee/billing/seedance2-ref-video-credits.ts) — this is the one gate every lane
|
|
1240
|
+
* (routes, orchestrator, worker settlement, reconcile) asks.
|
|
1241
|
+
*/
|
|
1242
|
+
declare function billsReferenceVideoSeconds(provider: string | undefined): boolean;
|
|
1188
1243
|
/**
|
|
1189
1244
|
* Video generation models whose provider API natively accepts a "match the
|
|
1190
1245
|
* visual input's aspect" token, mapped to that provider's EXACT token.
|
|
@@ -1591,4 +1646,4 @@ declare function applyDefaultVideoSelection<D>(input: {
|
|
|
1591
1646
|
duration: D | number | undefined;
|
|
1592
1647
|
};
|
|
1593
1648
|
|
|
1594
|
-
export { IMAGE_TO_VIDEO_PROVIDERS as $, AI_WRITER_PROVIDERS as A, GVP_ANCHOR_CHOICES as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, GEMINI_OMNI_PROVIDERS as G, GVP_DEFAULT_PROVIDER as H, GVP_END_FRAME_PROVIDERS as I, GVP_EXTEND_PROVIDERS as J, GVP_SUPPORTED_PROVIDERS as K, type GvpAnchorChoice as L, type GvpAnchorWireMode as M, HIGH_QUALITY_PROVIDERS as N, I2I_MASK_SUPPORT as O, I2I_STRENGTH_SUPPORT as P, IDEOGRAM_PROVIDERS as Q, IMAGE_ASPECT_RATIO_VALUES as R, IMAGE_EDIT_PROVIDERS as S, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as T, IMAGE_GEN_PROVIDERS as U, IMAGE_I2I_PROVIDERS as V, IMAGE_MASK_MODE as W, IMAGE_PROMPT_MAX as X, IMAGE_QUALITY_VALUES as Y, IMAGE_RENDERING_SPEED_VALUES as Z, IMAGE_RESOLUTION_VALUES as _, ASPECT_RATIO_DIMENSIONS as a,
|
|
1649
|
+
export { IMAGE_TO_VIDEO_PROVIDERS as $, AI_WRITER_PROVIDERS as A, GVP_ANCHOR_CHOICES as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, GEMINI_OMNI_PROVIDERS as G, GVP_DEFAULT_PROVIDER as H, GVP_END_FRAME_PROVIDERS as I, GVP_EXTEND_PROVIDERS as J, GVP_SUPPORTED_PROVIDERS as K, type GvpAnchorChoice as L, type GvpAnchorWireMode as M, HIGH_QUALITY_PROVIDERS as N, I2I_MASK_SUPPORT as O, I2I_STRENGTH_SUPPORT as P, IDEOGRAM_PROVIDERS as Q, IMAGE_ASPECT_RATIO_VALUES as R, IMAGE_EDIT_PROVIDERS as S, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as T, IMAGE_GEN_PROVIDERS as U, IMAGE_I2I_PROVIDERS as V, IMAGE_MASK_MODE as W, IMAGE_PROMPT_MAX as X, IMAGE_QUALITY_VALUES as Y, IMAGE_RENDERING_SPEED_VALUES as Z, IMAGE_RESOLUTION_VALUES as _, ASPECT_RATIO_DIMENSIONS as a, SEED_SUPPORT as a$, type ImageAspectRatio as a0, type ImageEditProvider as a1, type ImageEditTargetResolution as a2, type ImageGenProvider as a3, type ImageI2IProvider as a4, type ImageMaskMode as a5, type ImageQuality as a6, type ImageRenderingSpeed as a7, type ImageResolution as a8, type ImageToVideoProvider as a9, NATIVE_NEGATIVE_VIDEO_PROVIDERS as aA, NEGATIVE_PROMPT_MAX as aB, OBJECT_MOTION_PROVIDERS as aC, type ObjectMotionProvider as aD, PRICING_DEFAULT_DURATION_SEC as aE, PRICING_DEFAULT_RESOLUTION as aF, PROMPT_HARD_CEILING as aG, QA_CHECK_PROVIDERS as aH, type QaCheckProvider as aI, REF_IMAGE_MAX_LIMITS as aJ, RENDERING_SPEED_SUPPORT as aK, REPLICATE_LIP_SYNC_PROVIDERS as aL, type RefAudioCheck as aM, type RefAudioProbe as aN, type RefAudioRule as aO, type RefVideoDurationLimit as aP, SCRIPT_PROVIDERS as aQ, SEEDANCE_2_5_REF_LIMITS as aR, SEEDANCE_2_CONTINUATION_REF_SEC as aS, SEEDANCE_2_EXTEND_STITCH as aT, SEEDANCE_2_PROVIDERS as aU, SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER as aV, SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC as aW, SEEDANCE_2_REF_LIMITS as aX, SEEDANCE_LIP_SYNC_PROVIDERS as aY, SEEDANCE_VIDEO_EDIT_PROVIDERS as aZ, SEEDANCE_VIDEO_EDIT_SHAPE as a_, KLING_4_DEFAULT_RESOLUTION as aa, KLING_4_MAX_MIDDLE_FRAMES as ab, KLING_4_PROVIDERS as ac, LIP_SYNC_PROVIDERS as ad, LLM_TEXT_INPUT_MAX as ae, LOCATION_ATMOSPHERE_PROVIDERS as af, type LipSyncProvider as ag, type LocationAtmosphereProvider as ah, MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER as ai, MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER as aj, MAX_TTS_CHARS_BY_PROVIDER as ak, MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER as al, MINIMAX_H3_DEFAULT_RESOLUTION as am, MINIMAX_H3_PROVIDERS as an, MODELS_WITH_REFERENCE_IMAGE_SUPPORT as ao, MODIFY_IMAGE_PROVIDERS as ap, MOTION_TRANSFER_PROVIDERS as aq, MUSIC_CREDIT_ID as ar, MUSIC_PROVIDERS as as, MUSIC_PROVIDER_LABELS as at, type ModelPromptingStyle as au, type ModifyImageProvider as av, type MotionTransferProviderType as aw, type MusicProvider as ax, NATIVE_ADAPTIVE_ASPECT as ay, NATIVE_NEGATIVE_PROMPT_MODELS as az, AUDIO_ADDON_PROVIDERS as b, type VideoToVideoNodeProvider as b$, SUNO_ACTIVE_MODELS as b0, SUNO_ADD_TRACK_MODELS as b1, SUNO_DURATION_MODELS as b2, SUNO_HARD_CEILING as b3, SUNO_LEGACY_MODELS as b4, SUNO_MODELS as b5, SUNO_TEXT_MAX as b6, SUNO_TITLE_MAX as b7, type SceneInputMode as b8, SceneInputModeSchema as b9, VIDEO_DURATION_TIERS as bA, VIDEO_GEN_COLLAPSED_T2V_IDS as bB, VIDEO_GEN_PROVIDERS as bC, VIDEO_INPUT_LIP_SYNC_PROVIDERS as bD, VIDEO_MODEL_CAPS as bE, VIDEO_MODE_ALIASES as bF, VIDEO_PROMPT_MAX as bG, VIDEO_PROVIDERS_REQUIRING_IMAGE as bH, VIDEO_PROVIDERS_WITHOUT_DISPATCH as bI, VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL as bJ, VIDEO_REF_AUDIO_RULES as bK, VIDEO_REF_LIMITS_BY_PROVIDER as bL, VIDEO_REF_RATE_PROVIDERS as bM, VIDEO_REF_VIDEO_DURATION_LIMITS as bN, VIDEO_TO_VIDEO_NODE_PROVIDERS as bO, VIDEO_TO_VIDEO_PROVIDERS as bP, VIDEO_UPSCALE_PROVIDERS as bQ, VIDEO_VARIABLE_PRICING as bR, VIDU_Q4_DEFAULT_RESOLUTION as bS, VIDU_Q4_PROVIDERS as bT, VOICE_DESIGN_MODELS as bU, type VideoAudioCapability as bV, type VideoAudioMode as bW, type VideoGenProvider as bX, type VideoModeAlias as bY, type VideoModelCapabilities as bZ, type VideoReferenceSyntax as b_, type ScriptProvider as ba, type SeedanceVideoEditProvider as bb, type SunoAddTrackModel as bc, type SunoModel as bd, T2I_TO_I2I_VARIANT as be, TASK_CHAINED_EDIT_PROVIDERS as bf, TASK_CHAINED_EDIT_PROVIDER_IDS as bg, TEXT_TO_AUDIO_PROVIDERS as bh, TEXT_TO_VIDEO_PROVIDERS as bi, TRANSCRIBE_LANES as bj, TRANSCRIBE_PROVIDERS as bk, TRANSCRIBE_PROVIDER_CAPABILITIES as bl, TTS_PROVIDERS as bm, TTS_TEXT_MAX as bn, TWO_K_RESOLUTION_PROVIDERS as bo, type TaskChainedEditProvider as bp, type TextToAudioProvider as bq, type TextToVideoProvider as br, type TranscribeLane as bs, type TranscribeProvider as bt, type TtsProvider as bu, UPSCALE_IMAGE_PROVIDERS as bv, type UpscaleImageProvider as bw, VARIABLE_PRICING_MODELS as bx, VEO_PROVIDERS as by, VIDEO_AUDIO_CAPABILITY as bz, type AiWriterProvider as c, videoProviderRefModeFrameSeats as c$, type VideoToVideoProvider as c0, type VideoUpscaleProvider as c1, type VoiceDesignModel as c2, WAN_3_DEFAULT_RESOLUTION as c3, WAN_3_PROVIDERS as c4, applyDefaultVideoSelection as c5, applyVideoAudioToggle as c6, applyVideoNegativePrompt as c7, billsReferenceVideoSeconds as c8, checkRefAudioRules as c9, minSegmentSecFor as cA, modelsForInputMode as cB, normalizeKling4Resolution as cC, normalizeMinimaxH3Resolution as cD, normalizeViduQ4Resolution as cE, normalizeWan3Resolution as cF, preferredInputModeForModel as cG, pricedOutputDurationSec as cH, resolveGvpAnchorWire as cI, resolveMusicProvider as cJ, resolveVideoModeForInputs as cK, resolveVideoProviderForMode as cL, seedance2AudioLimitSec as cM, segmentDurationsFor as cN, snapToNearestDuration as cO, sunoModelHonoursDuration as cP, supportsAutoVideoDuration as cQ, supportsEndAnchor as cR, supportsExtendRender as cS, transcribeLaneSupportsWordTimestamps as cT, transcribeProvidersWithWordTimestamps as cU, videoDefaultDurationSec as cV, videoModelCanSpeakDialogue as cW, videoModelSupportsAudio as cX, videoNegativeSuffix as cY, videoProviderAppendsFrames as cZ, videoProviderFoldsLoneEndFrame as c_, checkRefVideoDurations as ca, defaultVideoAspectRatio as cb, findSeedance2AudioOverLimit as cc, getMaxImagePromptChars as cd, getMaxNegativePromptChars as ce, getMaxSunoPromptChars as cf, getMaxSunoStyleChars as cg, getMaxTtsChars as ch, getMaxVideoPromptChars as ci, getVideoAudioCapability as cj, hasContiguousSegmentDurations as ck, imageReferenceLimit as cl, isGeminiOmniProvider as cm, isGvpSupportedProvider as cn, isKling4Provider as co, isLegacySunoModel as cp, isMinimaxH3Provider as cq, isSeedance2Provider as cr, isSeedanceVideoEditProvider as cs, isVeoProvider as ct, isViduQ4Provider as cu, isWan3Provider as cv, kling4KeyframeFrameCap as cw, maxSegmentSecFor as cx, maxSegmentsFor as cy, maxVideoDurationSec as cz, COMPOSER_PLAN_FIELDS as d, videoProviderReferenceSyntax as d0, videoProviderRequiresImage as d1, videoProviderRunsFromReferences as d2, COMPOSER_PLAN_MAP as e, CREDIT_BASE_USD as f, type CharacterMotionProvider as g, DEFAULT_MUSIC_PROVIDER as h, DEFAULT_REF_IMAGE_MAX as i, DEFAULT_SUNO_MODEL as j, DEFAULT_TEXT_TO_AUDIO_PROVIDER as k, DEFAULT_TRANSCRIBE_NODE_PROVIDER as l, DEFAULT_TRANSCRIBE_PROVIDER as m, DEFAULT_TTS_PROVIDER as n, DEFAULT_VIDEO_DURATION_SEC as o, DEFAULT_VIDEO_PROVIDER as p, DEFAULT_VOICE_DESIGN_MODEL as q, DIALOGUE_PROVIDERS as r, DURATION_PRICED_PROVIDERS as s, type DialogueProvider as t, type ExtendVideoProvider as u, FAL_LIP_SYNC_PROVIDERS as v, FLEXIBLE_INPUT_LIP_SYNC_PROVIDERS as w, FRAME_MODE_ADAPTIVE_ONLY_ASPECT as x, type FaceSwapProvider as y, GUIDANCE_SCALE_SUPPORT as z };
|
package/package.json
CHANGED
|
@@ -34,7 +34,16 @@ describe("Cast Swap limits", () => {
|
|
|
34
34
|
expect(inside(d.minFaceHeightPct, b.faceHeightPct)).toBe(true)
|
|
35
35
|
expect(inside(d.maxFaceHeightPct, b.faceHeightPct)).toBe(true)
|
|
36
36
|
expect(inside(d.zonePct, b.zonePct)).toBe(true)
|
|
37
|
+
for (const side of ["leftPct", "rightPct", "topPct", "bottomPct"] as const) expect(inside(d.zone[side], b.zonePct), side).toBe(true)
|
|
37
38
|
expect(inside(d.blurStrengthPct, b.blurStrengthPct)).toBe(true)
|
|
38
39
|
expect(inside(d.threshold, b.threshold)).toBe(true)
|
|
39
40
|
})
|
|
41
|
+
|
|
42
|
+
it("covers a masked face with a blur by default", () => {
|
|
43
|
+
expect(CAST_SWAP_FACE_MASKING_DEFAULTS.fill).toBe("blur")
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it("leaves 10 % margins at the left and right when the zone is left out", () => {
|
|
47
|
+
expect(CAST_SWAP_FACE_MASKING_DEFAULTS.zone).toEqual({ leftPct: 10, rightPct: 10, topPct: 0, bottomPct: 0 })
|
|
48
|
+
})
|
|
40
49
|
})
|
|
@@ -60,6 +60,7 @@ describe("GVP_SUPPORTED_PROVIDERS", () => {
|
|
|
60
60
|
"veo3_lite",
|
|
61
61
|
"gemini-omni-video",
|
|
62
62
|
"gemini-omni-flash",
|
|
63
|
+
"kling-4",
|
|
63
64
|
"grok-i2v",
|
|
64
65
|
"wan-3",
|
|
65
66
|
"wan-3-prime",
|
|
@@ -95,8 +96,14 @@ describe("GVP_SUPPORTED_PROVIDERS", () => {
|
|
|
95
96
|
* does — fail the build rather than advertise a dropped capability.
|
|
96
97
|
*/
|
|
97
98
|
it("agrees with VIDEO_REF_LIMITS_BY_PROVIDER (the forwarding-path audit)", () => {
|
|
99
|
+
// A `keyframes` model (Kling 4.0 Keyframes) forwards its Image References
|
|
100
|
+
// as in-between FRAMES — a real forwarding path, deliberately kept out of
|
|
101
|
+
// the pro node (its segments would send cast references as frames).
|
|
98
102
|
const withRefLimits = Object.keys(VIDEO_REF_LIMITS_BY_PROVIDER).filter(
|
|
99
|
-
(id) =>
|
|
103
|
+
(id) =>
|
|
104
|
+
MODEL_CATALOG[id]?.kind === "video" &&
|
|
105
|
+
!VIDEO_PROVIDERS_WITHOUT_DISPATCH.has(id) &&
|
|
106
|
+
!MODEL_CATALOG[id]?.features?.includes("keyframes"),
|
|
100
107
|
)
|
|
101
108
|
expect([...GVP_SUPPORTED_PROVIDERS].sort()).toEqual(withRefLimits.sort())
|
|
102
109
|
})
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest"
|
|
2
|
+
import { MODEL_CATALOG, hasFeature } from "../model-catalog.js"
|
|
3
|
+
import {
|
|
4
|
+
IMAGE_TO_VIDEO_PROVIDERS,
|
|
5
|
+
TEXT_TO_VIDEO_PROVIDERS,
|
|
6
|
+
KLING_4_PROVIDERS,
|
|
7
|
+
isKling4Provider,
|
|
8
|
+
normalizeKling4Resolution,
|
|
9
|
+
kling4KeyframeFrameCap,
|
|
10
|
+
VIDEO_REF_LIMITS_BY_PROVIDER,
|
|
11
|
+
VIDEO_REF_VIDEO_DURATION_LIMITS,
|
|
12
|
+
videoProviderRequiresImage,
|
|
13
|
+
videoProviderAppendsFrames,
|
|
14
|
+
isGvpSupportedProvider,
|
|
15
|
+
supportsExtendRender,
|
|
16
|
+
} from "../model-constants.js"
|
|
17
|
+
import { uiAspectRatioFill, uiDurationFill, uiResolutionFill } from "../video-ui-defaults.js"
|
|
18
|
+
import { characterReferencesFromWired, videoCharacterRefProblem } from "../video-character-refs.js"
|
|
19
|
+
import type { ConnectedReference } from "../types.js"
|
|
20
|
+
|
|
21
|
+
describe("kling-4 / kling-4-keyframes catalog", () => {
|
|
22
|
+
it("two Kling-series ids, both modes, 3-30s, 720p/1080p, no seed", () => {
|
|
23
|
+
for (const id of ["kling-4", "kling-4-keyframes"]) {
|
|
24
|
+
const m = MODEL_CATALOG[id]!
|
|
25
|
+
expect(m.series).toBe("Kling") // ⇒ closed to the free tier (FREE_BLOCKED_VIDEO_SERIES)
|
|
26
|
+
expect(m.maker).toBe("kuaishou")
|
|
27
|
+
expect([...m.modes]).toEqual(["i2v", "t2v"])
|
|
28
|
+
expect(m.durations).toEqual(Array.from({ length: 28 }, (_, i) => i + 3))
|
|
29
|
+
expect(m.defaultDuration).toBe(5)
|
|
30
|
+
expect(m.resolutions).toEqual(["720p", "1080p"])
|
|
31
|
+
expect(m.noSeed).toBe(true)
|
|
32
|
+
expect(m.aspectRatios).toEqual(["auto", "16:9", "9:16", "1:1", "21:9"])
|
|
33
|
+
expect(IMAGE_TO_VIDEO_PROVIDERS as readonly string[]).toContain(id)
|
|
34
|
+
expect(TEXT_TO_VIDEO_PROVIDERS as readonly string[]).toContain(id)
|
|
35
|
+
expect(videoProviderRequiresImage(id)).toBe(false)
|
|
36
|
+
}
|
|
37
|
+
expect([...KLING_4_PROVIDERS]).toEqual(["kling-4", "kling-4-keyframes"])
|
|
38
|
+
expect(isKling4Provider("kling-3.0")).toBe(false)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it("reference: subjects, voices and reference videos; keyframes: in-between frames on their own channel", () => {
|
|
42
|
+
expect(VIDEO_REF_LIMITS_BY_PROVIDER["kling-4"]).toEqual({ images: 10, videos: 5, audio: 3, characters: 7, materials: 15 })
|
|
43
|
+
expect(VIDEO_REF_VIDEO_DURATION_LIMITS["kling-4"]).toEqual({ minSec: 2, maxSec: 30 })
|
|
44
|
+
expect(hasFeature("kling-4", "character-subjects")).toBe(true)
|
|
45
|
+
expect(VIDEO_REF_LIMITS_BY_PROVIDER["kling-4-keyframes"]).toEqual({ images: 8 })
|
|
46
|
+
expect(hasFeature("kling-4-keyframes", "keyframes")).toBe(true)
|
|
47
|
+
expect(videoProviderAppendsFrames("kling-4")).toBe(true)
|
|
48
|
+
expect(videoProviderAppendsFrames("kling-4-keyframes")).toBe(false)
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it("Generate Video Pro offers kling-4 in keyframes mode only and never the Keyframes id", () => {
|
|
52
|
+
expect(isGvpSupportedProvider("kling-4")).toBe(true)
|
|
53
|
+
expect(supportsExtendRender("kling-4")).toBe(false)
|
|
54
|
+
expect(isGvpSupportedProvider("kling-4-keyframes")).toBe(false)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it("the editor fills the rendered defaults: 720p, 5s, auto", () => {
|
|
58
|
+
for (const id of ["kling-4", "kling-4-keyframes"]) {
|
|
59
|
+
expect(uiResolutionFill(id)).toBe("720p")
|
|
60
|
+
expect(uiDurationFill(id)).toBe(5)
|
|
61
|
+
expect(uiAspectRatioFill(id)).toBe("auto")
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
it("normalizeKling4Resolution folds case and collapses anything else to 720p", () => {
|
|
66
|
+
expect(normalizeKling4Resolution("1080P")).toBe("1080p")
|
|
67
|
+
expect(normalizeKling4Resolution(" 1080p ")).toBe("1080p")
|
|
68
|
+
for (const v of [undefined, "", "720p", "480p", "4k", "garbage"]) expect(normalizeKling4Resolution(v)).toBe("720p")
|
|
69
|
+
expect(MODEL_CATALOG["kling-4"]!.unlistedResolutionRendersAs).toBe("720p")
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
it("kling4KeyframeFrameCap is KIE's table: 3s → 4 … 8s → 9, 9s or longer → 10", () => {
|
|
73
|
+
expect([3, 4, 5, 6, 7, 8, 9, 15, 30].map(kling4KeyframeFrameCap)).toEqual([4, 5, 6, 7, 8, 9, 10, 10, 10])
|
|
74
|
+
expect(kling4KeyframeFrameCap(Number.NaN)).toBe(6)
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
describe("characterReferencesFromWired", () => {
|
|
79
|
+
const ref = (over: Partial<ConnectedReference>): ConnectedReference => ({
|
|
80
|
+
id: "x",
|
|
81
|
+
defaultName: "Maya",
|
|
82
|
+
source: "wired-character",
|
|
83
|
+
url: "https://cdn.example/maya.png",
|
|
84
|
+
characterSlug: "maya",
|
|
85
|
+
...over,
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
it("groups one character's entries: the canonical portrait first, then up to 3 views", () => {
|
|
89
|
+
const out = characterReferencesFromWired([
|
|
90
|
+
ref({ id: "v1", defaultName: "Maya / smile", url: "https://cdn.example/smile.png", variantSlug: "smile" }),
|
|
91
|
+
ref({ id: "c", characterCanonicalDescription: "Short silver hair" }),
|
|
92
|
+
ref({ id: "v2", defaultName: "Maya / side", url: "https://cdn.example/side.png", variantSlug: "side" }),
|
|
93
|
+
ref({ id: "v3", defaultName: "Maya / back", url: "https://cdn.example/back.png", variantSlug: "back" }),
|
|
94
|
+
ref({ id: "v4", defaultName: "Maya / walk", url: "https://cdn.example/walk.png", variantSlug: "walk" }),
|
|
95
|
+
ref({ id: "k", defaultName: "Kira", characterSlug: "kira", url: "https://cdn.example/kira.png", description: "Tall" }),
|
|
96
|
+
])
|
|
97
|
+
expect(out).toEqual([
|
|
98
|
+
{
|
|
99
|
+
imageUrl: "https://cdn.example/maya.png",
|
|
100
|
+
extraImageUrls: ["https://cdn.example/smile.png", "https://cdn.example/side.png", "https://cdn.example/back.png"],
|
|
101
|
+
description: "Short silver hair",
|
|
102
|
+
name: "Maya",
|
|
103
|
+
},
|
|
104
|
+
{ imageUrl: "https://cdn.example/kira.png", description: "Tall", name: "Kira" },
|
|
105
|
+
])
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
it("skips anything that is not a wired character", () => {
|
|
109
|
+
expect(characterReferencesFromWired([ref({ source: "manual" as ConnectedReference["source"] })])).toEqual([])
|
|
110
|
+
})
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
describe("videoCharacterRefProblem — Kling 4.0's 15-material budget", () => {
|
|
114
|
+
const chars = (n: number) => Array.from({ length: n }, (_, i) => ({ imageUrl: `https://cdn.example/${i}.png`, description: "x" }))
|
|
115
|
+
|
|
116
|
+
it("takes characters beside a start frame (it joins the images)", () => {
|
|
117
|
+
expect(videoCharacterRefProblem({ provider: "kling-4", characterReferences: chars(2), imageCount: 1, videoCount: 0, hasStartFrame: true })).toBeNull()
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
it("refuses more than 15 materials in all and more than 7 characters", () => {
|
|
121
|
+
expect(videoCharacterRefProblem({ provider: "kling-4", characterReferences: chars(7), imageCount: 4, videoCount: 3, audioCount: 1, hasStartFrame: true })?.code).toBe("character_references_quota")
|
|
122
|
+
expect(videoCharacterRefProblem({ provider: "kling-4", characterReferences: chars(8), imageCount: 0, videoCount: 0, hasStartFrame: false })?.code).toBe("character_references_over_limit")
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
it("refuses a Gemini preset voice (Kling takes recorded voices as reference audio)", () => {
|
|
126
|
+
const voiced = [{ ...chars(1)[0]!, voice: { preset: "Kore" as never } }]
|
|
127
|
+
expect(videoCharacterRefProblem({ provider: "kling-4", characterReferences: voiced, imageCount: 0, videoCount: 0, hasStartFrame: false })?.code).toBe("character_voice_unsupported")
|
|
128
|
+
})
|
|
129
|
+
})
|
|
@@ -22,11 +22,12 @@ const portrait = (over: Partial<VideoCharacterReference> = {}): VideoCharacterRe
|
|
|
22
22
|
})
|
|
23
23
|
|
|
24
24
|
describe("character reference capability (data-driven)", () => {
|
|
25
|
-
it("both Gemini Omni SKUs declare a 3-character cap; nothing else does", () => {
|
|
25
|
+
it("both Gemini Omni SKUs declare a 3-character cap, Kling 4.0 a 7-subject cap; nothing else does", () => {
|
|
26
26
|
expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-video"]?.characters).toBe(3)
|
|
27
27
|
expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-flash"]?.characters).toBe(3)
|
|
28
|
+
expect(VIDEO_REF_LIMITS_BY_PROVIDER["kling-4"]?.characters).toBe(7)
|
|
28
29
|
const others = Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER)
|
|
29
|
-
.filter(([id, l]) => !id.startsWith("gemini-omni") && (l?.characters ?? 0) > 0)
|
|
30
|
+
.filter(([id, l]) => !id.startsWith("gemini-omni") && id !== "kling-4" && (l?.characters ?? 0) > 0)
|
|
30
31
|
expect(others).toEqual([])
|
|
31
32
|
})
|
|
32
33
|
|
package/src/cast-swap-limits.ts
CHANGED
|
@@ -44,8 +44,17 @@ export const CAST_SWAP_FACE_MASKING_BOUNDS = {
|
|
|
44
44
|
|
|
45
45
|
/** What Cast Swap uses for a `faceMasking` setting left out. */
|
|
46
46
|
export const CAST_SWAP_FACE_MASKING_DEFAULTS = {
|
|
47
|
+
/** What covers a masked face: a blur (`"depth"`, a depth-color view of it, is the other fill). */
|
|
48
|
+
fill: "blur",
|
|
47
49
|
minFaceHeightPct: 15,
|
|
48
50
|
maxFaceHeightPct: 0,
|
|
51
|
+
/**
|
|
52
|
+
* The frame margins when `zone` is left out: a face centred in the outer 10 %
|
|
53
|
+
* at the left or right is not masked (people walking in at the edge). An
|
|
54
|
+
* explicit `zone: null`, or all four margins 0, means no margins.
|
|
55
|
+
*/
|
|
56
|
+
zone: { leftPct: 10, rightPct: 10, topPct: 0, bottomPct: 0 },
|
|
57
|
+
/** A margin left out of a `zone` that is given. */
|
|
49
58
|
zonePct: 0,
|
|
50
59
|
blurStrengthPct: 2,
|
|
51
60
|
threshold: 0.5,
|
|
@@ -25,6 +25,9 @@ import {
|
|
|
25
25
|
isGeminiOmniProvider,
|
|
26
26
|
isWan3Provider,
|
|
27
27
|
isViduQ4Provider,
|
|
28
|
+
isKling4Provider,
|
|
29
|
+
normalizeKling4Resolution,
|
|
30
|
+
VIDEO_REF_RATE_PROVIDERS,
|
|
28
31
|
normalizeMinimaxH3Resolution,
|
|
29
32
|
normalizeWan3Resolution,
|
|
30
33
|
normalizeViduQ4Resolution,
|
|
@@ -346,6 +349,7 @@ function ltxPricedTier(
|
|
|
346
349
|
function wireNormalizedResolution(provider: string, resolution: string | undefined): string | undefined {
|
|
347
350
|
if (isWan3Provider(provider)) return normalizeWan3Resolution(resolution).toLowerCase()
|
|
348
351
|
if (isViduQ4Provider(provider)) return normalizeViduQ4Resolution(resolution)
|
|
352
|
+
if (isKling4Provider(provider)) return normalizeKling4Resolution(resolution)
|
|
349
353
|
return resolution
|
|
350
354
|
}
|
|
351
355
|
|
|
@@ -497,6 +501,8 @@ export function buildVideoCreditModelIdentifier(
|
|
|
497
501
|
const requested = wireNormalizedResolution(effectiveProvider, resolution)
|
|
498
502
|
const res = requested && resTiers.includes(requested) ? requested : fallback
|
|
499
503
|
identifier += `:${res}`
|
|
504
|
+
// A reference VIDEO bills at its own per-second rate (Kling 4.0).
|
|
505
|
+
if (hasVideoRef && VIDEO_REF_RATE_PROVIDERS.has(effectiveProvider)) identifier += "-ref"
|
|
500
506
|
}
|
|
501
507
|
|
|
502
508
|
// MiniMax Hailuo 3 (768P lever, 2026-08-03): bare duration composites stay
|
package/src/entries/models.ts
CHANGED
|
@@ -154,6 +154,14 @@ export {
|
|
|
154
154
|
isViduQ4Provider,
|
|
155
155
|
VIDU_Q4_DEFAULT_RESOLUTION,
|
|
156
156
|
normalizeViduQ4Resolution,
|
|
157
|
+
KLING_4_PROVIDERS,
|
|
158
|
+
isKling4Provider,
|
|
159
|
+
KLING_4_DEFAULT_RESOLUTION,
|
|
160
|
+
normalizeKling4Resolution,
|
|
161
|
+
KLING_4_MAX_MIDDLE_FRAMES,
|
|
162
|
+
kling4KeyframeFrameCap,
|
|
163
|
+
VIDEO_REF_RATE_PROVIDERS,
|
|
164
|
+
billsReferenceVideoSeconds,
|
|
157
165
|
GEMINI_OMNI_PROVIDERS,
|
|
158
166
|
isGeminiOmniProvider,
|
|
159
167
|
VIDEO_PROVIDERS_WITHOUT_DISPATCH,
|
package/src/entries/video.ts
CHANGED