@nodaro/shared 3.68.0 → 3.70.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-5IZHECUP.js → chunk-2VOXSVIE.js} +3 -3
- package/dist/{chunk-5IZHECUP.js.map → chunk-2VOXSVIE.js.map} +1 -1
- package/dist/{chunk-OXBU5AGH.js → chunk-42ICEVUN.js} +3 -3
- package/dist/{chunk-OXBU5AGH.js.map → chunk-42ICEVUN.js.map} +1 -1
- package/dist/{chunk-EFYWV2V5.cjs → chunk-4U7QAUV3.cjs} +73 -73
- package/dist/{chunk-EFYWV2V5.cjs.map → chunk-4U7QAUV3.cjs.map} +1 -1
- package/dist/{chunk-OFQ6CU6S.js → chunk-52JNQG4K.js} +3 -3
- package/dist/{chunk-OFQ6CU6S.js.map → chunk-52JNQG4K.js.map} +1 -1
- package/dist/{chunk-PERUFUVH.cjs → chunk-5B337MCI.cjs} +15 -15
- package/dist/{chunk-PERUFUVH.cjs.map → chunk-5B337MCI.cjs.map} +1 -1
- package/dist/{chunk-66QSUUB4.cjs → chunk-5DRSENY3.cjs} +24 -24
- package/dist/{chunk-66QSUUB4.cjs.map → chunk-5DRSENY3.cjs.map} +1 -1
- package/dist/{chunk-3YWZ5SOZ.js → chunk-BIQ7COJP.js} +5 -5
- package/dist/{chunk-3YWZ5SOZ.js.map → chunk-BIQ7COJP.js.map} +1 -1
- package/dist/{chunk-4XR66IWF.cjs → chunk-BLGZW3UF.cjs} +64 -23
- package/dist/chunk-BLGZW3UF.cjs.map +1 -0
- package/dist/{chunk-KSHAAPQF.cjs → chunk-BOCHNFDU.cjs} +4 -4
- package/dist/chunk-BOCHNFDU.cjs.map +1 -0
- package/dist/{chunk-Z77M7Q2R.js → chunk-C2UHX7OF.js} +3 -3
- package/dist/{chunk-Z77M7Q2R.js.map → chunk-C2UHX7OF.js.map} +1 -1
- package/dist/{chunk-Q2LEJXLZ.cjs → chunk-C32IL6RD.cjs} +2 -2
- package/dist/{chunk-Q2LEJXLZ.cjs.map → chunk-C32IL6RD.cjs.map} +1 -1
- package/dist/{chunk-5NVGKXJV.cjs → chunk-CV2BEK52.cjs} +111 -3
- package/dist/chunk-CV2BEK52.cjs.map +1 -0
- package/dist/{chunk-G2G7XGFU.cjs → chunk-DOY47F7S.cjs} +7 -7
- package/dist/{chunk-G2G7XGFU.cjs.map → chunk-DOY47F7S.cjs.map} +1 -1
- package/dist/{chunk-5GG4CG4Y.js → chunk-EWNDK4FV.js} +3 -3
- package/dist/{chunk-5GG4CG4Y.js.map → chunk-EWNDK4FV.js.map} +1 -1
- package/dist/{chunk-T4GIHHXY.cjs → chunk-FMQ43SJP.cjs} +6 -6
- package/dist/{chunk-T4GIHHXY.cjs.map → chunk-FMQ43SJP.cjs.map} +1 -1
- package/dist/{chunk-IWUW3YPM.cjs → chunk-FWPGRC4X.cjs} +5 -5
- package/dist/{chunk-IWUW3YPM.cjs.map → chunk-FWPGRC4X.cjs.map} +1 -1
- package/dist/{chunk-37ZSFS6A.cjs → chunk-GC77W57T.cjs} +18 -18
- package/dist/{chunk-37ZSFS6A.cjs.map → chunk-GC77W57T.cjs.map} +1 -1
- package/dist/{chunk-BNR5FKL5.js → chunk-H2E4QXEZ.js} +3 -3
- package/dist/{chunk-BNR5FKL5.js.map → chunk-H2E4QXEZ.js.map} +1 -1
- package/dist/{chunk-GF7ZA26H.js → chunk-HA2PVTER.js} +5 -5
- package/dist/{chunk-GF7ZA26H.js.map → chunk-HA2PVTER.js.map} +1 -1
- package/dist/{chunk-M5QY464F.cjs → chunk-HBRDKHIW.cjs} +21 -21
- package/dist/{chunk-M5QY464F.cjs.map → chunk-HBRDKHIW.cjs.map} +1 -1
- package/dist/{chunk-E62W5I6A.cjs → chunk-HWBLZSM3.cjs} +109 -7
- package/dist/chunk-HWBLZSM3.cjs.map +1 -0
- package/dist/{chunk-5LWYX4GV.js → chunk-IKN54UGB.js} +3 -3
- package/dist/{chunk-5LWYX4GV.js.map → chunk-IKN54UGB.js.map} +1 -1
- package/dist/{chunk-UVUHVY7F.js → chunk-JCYTTTM2.js} +2 -2
- package/dist/{chunk-UVUHVY7F.js.map → chunk-JCYTTTM2.js.map} +1 -1
- package/dist/{chunk-PJAJCFLP.cjs → chunk-JEUZNHLL.cjs} +168 -44
- package/dist/chunk-JEUZNHLL.cjs.map +1 -0
- package/dist/{chunk-TAPBDT47.js → chunk-JVYDKXGY.js} +4 -4
- package/dist/{chunk-TAPBDT47.js.map → chunk-JVYDKXGY.js.map} +1 -1
- package/dist/{chunk-V6OXSXIX.js → chunk-K3YGI5IW.js} +107 -4
- package/dist/chunk-K3YGI5IW.js.map +1 -0
- package/dist/{chunk-SCDE676D.js → chunk-KKFFQUMM.js} +65 -23
- package/dist/chunk-KKFFQUMM.js.map +1 -0
- package/dist/{chunk-BHL7TAQO.js → chunk-LTBM2KMY.js} +43 -10
- package/dist/chunk-LTBM2KMY.js.map +1 -0
- package/dist/{chunk-BMDOPJBP.cjs → chunk-MZ772ZXA.cjs} +17 -17
- package/dist/{chunk-BMDOPJBP.cjs.map → chunk-MZ772ZXA.cjs.map} +1 -1
- package/dist/{chunk-SW5ZD7BO.js → chunk-NS34PZ2S.js} +3 -3
- package/dist/{chunk-SW5ZD7BO.js.map → chunk-NS34PZ2S.js.map} +1 -1
- package/dist/{chunk-6Q4BS6AR.js → chunk-NT3ZFUNJ.js} +31 -3
- package/dist/chunk-NT3ZFUNJ.js.map +1 -0
- package/dist/{chunk-VBP4DH37.js → chunk-O53P2D4V.js} +130 -15
- package/dist/chunk-O53P2D4V.js.map +1 -0
- package/dist/{chunk-AT53ZQUC.js → chunk-OW5AXH2Y.js} +51 -7
- package/dist/chunk-OW5AXH2Y.js.map +1 -0
- package/dist/{chunk-F6XIH3TZ.cjs → chunk-OZHE77T3.cjs} +9 -9
- package/dist/{chunk-F6XIH3TZ.cjs.map → chunk-OZHE77T3.cjs.map} +1 -1
- package/dist/{chunk-5J2LIQYU.js → chunk-PKWRAMVB.js} +6 -6
- package/dist/{chunk-5J2LIQYU.js.map → chunk-PKWRAMVB.js.map} +1 -1
- package/dist/{chunk-BCY3A62O.cjs → chunk-POZBRZUM.cjs} +75 -60
- package/dist/chunk-POZBRZUM.cjs.map +1 -0
- package/dist/{chunk-X2YHKP4D.cjs → chunk-PWIKUOLB.cjs} +8 -8
- package/dist/{chunk-X2YHKP4D.cjs.map → chunk-PWIKUOLB.cjs.map} +1 -1
- package/dist/{chunk-OXTF4Y3P.cjs → chunk-PYYYBINP.cjs} +6 -6
- package/dist/{chunk-OXTF4Y3P.cjs.map → chunk-PYYYBINP.cjs.map} +1 -1
- package/dist/{chunk-WZG6GZIL.cjs → chunk-QCGSL4CJ.cjs} +4 -4
- package/dist/{chunk-WZG6GZIL.cjs.map → chunk-QCGSL4CJ.cjs.map} +1 -1
- package/dist/{chunk-XEPKONJC.js → chunk-QCVQVKCI.js} +3 -3
- package/dist/{chunk-XEPKONJC.js.map → chunk-QCVQVKCI.js.map} +1 -1
- package/dist/{chunk-3L7GMQ4M.cjs → chunk-QCZYYAPZ.cjs} +54 -49
- package/dist/chunk-QCZYYAPZ.cjs.map +1 -0
- package/dist/{chunk-GNLA5NTT.cjs → chunk-QV32JI4L.cjs} +4 -4
- package/dist/{chunk-GNLA5NTT.cjs.map → chunk-QV32JI4L.cjs.map} +1 -1
- package/dist/{chunk-3QJ3UR5Z.js → chunk-QVAUBB2T.js} +11 -11
- package/dist/{chunk-3QJ3UR5Z.js.map → chunk-QVAUBB2T.js.map} +1 -1
- package/dist/{chunk-MVXZP6VB.js → chunk-R22UHRR6.js} +109 -7
- package/dist/chunk-R22UHRR6.js.map +1 -0
- package/dist/{chunk-KL6GAYTT.js → chunk-S6DXSQCV.js} +5 -3
- package/dist/chunk-S6DXSQCV.js.map +1 -0
- package/dist/{chunk-V24EPI5N.cjs → chunk-U4DIGIC3.cjs} +5 -3
- package/dist/chunk-U4DIGIC3.cjs.map +1 -0
- package/dist/{chunk-H5KHWTAE.js → chunk-UY6QZX7H.js} +4 -4
- package/dist/chunk-UY6QZX7H.js.map +1 -0
- package/dist/{chunk-XNJDAW3M.js → chunk-V6TC2NDG.js} +31 -17
- package/dist/chunk-V6TC2NDG.js.map +1 -0
- package/dist/{chunk-DBD4BCGH.cjs → chunk-VDFQKLDG.cjs} +33 -2
- package/dist/chunk-VDFQKLDG.cjs.map +1 -0
- package/dist/{chunk-PGDR7CO3.cjs → chunk-WHV7MDNC.cjs} +70 -11
- package/dist/chunk-WHV7MDNC.cjs.map +1 -0
- package/dist/{chunk-HTDKEYMY.cjs → chunk-XBHDXURR.cjs} +139 -91
- package/dist/chunk-XBHDXURR.cjs.map +1 -0
- package/dist/{chunk-PAUWEWTY.js → chunk-YLDY23N2.js} +12 -7
- package/dist/chunk-YLDY23N2.js.map +1 -0
- package/dist/entries/apps.cjs +43 -43
- package/dist/entries/apps.js +8 -8
- package/dist/entries/credits.cjs +282 -226
- package/dist/entries/credits.d.cts +167 -66
- package/dist/entries/credits.d.ts +167 -66
- package/dist/entries/credits.js +11 -11
- package/dist/entries/llm-models.cjs +88 -68
- package/dist/entries/llm-models.d.cts +73 -6
- package/dist/entries/llm-models.d.ts +73 -6
- package/dist/entries/llm-models.js +2 -2
- package/dist/entries/media.cjs +87 -87
- package/dist/entries/media.js +1 -1
- package/dist/entries/model-catalog.cjs +133 -133
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +458 -406
- package/dist/entries/models.d.cts +64 -29
- package/dist/entries/models.d.ts +64 -29
- package/dist/entries/models.js +7 -7
- package/dist/entries/nodes.cjs +215 -215
- package/dist/entries/nodes.js +11 -11
- package/dist/entries/pipeline.cjs +153 -153
- 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/social.cjs +237 -177
- package/dist/entries/social.d.cts +183 -6
- package/dist/entries/social.d.ts +183 -6
- package/dist/entries/social.js +2 -2
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +153 -153
- package/dist/entries/video.d.cts +2 -1
- package/dist/entries/video.d.ts +2 -1
- package/dist/entries/video.js +7 -7
- package/dist/entries/workflow.cjs +152 -152
- package/dist/entries/workflow.js +4 -4
- package/dist/index.cjs +2034 -1846
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +26 -26
- package/dist/{model-constants-DZ3tPGFO.d.ts → model-constants-B5DNHIP8.d.ts} +156 -12
- package/dist/{model-constants-BstsUup6.d.cts → model-constants-CQr_d3Kw.d.cts} +156 -12
- package/package.json +1 -1
- package/src/__tests__/cast-swap-limits.test.ts +54 -20
- package/src/__tests__/competitors.test.ts +64 -0
- package/src/__tests__/extend-providers.test.ts +43 -6
- package/src/__tests__/fixtures/measured-input-quote-parity.json +537 -1
- package/src/__tests__/fixtures/planned-length-quote-parity.json +46 -1
- package/src/__tests__/fixtures/probed-node-quote-parity.json +132 -0
- package/src/__tests__/fixtures/video-utility-quote-parity.json +112 -1
- package/src/__tests__/gemini-omni-extend.test.ts +110 -0
- package/src/__tests__/gvp-supported-providers.test.ts +3 -0
- package/src/__tests__/lip-sync-pricing.test.ts +29 -2
- package/src/__tests__/llm-models.test.ts +163 -6
- package/src/__tests__/llm-price-key.test.ts +2 -0
- package/src/__tests__/seedance-2-5-flash-catalog.test.ts +194 -0
- package/src/__tests__/suno-separate.test.ts +32 -0
- package/src/__tests__/video-character-refs.test.ts +48 -0
- package/src/cast-swap-limits.ts +43 -25
- package/src/competitors.ts +80 -8
- package/src/credit-identifiers.ts +51 -32
- package/src/entries/credits.ts +19 -0
- package/src/entries/llm-models.ts +6 -0
- package/src/entries/models.ts +15 -0
- package/src/entries/social.ts +33 -0
- package/src/gemini-omni-extend-quote.ts +76 -0
- package/src/generated/unit-contracts.ts +1 -0
- package/src/lip-sync-pricing.ts +26 -1
- package/src/llm-models.ts +176 -5
- package/src/model-catalog.ts +107 -5
- package/src/model-constants.ts +274 -11
- package/src/node-default-mappings.ts +2 -0
- package/src/node-runtime-keys.ts +2 -2
- package/src/seedance-extend-rate.ts +83 -20
- package/src/seedance-lip-sync.ts +68 -0
- package/src/suno-separate.ts +51 -0
- package/src/topics.ts +162 -0
- package/src/video-character-refs.ts +26 -6
- package/src/video-face-mesh.ts +1 -1
- package/dist/chunk-3L7GMQ4M.cjs.map +0 -1
- package/dist/chunk-4XR66IWF.cjs.map +0 -1
- package/dist/chunk-5NVGKXJV.cjs.map +0 -1
- package/dist/chunk-6Q4BS6AR.js.map +0 -1
- package/dist/chunk-AT53ZQUC.js.map +0 -1
- package/dist/chunk-BCY3A62O.cjs.map +0 -1
- package/dist/chunk-BHL7TAQO.js.map +0 -1
- package/dist/chunk-DBD4BCGH.cjs.map +0 -1
- package/dist/chunk-E62W5I6A.cjs.map +0 -1
- package/dist/chunk-H5KHWTAE.js.map +0 -1
- package/dist/chunk-HTDKEYMY.cjs.map +0 -1
- package/dist/chunk-KL6GAYTT.js.map +0 -1
- package/dist/chunk-KSHAAPQF.cjs.map +0 -1
- package/dist/chunk-MVXZP6VB.js.map +0 -1
- package/dist/chunk-PAUWEWTY.js.map +0 -1
- package/dist/chunk-PGDR7CO3.cjs.map +0 -1
- package/dist/chunk-PJAJCFLP.cjs.map +0 -1
- package/dist/chunk-SCDE676D.js.map +0 -1
- package/dist/chunk-V24EPI5N.cjs.map +0 -1
- package/dist/chunk-V6OXSXIX.js.map +0 -1
- package/dist/chunk-VBP4DH37.js.map +0 -1
- package/dist/chunk-XNJDAW3M.js.map +0 -1
package/src/model-constants.ts
CHANGED
|
@@ -341,10 +341,18 @@ export const MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER: Record<string, number> = {
|
|
|
341
341
|
"seedance-2-fast": 20000,
|
|
342
342
|
"seedance-2-mini": 20000,
|
|
343
343
|
"seedance-2-5-extend": 20000,
|
|
344
|
+
// Seedance 2.5 Flash Extend: the sibling extend's ceiling, under Flash's own
|
|
345
|
+
// 20480 with room for the recipe's wrapper and the reference directives.
|
|
346
|
+
"seedance-2-5-flash-extend": 20000,
|
|
344
347
|
"seedance-2-0-extend": 20000,
|
|
348
|
+
// Gemini Omni Flash 1.2 Extend (fal) — 20000 chars, the endpoint's own cap;
|
|
349
|
+
// its prompt is sent as written, so the whole cap is the user's.
|
|
350
|
+
"gemini-omni-flash-1-2-extend": 20000,
|
|
345
351
|
// Seedance 2.5 raises the prompt ceiling to 30000
|
|
346
352
|
// (docs.kie.ai/market/bytedance/seedance-2-5).
|
|
347
353
|
"seedance-2-5": 30000,
|
|
354
|
+
// Seedance 2.5 Flash — 20480 chars (docs.kie.ai/market/bytedance/seedance-2-5-flash).
|
|
355
|
+
"seedance-2-5-flash": 20480,
|
|
348
356
|
"gemini-omni-video": 20000,
|
|
349
357
|
// Gemini Omni Flash 1.1 — same 20000-char prompt surface as the pro sibling
|
|
350
358
|
// (docs.kie.ai/market/google/gemini-omni-flash-1-1).
|
|
@@ -1175,6 +1183,7 @@ export const IMAGE_TO_VIDEO_PROVIDERS = [
|
|
|
1175
1183
|
"seedance-2-fast",
|
|
1176
1184
|
"seedance-2-mini",
|
|
1177
1185
|
"seedance-2-5",
|
|
1186
|
+
"seedance-2-5-flash",
|
|
1178
1187
|
"minimax-h3",
|
|
1179
1188
|
"hailuo-2.3-pro",
|
|
1180
1189
|
"hailuo-2.3",
|
|
@@ -1240,6 +1249,7 @@ export const TEXT_TO_VIDEO_PROVIDERS = [
|
|
|
1240
1249
|
"seedance-2-fast",
|
|
1241
1250
|
"seedance-2-mini",
|
|
1242
1251
|
"seedance-2-5",
|
|
1252
|
+
"seedance-2-5-flash",
|
|
1243
1253
|
"minimax-h3",
|
|
1244
1254
|
"wan",
|
|
1245
1255
|
"hailuo-standard",
|
|
@@ -1536,7 +1546,7 @@ export type VideoToVideoProvider = typeof VIDEO_TO_VIDEO_PROVIDERS[number]
|
|
|
1536
1546
|
* measured settlement, the edit-mode retry and the reconcile recovery are that
|
|
1537
1547
|
* lane's — there is no second copy to keep in step.
|
|
1538
1548
|
*/
|
|
1539
|
-
export const SEEDANCE_VIDEO_EDIT_PROVIDERS = ["seedance-2-5"] as const
|
|
1549
|
+
export const SEEDANCE_VIDEO_EDIT_PROVIDERS = ["seedance-2-5", "seedance-2-5-flash"] as const
|
|
1540
1550
|
export type SeedanceVideoEditProvider = typeof SEEDANCE_VIDEO_EDIT_PROVIDERS[number]
|
|
1541
1551
|
|
|
1542
1552
|
export function isSeedanceVideoEditProvider(provider: string | undefined): provider is SeedanceVideoEditProvider {
|
|
@@ -1604,12 +1614,20 @@ export const EXTEND_VIDEO_PROVIDERS = [
|
|
|
1604
1614
|
// Seedance extends ANY video, one provider per model: Seedance 2.5 (4–30 s
|
|
1605
1615
|
// added) and Seedance 2.0 (4–15 s), each priced on its own rows
|
|
1606
1616
|
// (`tailExtendCreditId`). The earlier single id `seedance-2-extend` is
|
|
1607
|
-
// retired (RETIRED_VIDEO_PROVIDERS) and runs as Seedance 2.5.
|
|
1617
|
+
// retired (RETIRED_VIDEO_PROVIDERS) and runs as Seedance 2.5. Seedance 2.5
|
|
1618
|
+
// Flash extends the same way as Seedance 2.5 (4–30 s added, 480p / 720p),
|
|
1619
|
+
// generated on Seedance 2.5 Flash and priced on its own rows.
|
|
1608
1620
|
"seedance-2-5-extend",
|
|
1621
|
+
"seedance-2-5-flash-extend",
|
|
1609
1622
|
"seedance-2-0-extend",
|
|
1610
1623
|
// Kling 4 extends ANY video the same way (3–30 s added, 720p / 1080p, its
|
|
1611
1624
|
// sound always on), generated on Kling 4.0 and priced on its own rows.
|
|
1612
1625
|
"kling-4-extend",
|
|
1626
|
+
// Gemini Omni Flash 1.2 extends ANY 16:9 or 9:16 video from its tail (3–10 s
|
|
1627
|
+
// added, 360p–4K), generated on fal: the source's last 10 s go in and come
|
|
1628
|
+
// back with the new seconds joined on, of which only the new ones are kept.
|
|
1629
|
+
// Priced on its own rows, per second sent and added.
|
|
1630
|
+
"gemini-omni-flash-1-2-extend",
|
|
1613
1631
|
// PixVerse V6 extends ANY video natively (1–15 s added, 360p–1080p, a sound
|
|
1614
1632
|
// switch): the whole source goes in and comes back with the new seconds
|
|
1615
1633
|
// joined on, of which only the new ones are kept. Priced on its own rows.
|
|
@@ -1622,8 +1640,8 @@ export const EXTEND_VIDEO_PROVIDERS = [
|
|
|
1622
1640
|
export type ExtendVideoProvider = typeof EXTEND_VIDEO_PROVIDERS[number]
|
|
1623
1641
|
|
|
1624
1642
|
/** The Extend Video providers that run on Seedance, one per model. */
|
|
1625
|
-
export type SeedanceExtendProvider = Extract<ExtendVideoProvider, "seedance-2-5-extend" | "seedance-2-0-extend">
|
|
1626
|
-
const SEEDANCE_EXTEND_PROVIDERS: readonly SeedanceExtendProvider[] = ["seedance-2-5-extend", "seedance-2-0-extend"]
|
|
1643
|
+
export type SeedanceExtendProvider = Extract<ExtendVideoProvider, "seedance-2-5-extend" | "seedance-2-5-flash-extend" | "seedance-2-0-extend">
|
|
1644
|
+
const SEEDANCE_EXTEND_PROVIDERS: readonly SeedanceExtendProvider[] = ["seedance-2-5-extend", "seedance-2-5-flash-extend", "seedance-2-0-extend"]
|
|
1627
1645
|
|
|
1628
1646
|
/**
|
|
1629
1647
|
* Whether a value is one of the Seedance Extend Video providers. A retired id
|
|
@@ -1642,8 +1660,8 @@ export function isSeedanceExtendProvider(p: unknown): p is SeedanceExtendProvide
|
|
|
1642
1660
|
* own catalog entry (its seconds added and resolutions) and price rows, one
|
|
1643
1661
|
* per second and resolution (`tailExtendCreditId`).
|
|
1644
1662
|
*/
|
|
1645
|
-
export type TailExtendProvider = SeedanceExtendProvider | Extract<ExtendVideoProvider, "kling-4-extend">
|
|
1646
|
-
const TAIL_EXTEND_PROVIDERS: readonly TailExtendProvider[] = [...SEEDANCE_EXTEND_PROVIDERS, "kling-4-extend"]
|
|
1663
|
+
export type TailExtendProvider = SeedanceExtendProvider | Extract<ExtendVideoProvider, "kling-4-extend" | "gemini-omni-flash-1-2-extend">
|
|
1664
|
+
const TAIL_EXTEND_PROVIDERS: readonly TailExtendProvider[] = [...SEEDANCE_EXTEND_PROVIDERS, "kling-4-extend", "gemini-omni-flash-1-2-extend"]
|
|
1647
1665
|
|
|
1648
1666
|
/**
|
|
1649
1667
|
* Whether a value is one of the tail-recipe Extend Video providers
|
|
@@ -1719,6 +1737,14 @@ export function isGrokExtendSourceModel(p: unknown): boolean {
|
|
|
1719
1737
|
return typeof p === "string" && (GROK_EXTEND_SOURCE_MODELS as readonly string[]).includes(p)
|
|
1720
1738
|
}
|
|
1721
1739
|
|
|
1740
|
+
/**
|
|
1741
|
+
* The video node types whose run Grok Extend can continue, set to one of
|
|
1742
|
+
* {@link GROK_EXTEND_SOURCE_MODELS}: a Grok Imagine text- or image-to-video
|
|
1743
|
+
* node. The one list the Grok Extend quote and the result rows that carry a
|
|
1744
|
+
* source's task read.
|
|
1745
|
+
*/
|
|
1746
|
+
export const GROK_EXTEND_SOURCE_NODE_TYPES: ReadonlySet<string> = new Set(["generate-video", "text-to-video", "image-to-video"])
|
|
1747
|
+
|
|
1722
1748
|
/** Lip sync providers */
|
|
1723
1749
|
export const LIP_SYNC_PROVIDERS = [
|
|
1724
1750
|
"kling-avatar",
|
|
@@ -1760,6 +1786,7 @@ export const LIP_SYNC_PROVIDERS = [
|
|
|
1760
1786
|
"seedance-2-fast",
|
|
1761
1787
|
"seedance-2-mini",
|
|
1762
1788
|
"seedance-2-5",
|
|
1789
|
+
"seedance-2-5-flash",
|
|
1763
1790
|
// MiniMax Hailuo 3 — same multimodal audio-driven mechanism (r2v
|
|
1764
1791
|
// reference_audio_urls paired with an image ref); rides the same
|
|
1765
1792
|
// reference-audio lip-sync surface as the Seedance 2 family.
|
|
@@ -1804,6 +1831,7 @@ export const SEEDANCE_LIP_SYNC_PROVIDERS = new Set<string>([
|
|
|
1804
1831
|
"seedance-2-fast",
|
|
1805
1832
|
"seedance-2-mini",
|
|
1806
1833
|
"seedance-2-5",
|
|
1834
|
+
"seedance-2-5-flash",
|
|
1807
1835
|
"minimax-h3",
|
|
1808
1836
|
])
|
|
1809
1837
|
|
|
@@ -2354,6 +2382,7 @@ export const DURATION_PRICED_PROVIDERS = new Set([
|
|
|
2354
2382
|
"seedance-2-fast",
|
|
2355
2383
|
"seedance-2-mini",
|
|
2356
2384
|
"seedance-2-5",
|
|
2385
|
+
"seedance-2-5-flash",
|
|
2357
2386
|
"minimax-h3",
|
|
2358
2387
|
"grok-imagine-video-1.5",
|
|
2359
2388
|
"happyhorse",
|
|
@@ -2398,12 +2427,42 @@ export const SEEDANCE_2_PROVIDERS = new Set<string>([
|
|
|
2398
2427
|
// DIFFERS (30s ceiling, no 1080p/4K, wider ref caps) the difference is
|
|
2399
2428
|
// carried by the per-provider maps, never by branching on this set.
|
|
2400
2429
|
"seedance-2-5",
|
|
2430
|
+
// Seedance 2.5 Flash — the fast tier of 2.5, same capability surface. Its
|
|
2431
|
+
// own facts (480p/720p, 10/5/5 references, WAV/MP3 reference audio, no
|
|
2432
|
+
// draft) live in the per-provider maps, as 2.5's do.
|
|
2433
|
+
"seedance-2-5-flash",
|
|
2401
2434
|
])
|
|
2402
2435
|
|
|
2403
2436
|
export function isSeedance2Provider(provider: string | undefined): boolean {
|
|
2404
2437
|
return !!provider && SEEDANCE_2_PROVIDERS.has(provider)
|
|
2405
2438
|
}
|
|
2406
2439
|
|
|
2440
|
+
/**
|
|
2441
|
+
* Seedance models Edit Video Pro does not offer, although they are members of
|
|
2442
|
+
* the family it is drawn from (decided 2026-11-16: Seedance 2.5 Flash ships on
|
|
2443
|
+
* Generate Video, Generate Video Pro, Edit Video and Lip Sync; Edit Video Pro
|
|
2444
|
+
* is a separate decision). Read through {@link isEditVideoProProvider}.
|
|
2445
|
+
*/
|
|
2446
|
+
export const EDIT_VIDEO_PRO_HELD_BACK_PROVIDERS: ReadonlySet<string> = new Set<string>(["seedance-2-5-flash"])
|
|
2447
|
+
|
|
2448
|
+
/** Whether Edit Video Pro offers this model: a Seedance 2 family member it has not held back. */
|
|
2449
|
+
export function isEditVideoProProvider(provider: string | undefined): boolean {
|
|
2450
|
+
return isSeedance2Provider(provider) && !EDIT_VIDEO_PRO_HELD_BACK_PROVIDERS.has(provider!)
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
/**
|
|
2454
|
+
* The refusal for an Edit Video Pro run on a model it holds back
|
|
2455
|
+
* ({@link EDIT_VIDEO_PRO_HELD_BACK_PROVIDERS}), or undefined: refused before
|
|
2456
|
+
* anything is priced or held, on the route's pricing and the workflow run
|
|
2457
|
+
* alike (a stored, imported or MCP-written node too). Any other model keeps
|
|
2458
|
+
* its own handling (an unknown one is refused by its price lookup).
|
|
2459
|
+
*/
|
|
2460
|
+
export function editVideoProProviderRefusal(provider: string | undefined): string | undefined {
|
|
2461
|
+
return provider !== undefined && EDIT_VIDEO_PRO_HELD_BACK_PROVIDERS.has(provider)
|
|
2462
|
+
? `${provider} is not offered on Edit Video Pro. Pick another Edit Video Pro model.`
|
|
2463
|
+
: undefined
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2407
2466
|
/**
|
|
2408
2467
|
* MiniMax Hailuo 3 family — the KIE "minimax-h3" market model. One Nodaro id
|
|
2409
2468
|
* covers three KIE endpoints (text-to-video / image-to-video /
|
|
@@ -3065,6 +3124,17 @@ export const SEEDANCE_2_5_REF_LIMITS = {
|
|
|
3065
3124
|
audio: 10,
|
|
3066
3125
|
} as const
|
|
3067
3126
|
|
|
3127
|
+
/**
|
|
3128
|
+
* Seedance 2.5 Flash's reference caps (docs.kie.ai/market/bytedance/seedance-2-5-flash):
|
|
3129
|
+
* 10 images, 5 videos, 5 audio clips. Its own constant: Flash is the fast tier
|
|
3130
|
+
* of 2.5, but its caps are lower than 2.5's.
|
|
3131
|
+
*/
|
|
3132
|
+
export const SEEDANCE_2_5_FLASH_REF_LIMITS = {
|
|
3133
|
+
images: 10,
|
|
3134
|
+
videos: 5,
|
|
3135
|
+
audio: 5,
|
|
3136
|
+
} as const
|
|
3137
|
+
|
|
3068
3138
|
/**
|
|
3069
3139
|
* KIE r2v REFERENCE-VIDEO MINIMUM (seconds) for the Seedance 2.0 family — the
|
|
3070
3140
|
* provider hard-rejects shorter reference clips with a 400 BEFORE generation:
|
|
@@ -3127,6 +3197,9 @@ export const SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER: Record<string, number> =
|
|
|
3127
3197
|
// Seedance 2.5 — documented hard limit: each reference audio 2-30s, ≤15 MB
|
|
3128
3198
|
// per file (docs.kie.ai/market/bytedance/seedance-2-5).
|
|
3129
3199
|
"seedance-2-5": 30,
|
|
3200
|
+
// Seedance 2.5 Flash — the same documented 2-30s per clip, ≤15 MB
|
|
3201
|
+
// (docs.kie.ai/market/bytedance/seedance-2-5-flash).
|
|
3202
|
+
"seedance-2-5-flash": 30,
|
|
3130
3203
|
// MiniMax Hailuo 3 — documented hard limit: each reference audio segment
|
|
3131
3204
|
// 2-15s, ≤15s total (docs.kie.ai/market/minimax-h3/reference-to-video).
|
|
3132
3205
|
"minimax-h3": 15,
|
|
@@ -3165,8 +3238,16 @@ export function findSeedance2AudioOverLimit(
|
|
|
3165
3238
|
export interface RefAudioRule {
|
|
3166
3239
|
/** Accepted containers, as ffprobe's `format_name` spells them ("mp3"). */
|
|
3167
3240
|
formats?: readonly string[]
|
|
3241
|
+
/**
|
|
3242
|
+
* A clip outside `formats` is converted to this format before it is sent,
|
|
3243
|
+
* instead of refused (decided 2026-11-16 for Seedance 2.5 Flash). Its length
|
|
3244
|
+
* is still checked.
|
|
3245
|
+
*/
|
|
3246
|
+
convertsTo?: "mp3"
|
|
3168
3247
|
minSec?: number
|
|
3169
3248
|
maxSec?: number
|
|
3249
|
+
/** The most seconds all the reference audio of a request may play, together. */
|
|
3250
|
+
maxTotalSec?: number
|
|
3170
3251
|
}
|
|
3171
3252
|
|
|
3172
3253
|
/**
|
|
@@ -3186,6 +3267,13 @@ export interface RefAudioRule {
|
|
|
3186
3267
|
*/
|
|
3187
3268
|
export const VIDEO_REF_AUDIO_RULES: Record<string, RefAudioRule | undefined> = {
|
|
3188
3269
|
"vidu-q4": { formats: ["mp3"], minSec: 3, maxSec: 12 },
|
|
3270
|
+
// Seedance 2.5 Flash: "Format: wav, mp3", each clip 2-30 seconds, "total
|
|
3271
|
+
// duration of reference audio must not exceed 30 seconds"
|
|
3272
|
+
// (docs.kie.ai/market/bytedance/seedance-2-5-flash). A clip in another format
|
|
3273
|
+
// is converted to MP3 before it is sent (decided 2026-11-16); its length is
|
|
3274
|
+
// still refused before anything is held. Seedance 2.5 itself also takes AAC
|
|
3275
|
+
// and OGG, so it has no row here.
|
|
3276
|
+
"seedance-2-5-flash": { formats: ["wav", "mp3"], convertsTo: "mp3", minSec: 2, maxSec: 30, maxTotalSec: 30 },
|
|
3189
3277
|
}
|
|
3190
3278
|
|
|
3191
3279
|
/** One probed reference-audio clip. A field the probe could not read is absent. */
|
|
@@ -3197,24 +3285,37 @@ export interface RefAudioProbe {
|
|
|
3197
3285
|
|
|
3198
3286
|
export type RefAudioCheck =
|
|
3199
3287
|
| { ok: true }
|
|
3200
|
-
| { ok: false; code: "audio_format_unsupported" | "audio_too_short" | "audio_too_long"; message: string }
|
|
3288
|
+
| { ok: false; code: "audio_format_unsupported" | "audio_too_short" | "audio_too_long" | "audio_total_too_long"; message: string }
|
|
3201
3289
|
|
|
3202
3290
|
/**
|
|
3203
3291
|
* Check probed reference-audio clips against {@link VIDEO_REF_AUDIO_RULES}.
|
|
3204
3292
|
* An unreadable field is IGNORED, never rejected — a probe blip must not block
|
|
3205
3293
|
* a legal run (the provider still has the final say).
|
|
3206
3294
|
*/
|
|
3207
|
-
export function checkRefAudioRules(
|
|
3295
|
+
export function checkRefAudioRules(
|
|
3296
|
+
provider: string | undefined,
|
|
3297
|
+
probes: readonly RefAudioProbe[],
|
|
3298
|
+
/**
|
|
3299
|
+
* Whether a clip outside `formats` can be converted on this install
|
|
3300
|
+
* (`convertsTo`). An install whose stored files no outside provider can
|
|
3301
|
+
* fetch cannot send a converted copy, so there the format is refused, before
|
|
3302
|
+
* anything is held, as on a rule that does not convert. Default: it can.
|
|
3303
|
+
*/
|
|
3304
|
+
opts: { readonly canConvert?: boolean } = {},
|
|
3305
|
+
): RefAudioCheck {
|
|
3208
3306
|
const rule = provider ? VIDEO_REF_AUDIO_RULES[provider] : undefined
|
|
3209
3307
|
if (!rule) return { ok: true }
|
|
3308
|
+
const converts = !!rule.convertsTo && opts.canConvert !== false
|
|
3309
|
+
let totalSec = 0
|
|
3210
3310
|
for (const [i, p] of probes.entries()) {
|
|
3211
3311
|
const n = i + 1
|
|
3212
|
-
if (rule.formats && p.formatNames && p.formatNames.length > 0 && !p.formatNames.some((f) => rule.formats!.includes(f))) {
|
|
3312
|
+
if (rule.formats && !converts && p.formatNames && p.formatNames.length > 0 && !p.formatNames.some((f) => rule.formats!.includes(f))) {
|
|
3213
3313
|
const want = rule.formats.map((f) => f.toUpperCase()).join(" or ")
|
|
3214
3314
|
return { ok: false, code: "audio_format_unsupported", message: `Reference audio ${n} must be ${want} for this model. Convert the clip to ${want} and try again.` }
|
|
3215
3315
|
}
|
|
3216
3316
|
const d = p.durationSec
|
|
3217
3317
|
if (d === undefined || !Number.isFinite(d) || d <= 0) continue
|
|
3318
|
+
totalSec += d
|
|
3218
3319
|
if (rule.minSec !== undefined && d < rule.minSec) {
|
|
3219
3320
|
return { ok: false, code: "audio_too_short", message: `Reference audio ${n} is too short for this model: ${d.toFixed(1)}s is under the ${rule.minSec}s minimum.` }
|
|
3220
3321
|
}
|
|
@@ -3222,6 +3323,9 @@ export function checkRefAudioRules(provider: string | undefined, probes: readonl
|
|
|
3222
3323
|
return { ok: false, code: "audio_too_long", message: `Reference audio ${n} is too long for this model: ${d.toFixed(1)}s exceeds the ${rule.maxSec}s limit. Please use a shorter audio clip.` }
|
|
3223
3324
|
}
|
|
3224
3325
|
}
|
|
3326
|
+
if (rule.maxTotalSec !== undefined && totalSec > rule.maxTotalSec) {
|
|
3327
|
+
return { ok: false, code: "audio_total_too_long", message: `The reference audio is too long for this model: ${totalSec.toFixed(1)}s together exceeds the ${rule.maxTotalSec}s limit. Use fewer or shorter clips.` }
|
|
3328
|
+
}
|
|
3225
3329
|
return { ok: true }
|
|
3226
3330
|
}
|
|
3227
3331
|
|
|
@@ -3246,6 +3350,15 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
|
|
|
3246
3350
|
audio?: number
|
|
3247
3351
|
characters?: number
|
|
3248
3352
|
voices?: number
|
|
3353
|
+
/**
|
|
3354
|
+
* A request that sends more images, videos or audio clips than the caps
|
|
3355
|
+
* above is REFUSED on the API and MCP, before anything is held, instead of
|
|
3356
|
+
* sending the first ones (decided 2026-11-16 for Seedance 2.5 Flash; read
|
|
3357
|
+
* through `videoReferencesOverLimitProblem`). The editor trims what its
|
|
3358
|
+
* Run sends to the caps first (`trimVideoReferencesToLimits`), and a
|
|
3359
|
+
* workflow run keeps the provider's trim, so neither is refused.
|
|
3360
|
+
*/
|
|
3361
|
+
requestRefusesOverLimit?: true
|
|
3249
3362
|
/**
|
|
3250
3363
|
* Cap on ALL materials together (images + videos + characters + audio),
|
|
3251
3364
|
* when the provider counts them as one budget (Kling 4.0: 15). Absent ⇒
|
|
@@ -3254,6 +3367,26 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
|
|
|
3254
3367
|
* (`videoCharacterRefProblem`).
|
|
3255
3368
|
*/
|
|
3256
3369
|
materials?: number
|
|
3370
|
+
/**
|
|
3371
|
+
* The model's `characters` draw on no input budget of their own: they do
|
|
3372
|
+
* not count toward the `images` cap or the image + video quota (Gemini
|
|
3373
|
+
* Omni Flash 1.2: "Character images do not count toward the
|
|
3374
|
+
* reference-image quota"). Absent ⇒ a model declaring `characters` (and no
|
|
3375
|
+
* `materials`) spends them from the Gemini Omni 7-unit budget
|
|
3376
|
+
* (`videoCharacterRefProblem`). The cap on `characters` and the frame
|
|
3377
|
+
* exclusion still apply.
|
|
3378
|
+
*/
|
|
3379
|
+
charactersOutsideImageBudget?: true
|
|
3380
|
+
/**
|
|
3381
|
+
* A scope for the model's cached character ids (and their voice
|
|
3382
|
+
* personas): the provider layer keys its id cache by it too, so an id
|
|
3383
|
+
* minted for this model is never served to another model, nor the other
|
|
3384
|
+
* way round. Absent ⇒ the unscoped cache shared by the Gemini Omni models
|
|
3385
|
+
* from before (their keys stay as they were). Set on Gemini Omni Flash 1.2
|
|
3386
|
+
* because whether an id minted for 1.1 works on 1.2 is unverified
|
|
3387
|
+
* (decided 2026-11-17).
|
|
3388
|
+
*/
|
|
3389
|
+
characterIdScope?: string
|
|
3257
3390
|
/**
|
|
3258
3391
|
* Reference audio rides ON a character subject (its voice), not as a
|
|
3259
3392
|
* material of its own: clip N belongs to wired character N, in the order
|
|
@@ -3295,6 +3428,8 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
|
|
|
3295
3428
|
"seedance-2-mini": { ...SEEDANCE_2_REF_LIMITS },
|
|
3296
3429
|
// Seedance 2.5 — wider caps than the 2.0 family (30 / 10 / 10).
|
|
3297
3430
|
"seedance-2-5": { ...SEEDANCE_2_5_REF_LIMITS },
|
|
3431
|
+
// Seedance 2.5 Flash — lower caps than 2.5 (10 / 5 / 5).
|
|
3432
|
+
"seedance-2-5-flash": { ...SEEDANCE_2_5_FLASH_REF_LIMITS, requestRefusesOverLimit: true },
|
|
3298
3433
|
// MiniMax Hailuo 3 — identical multimodal caps (9 images / 3 videos / 3
|
|
3299
3434
|
// audio per docs.kie.ai/market/minimax-h3/reference-to-video). Note: KIE
|
|
3300
3435
|
// bills input images beyond the first 5 (11 KIE cr each) — see the
|
|
@@ -3323,8 +3458,11 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
|
|
|
3323
3458
|
"gemini-omni-flash": { images: 7, videos: 1, characters: 3, voices: 3 },
|
|
3324
3459
|
// Gemini Omni Flash 1.2 — up to 6 images, one source video, and images +
|
|
3325
3460
|
// 2 for a video ≤ 7, so 5 images beside a video (the request builder holds
|
|
3326
|
-
// that).
|
|
3327
|
-
"
|
|
3461
|
+
// that). `character_ids` max 2, OUTSIDE that image quota (its schema:
|
|
3462
|
+
// "Character images do not count toward the reference-image quota"), never
|
|
3463
|
+
// beside a first/last frame (decided 2026-11-17). No `audio_ids` in its task
|
|
3464
|
+
// schema: no voices.
|
|
3465
|
+
"gemini-omni-flash-1-2": { images: 6, videos: 1, characters: 2, charactersOutsideImageBudget: true, characterIdScope: "gemini-omni-flash-1-2" },
|
|
3328
3466
|
"kling-3-omni": { images: 7 }, // catalog/docs: "end frame + up to 7 reference images"
|
|
3329
3467
|
// Kling 4.0 Reference — 10 images, 5 videos, 7 subjects (`characters`,
|
|
3330
3468
|
// KIE `elements`) and 3 voices (reference audio, KIE `voices`), 15 in all
|
|
@@ -3381,6 +3519,63 @@ export interface RefVideoDurationLimit {
|
|
|
3381
3519
|
maxTotalSec?: number
|
|
3382
3520
|
}
|
|
3383
3521
|
|
|
3522
|
+
/** How many reference images, videos and audio clips a request sends. `frames` counts a start / end frame that joins the image list when any reference is sent. */
|
|
3523
|
+
export interface VideoReferenceCounts {
|
|
3524
|
+
images: number
|
|
3525
|
+
videos: number
|
|
3526
|
+
audio: number
|
|
3527
|
+
frames?: number
|
|
3528
|
+
}
|
|
3529
|
+
|
|
3530
|
+
/**
|
|
3531
|
+
* The refusal for a request that sends more references than the model takes,
|
|
3532
|
+
* on a model that refuses rather than trims (`requestRefusesOverLimit`), or
|
|
3533
|
+
* undefined. A start or end frame joins the image list once any reference is
|
|
3534
|
+
* sent (`resolveSeedance2Inputs`), so it counts toward the image cap then.
|
|
3535
|
+
*/
|
|
3536
|
+
export function videoReferencesOverLimitProblem(provider: string | undefined, counts: VideoReferenceCounts): string | undefined {
|
|
3537
|
+
const row = provider ? VIDEO_REF_LIMITS_BY_PROVIDER[provider] : undefined
|
|
3538
|
+
if (!row?.requestRefusesOverLimit) return undefined
|
|
3539
|
+
const anyReference = counts.images + counts.videos + counts.audio > 0
|
|
3540
|
+
const images = counts.images + (anyReference ? (counts.frames ?? 0) : 0)
|
|
3541
|
+
const checks: Array<[number, number | undefined, string]> = [
|
|
3542
|
+
[images, row.images, anyReference && (counts.frames ?? 0) > 0 ? "images (a start or end frame counts as one)" : "images"],
|
|
3543
|
+
[counts.videos, row.videos, "videos"],
|
|
3544
|
+
[counts.audio, row.audio, "audio clips"],
|
|
3545
|
+
]
|
|
3546
|
+
for (const [n, cap, noun] of checks) {
|
|
3547
|
+
if (cap !== undefined && n > cap) {
|
|
3548
|
+
return `${provider} takes at most ${cap} reference ${noun}; this request sends ${n}. Remove ${n - cap}.`
|
|
3549
|
+
}
|
|
3550
|
+
}
|
|
3551
|
+
return undefined
|
|
3552
|
+
}
|
|
3553
|
+
|
|
3554
|
+
/**
|
|
3555
|
+
* The references the editor's Run sends a model that refuses an over-limit
|
|
3556
|
+
* request: the first ones, up to its caps — images less the frames that join
|
|
3557
|
+
* them — so an editor run is never refused for references a model switch left
|
|
3558
|
+
* wired (decided 2026-11-16). Every other model's lists come back as they are
|
|
3559
|
+
* (the provider keeps its own trim).
|
|
3560
|
+
*/
|
|
3561
|
+
export function trimVideoReferencesToLimits<T>(
|
|
3562
|
+
provider: string | undefined,
|
|
3563
|
+
refs: { images?: readonly T[]; videos?: readonly T[]; audio?: readonly T[]; frames?: number },
|
|
3564
|
+
): { images?: T[]; videos?: T[]; audio?: T[] } {
|
|
3565
|
+
const row = provider ? VIDEO_REF_LIMITS_BY_PROVIDER[provider] : undefined
|
|
3566
|
+
const copy = (l: readonly T[] | undefined) => (l ? [...l] : undefined)
|
|
3567
|
+
if (!row?.requestRefusesOverLimit) return { images: copy(refs.images), videos: copy(refs.videos), audio: copy(refs.audio) }
|
|
3568
|
+
// Counted as the route counts them (`sentVideoReferenceCounts`): blank
|
|
3569
|
+
// entries dropped, the images without duplicates — so what is sent is never
|
|
3570
|
+
// over the caps the route judges.
|
|
3571
|
+
const blank = (x: T) => typeof x === "string" && x.trim().length === 0
|
|
3572
|
+
const clean = (l: readonly T[] | undefined, dedupe = false) =>
|
|
3573
|
+
l ? l.filter((x, i) => !blank(x) && (!dedupe || l.indexOf(x) === i)) : undefined
|
|
3574
|
+
const cut = (l: T[] | undefined, cap: number | undefined) => (l && cap !== undefined ? l.slice(0, Math.max(0, cap)) : l)
|
|
3575
|
+
const imageCap = row.images === undefined ? undefined : row.images - (refs.frames ?? 0)
|
|
3576
|
+
return { images: cut(clean(refs.images, true), imageCap), videos: cut(clean(refs.videos), row.videos), audio: cut(clean(refs.audio), row.audio) }
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3384
3579
|
/**
|
|
3385
3580
|
* Reference-video duration limits, provider-declared.
|
|
3386
3581
|
*
|
|
@@ -3405,6 +3600,9 @@ export interface RefVideoDurationLimit {
|
|
|
3405
3600
|
*/
|
|
3406
3601
|
export const VIDEO_REF_VIDEO_DURATION_LIMITS: Record<string, RefVideoDurationLimit | undefined> = {
|
|
3407
3602
|
"seedance-2-5": { minSec: 2, maxSec: 30, maxTotalSec: 30 },
|
|
3603
|
+
// Seedance 2.5 Flash — the same documented bounds: each clip 2-30s, the
|
|
3604
|
+
// reference videos ≤30s together (docs.kie.ai/market/bytedance/seedance-2-5-flash).
|
|
3605
|
+
"seedance-2-5-flash": { minSec: 2, maxSec: 30, maxTotalSec: 30 },
|
|
3408
3606
|
// MiniMax Hailuo 3 — the provider states the per-clip bound in its own reject
|
|
3409
3607
|
// text: "content[1].video_url: invalid param: video duration 52838 ms,
|
|
3410
3608
|
// expected [2000, 15000] ms" (app-reports P4, 2 rows, the same clip retried).
|
|
@@ -3428,6 +3626,59 @@ export const VIDEO_REF_VIDEO_DURATION_LIMITS: Record<string, RefVideoDurationLim
|
|
|
3428
3626
|
"kling-4-flash": { minSec: 2, maxSec: 20, maxTotalSec: 20 },
|
|
3429
3627
|
}
|
|
3430
3628
|
|
|
3629
|
+
/**
|
|
3630
|
+
* The picture a reference video must have, per provider: only providers with a
|
|
3631
|
+
* documented rule are listed. Seedance 2.5 Flash
|
|
3632
|
+
* (docs.kie.ai/market/bytedance/seedance-2-5-flash): "Total pixels:
|
|
3633
|
+
* [640×640=409600, 834×1112=927408]" (a 480p- or 720p-class picture), "Aspect
|
|
3634
|
+
* ratio (width/height): [0.4, 2.5]" and "Frame rate (FPS): [24, 60]".
|
|
3635
|
+
*
|
|
3636
|
+
* The size and the frame rate are FITTED: the platform re-encodes every
|
|
3637
|
+
* reference video it sends such a model into the window (the provider's
|
|
3638
|
+
* reference-video re-encode), so no clip is refused for them. The shape is
|
|
3639
|
+
* REFUSED ({@link refVideoAspectProblem}) before anything is held: fitting it
|
|
3640
|
+
* would crop or stretch the picture.
|
|
3641
|
+
*/
|
|
3642
|
+
export interface RefVideoPictureLimit {
|
|
3643
|
+
readonly minPixels: number
|
|
3644
|
+
readonly maxPixels: number
|
|
3645
|
+
/** Width ÷ height, inclusive. */
|
|
3646
|
+
readonly minAspect: number
|
|
3647
|
+
readonly maxAspect: number
|
|
3648
|
+
/** Frames per second, inclusive. */
|
|
3649
|
+
readonly minFps: number
|
|
3650
|
+
readonly maxFps: number
|
|
3651
|
+
}
|
|
3652
|
+
|
|
3653
|
+
export const VIDEO_REF_VIDEO_PICTURE_LIMITS: Record<string, RefVideoPictureLimit | undefined> = {
|
|
3654
|
+
"seedance-2-5-flash": { minPixels: 409_600, maxPixels: 927_408, minAspect: 0.4, maxAspect: 2.5, minFps: 24, maxFps: 60 },
|
|
3655
|
+
}
|
|
3656
|
+
|
|
3657
|
+
/** "2.5:1" for a ratio at or above 1, "1:2.5" below it. */
|
|
3658
|
+
function aspectText(ratio: number): string {
|
|
3659
|
+
const n = (v: number) => String(Math.round(v * 100) / 100)
|
|
3660
|
+
return ratio >= 1 ? `${n(ratio)}:1` : `1:${n(1 / ratio)}`
|
|
3661
|
+
}
|
|
3662
|
+
|
|
3663
|
+
/**
|
|
3664
|
+
* Why `provider` cannot take a reference video of `width` × `height` pixels, as
|
|
3665
|
+
* a finished sentence, or undefined when it can: its shape (width ÷ height)
|
|
3666
|
+
* outside the provider's `minAspect`–`maxAspect`
|
|
3667
|
+
* ({@link VIDEO_REF_VIDEO_PICTURE_LIMITS}). A provider with no row, or a size
|
|
3668
|
+
* that is not known (not a positive number), is never refused: the run
|
|
3669
|
+
* measures what it can, and a probe that failed must not refuse a run.
|
|
3670
|
+
*/
|
|
3671
|
+
export function refVideoAspectProblem(provider: string, width: number | undefined, height: number | undefined): string | undefined {
|
|
3672
|
+
const limit = VIDEO_REF_VIDEO_PICTURE_LIMITS[provider]
|
|
3673
|
+
if (!limit || !width || !height || !(width > 0) || !(height > 0)) return undefined
|
|
3674
|
+
const ratio = width / height
|
|
3675
|
+
if (ratio >= limit.minAspect && ratio <= limit.maxAspect) return undefined
|
|
3676
|
+
return (
|
|
3677
|
+
`This model takes a reference video from ${aspectText(limit.minAspect)} to ${aspectText(limit.maxAspect)} (width to height) — ` +
|
|
3678
|
+
`one is ${width}×${height} (${aspectText(ratio)}). Crop it to a less extreme shape and run again.`
|
|
3679
|
+
)
|
|
3680
|
+
}
|
|
3681
|
+
|
|
3431
3682
|
/**
|
|
3432
3683
|
* The length a character's own clip (`characterReferences[].videoUrl`, a video
|
|
3433
3684
|
* subject) must have, per provider. Kling 4.0 and Kling 4.0 Flash: "one 3-8
|
|
@@ -3631,6 +3882,7 @@ export const NATIVE_ADAPTIVE_ASPECT: Record<string, string> = {
|
|
|
3631
3882
|
"seedance-2-fast": "adaptive",
|
|
3632
3883
|
"seedance-2-mini": "adaptive",
|
|
3633
3884
|
"seedance-2-5": "adaptive",
|
|
3885
|
+
"seedance-2-5-flash": "adaptive",
|
|
3634
3886
|
// Wan 3.0 family: `adaptive` is the enum DEFAULT and KIE documents it as
|
|
3635
3887
|
// "automatically selects the ratio based on the input media and intent"
|
|
3636
3888
|
// (docs.kie.ai/market/wan/3-0-video) — i.e. match-the-input, not merely
|
|
@@ -3659,6 +3911,10 @@ export const NATIVE_ADAPTIVE_ASPECT: Record<string, string> = {
|
|
|
3659
3911
|
*/
|
|
3660
3912
|
export const FRAME_MODE_ADAPTIVE_ONLY_ASPECT: ReadonlySet<string> = new Set([
|
|
3661
3913
|
"seedance-2-5",
|
|
3914
|
+
// Seedance 2.5 Flash — DOCUMENTED on its own schema: "First-frame and
|
|
3915
|
+
// first-and-last-frame requests only support `adaptive`"
|
|
3916
|
+
// (docs.kie.ai/market/bytedance/seedance-2-5-flash).
|
|
3917
|
+
"seedance-2-5-flash",
|
|
3662
3918
|
])
|
|
3663
3919
|
|
|
3664
3920
|
/**
|
|
@@ -3969,6 +4225,8 @@ export const VIDEO_AUDIO_CAPABILITY: Record<string, VideoAudioCapability> = {
|
|
|
3969
4225
|
// on KIE and is cost-affecting only through the -ref/no-ref rate split,
|
|
3970
4226
|
// which the resolution+ref composite already carries (no `:audio` suffix).
|
|
3971
4227
|
"seedance-2-5": { mode: "audio_driven", field: "generateAudio", defaultOn: true },
|
|
4228
|
+
// Seedance 2.5 Flash — the same lever, default TRUE on KIE.
|
|
4229
|
+
"seedance-2-5-flash": { mode: "audio_driven", field: "generateAudio", defaultOn: true },
|
|
3972
4230
|
// MiniMax Hailuo 3 — multimodal; lip-syncs to reference audio (r2v). The
|
|
3973
4231
|
// KIE API exposes NO audio on/off parameter (audio is always produced), so
|
|
3974
4232
|
// there is no toggle field — alwaysOn, like VEO.
|
|
@@ -4193,6 +4451,7 @@ export const VIDEO_VARIABLE_PRICING: Record<string, "duration" | "duration+audio
|
|
|
4193
4451
|
"seedance-2-fast": "duration+resolution+ref",
|
|
4194
4452
|
"seedance-2-mini": "duration+resolution+ref",
|
|
4195
4453
|
"seedance-2-5": "duration+resolution+ref",
|
|
4454
|
+
"seedance-2-5-flash": "duration+resolution+ref",
|
|
4196
4455
|
// MiniMax Hailuo 3 — per-second rate at two resolution tiers (2K default /
|
|
4197
4456
|
// 768P). Duration + resolution form the composite (bare = 2K, ":768p"
|
|
4198
4457
|
// appended for the cheaper tier); ref-video input seconds + extra input
|
|
@@ -4482,6 +4741,8 @@ export function maxVideoDurationSec(provider: string): number | undefined {
|
|
|
4482
4741
|
export const PRICING_DEFAULT_RESOLUTION: Record<string, string> = {
|
|
4483
4742
|
// KIE renders 720p when `resolution` is omitted (kie/models.ts extraParams).
|
|
4484
4743
|
"seedance-2-5": "720p",
|
|
4744
|
+
// Seedance 2.5 Flash — KIE's documented default is 720p too (kie/models.ts extraParams).
|
|
4745
|
+
"seedance-2-5-flash": "720p",
|
|
4485
4746
|
// Wan 3.0 family — KIE's OWN default is 1080P, but the provider layer pins
|
|
4486
4747
|
// 720P (normalizeWan3Resolution / WAN_3_DEFAULT_RESOLUTION) so the rendered
|
|
4487
4748
|
// tier equals the tier the bare identifier bills. This declaration is what
|
|
@@ -4665,6 +4926,8 @@ export const VIDEO_DURATION_TIERS: Record<string, Array<{ maxSeconds: number; su
|
|
|
4665
4926
|
{ maxSeconds: 15, suffix: "15s" },
|
|
4666
4927
|
],
|
|
4667
4928
|
"seedance-2-5": SEEDANCE_2_5_DURATION_TIERS,
|
|
4929
|
+
// Seedance 2.5 Flash — the same 4-30s, one tier per second.
|
|
4930
|
+
"seedance-2-5-flash": SEEDANCE_2_5_DURATION_TIERS,
|
|
4668
4931
|
"wan-3": WAN_3_DURATION_TIERS,
|
|
4669
4932
|
"wan-3-prime": WAN_3_DURATION_TIERS,
|
|
4670
4933
|
"vidu-q4": VIDU_Q4_DURATION_TIERS,
|
|
@@ -210,6 +210,8 @@ const QUALITY_MAP: Record<string, QualityMapping> = {
|
|
|
210
210
|
// Seedance 2.5 spans 480p/720p/1080p on KIE (1080p accepted since the
|
|
211
211
|
// 2026-08-17 re-probe; 4k still rejected), so each quality rung gets its own tier.
|
|
212
212
|
"seedance-2-5": { field: "resolution", values: { low: "480p", mid: "720p", high: "1080p" } },
|
|
213
|
+
// Seedance 2.5 Flash — 480p / 720p only, so "high" stays at 720p.
|
|
214
|
+
"seedance-2-5-flash": { field: "resolution", values: { low: "480p", mid: "720p", high: "720p" } },
|
|
213
215
|
// Wan 3.0 family — 480p / 720p / 1080p (lowercase catalog spellings; the
|
|
214
216
|
// uppercase KIE wire form is produced only by normalizeWan3Resolution).
|
|
215
217
|
"wan-3": { field: "resolution", values: { low: "480p", mid: "720p", high: "1080p" } },
|
package/src/node-runtime-keys.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SUNO_SEPARATE_META_FIELDS, SUNO_SEPARATE_RESULT_FIELDS } from "./suno-separate.js"
|
|
1
|
+
import { SUNO_SEPARATE_ID_FIELDS, SUNO_SEPARATE_META_FIELDS, SUNO_SEPARATE_RESULT_FIELDS } from "./suno-separate.js"
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Field names on a node's `data` that hold runtime / result / transient execution
|
|
@@ -203,7 +203,7 @@ export const NODE_TYPE_EXECUTION_DATA_KEYS: Readonly<Record<string, readonly str
|
|
|
203
203
|
"ugc-clips": ["ugcOutputs", "quote"],
|
|
204
204
|
"ugc-clip": ["ugcOutputs", "clipWarnings", "durationSec", "rerenderPending"],
|
|
205
205
|
"ugc-cards": ["ugcOutputs"],
|
|
206
|
-
"suno-separate": [...SUNO_SEPARATE_RESULT_FIELDS, ...SUNO_SEPARATE_META_FIELDS.filter((key) => key !== "stemName")],
|
|
206
|
+
"suno-separate": [...SUNO_SEPARATE_RESULT_FIELDS, ...SUNO_SEPARATE_META_FIELDS.filter((key) => key !== "stemName"), ...SUNO_SEPARATE_ID_FIELDS],
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
/** Is `key` execution data (run state or a run's result) on a node of `type`: global, or that type's own? */
|