@nodaro/shared 3.63.0 → 3.65.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-3K24DWOH.js → chunk-222QM7CO.js} +3 -3
- package/dist/{chunk-3K24DWOH.js.map → chunk-222QM7CO.js.map} +1 -1
- package/dist/chunk-27HA6YOL.cjs +377 -0
- package/dist/chunk-27HA6YOL.cjs.map +1 -0
- package/dist/{chunk-4DVWXEB6.js → chunk-2NKF476Z.js} +3 -3
- package/dist/{chunk-4DVWXEB6.js.map → chunk-2NKF476Z.js.map} +1 -1
- package/dist/chunk-3AU52TSW.js +143 -0
- package/dist/chunk-3AU52TSW.js.map +1 -0
- package/dist/{chunk-F6WGGYQW.cjs → chunk-5NVGKXJV.cjs} +68 -29
- package/dist/chunk-5NVGKXJV.cjs.map +1 -0
- package/dist/{chunk-HWQ2SYNA.js → chunk-5SSMPYE5.js} +99 -9
- package/dist/chunk-5SSMPYE5.js.map +1 -0
- package/dist/{chunk-WRSWH7US.cjs → chunk-6BRWPJPP.cjs} +17 -2
- package/dist/chunk-6BRWPJPP.cjs.map +1 -0
- package/dist/{chunk-KHH54GRP.cjs → chunk-6ET3KDO4.cjs} +15 -338
- package/dist/chunk-6ET3KDO4.cjs.map +1 -0
- package/dist/{chunk-TM5JYSJF.cjs → chunk-6OSIOVF7.cjs} +98 -37
- package/dist/chunk-6OSIOVF7.cjs.map +1 -0
- package/dist/{chunk-YUER7TJG.js → chunk-6X5PBAC4.js} +13 -4
- package/dist/chunk-6X5PBAC4.js.map +1 -0
- package/dist/chunk-7BN4EDIC.cjs +185 -0
- package/dist/chunk-7BN4EDIC.cjs.map +1 -0
- package/dist/{chunk-6M563QE6.js → chunk-7OWXHW7Z.js} +78 -28
- package/dist/chunk-7OWXHW7Z.js.map +1 -0
- package/dist/{chunk-FXGNRYQQ.js → chunk-AT53ZQUC.js} +3 -3
- package/dist/{chunk-FXGNRYQQ.js.map → chunk-AT53ZQUC.js.map} +1 -1
- package/dist/{chunk-HSHCCBIV.js → chunk-BQYCZLMF.js} +16 -3
- package/dist/chunk-BQYCZLMF.js.map +1 -0
- package/dist/{chunk-34QLPTSA.js → chunk-BSTAAGLY.js} +3 -3
- package/dist/{chunk-34QLPTSA.js.map → chunk-BSTAAGLY.js.map} +1 -1
- package/dist/{chunk-PSKZKLDG.js → chunk-CW6MMQNO.js} +562 -26
- package/dist/chunk-CW6MMQNO.js.map +1 -0
- package/dist/{chunk-EPXGG27L.js → chunk-D5Y3EYRM.js} +5 -5
- package/dist/{chunk-EPXGG27L.js.map → chunk-D5Y3EYRM.js.map} +1 -1
- package/dist/{chunk-XGVJGNZW.cjs → chunk-DQ2PARNH.cjs} +15 -5
- package/dist/chunk-DQ2PARNH.cjs.map +1 -0
- package/dist/{chunk-6BZC2ZHC.cjs → chunk-E66HSC2E.cjs} +9 -9
- package/dist/{chunk-6BZC2ZHC.cjs.map → chunk-E66HSC2E.cjs.map} +1 -1
- package/dist/{chunk-NIAFR5EE.js → chunk-FGBGKBML.js} +32 -3
- package/dist/chunk-FGBGKBML.js.map +1 -0
- package/dist/{chunk-M5OCFGHF.cjs → chunk-FI3HJZWM.cjs} +588 -25
- package/dist/chunk-FI3HJZWM.cjs.map +1 -0
- package/dist/{chunk-L2TVY6XN.cjs → chunk-FJZTQTF4.cjs} +4 -4
- package/dist/{chunk-L2TVY6XN.cjs.map → chunk-FJZTQTF4.cjs.map} +1 -1
- package/dist/{chunk-XGGZWA4A.cjs → chunk-GJ3D5X4X.cjs} +52 -49
- package/dist/chunk-GJ3D5X4X.cjs.map +1 -0
- package/dist/{chunk-Q6IES3U2.js → chunk-H5KHWTAE.js} +5 -2
- package/dist/chunk-H5KHWTAE.js.map +1 -0
- package/dist/{chunk-MD4XHED4.js → chunk-H745DQ6V.js} +3 -3
- package/dist/{chunk-MD4XHED4.js.map → chunk-H745DQ6V.js.map} +1 -1
- package/dist/{chunk-KCZHQH2O.js → chunk-HAH2F7LT.js} +4 -4
- package/dist/{chunk-KCZHQH2O.js.map → chunk-HAH2F7LT.js.map} +1 -1
- package/dist/{chunk-V5EEQR2U.cjs → chunk-JQMFJAYU.cjs} +21 -21
- package/dist/{chunk-V5EEQR2U.cjs.map → chunk-JQMFJAYU.cjs.map} +1 -1
- package/dist/{chunk-WZVIBAKN.cjs → chunk-JYU5EIRM.cjs} +12 -12
- package/dist/{chunk-WZVIBAKN.cjs.map → chunk-JYU5EIRM.cjs.map} +1 -1
- package/dist/{chunk-Y35JQPT6.cjs → chunk-K6RIN3LW.cjs} +142 -45
- package/dist/chunk-K6RIN3LW.cjs.map +1 -0
- package/dist/{chunk-BLJUCPMV.cjs → chunk-KSHAAPQF.cjs} +5 -2
- package/dist/chunk-KSHAAPQF.cjs.map +1 -0
- package/dist/{chunk-2PU3AGGS.cjs → chunk-KTCEKGBJ.cjs} +7 -7
- package/dist/{chunk-2PU3AGGS.cjs.map → chunk-KTCEKGBJ.cjs.map} +1 -1
- package/dist/{chunk-LH72PQO2.cjs → chunk-KWYS4IIM.cjs} +165 -50
- package/dist/chunk-KWYS4IIM.cjs.map +1 -0
- package/dist/{chunk-GSKLPI3J.cjs → chunk-MIT2USTS.cjs} +118 -61
- package/dist/chunk-MIT2USTS.cjs.map +1 -0
- package/dist/{chunk-Y4GCJJPF.cjs → chunk-NYZQOIXJ.cjs} +35 -2
- package/dist/chunk-NYZQOIXJ.cjs.map +1 -0
- package/dist/{chunk-A2PX5IRC.cjs → chunk-PERUFUVH.cjs} +13 -13
- package/dist/{chunk-A2PX5IRC.cjs.map → chunk-PERUFUVH.cjs.map} +1 -1
- package/dist/{chunk-X5BAFW3Q.cjs → chunk-PGDR7CO3.cjs} +8 -8
- package/dist/{chunk-X5BAFW3Q.cjs.map → chunk-PGDR7CO3.cjs.map} +1 -1
- package/dist/{chunk-OV3JTKBY.js → chunk-PL7AQQV7.js} +123 -22
- package/dist/chunk-PL7AQQV7.js.map +1 -0
- package/dist/chunk-Q4YOLT4M.js +164 -0
- package/dist/chunk-Q4YOLT4M.js.map +1 -0
- package/dist/{chunk-GMBDLNLD.cjs → chunk-R5ILCNCC.cjs} +197 -60
- package/dist/chunk-R5ILCNCC.cjs.map +1 -0
- package/dist/chunk-RP4KQUNU.cjs +168 -0
- package/dist/chunk-RP4KQUNU.cjs.map +1 -0
- package/dist/{chunk-77WU3V3J.cjs → chunk-SPU7MUWE.cjs} +6 -6
- package/dist/{chunk-77WU3V3J.cjs.map → chunk-SPU7MUWE.cjs.map} +1 -1
- package/dist/{chunk-XBTYGQ6Z.js → chunk-ST7OBB5J.js} +8 -5
- package/dist/chunk-ST7OBB5J.js.map +1 -0
- package/dist/{chunk-2QKF7M2Z.js → chunk-TAPBDT47.js} +3 -3
- package/dist/{chunk-2QKF7M2Z.js.map → chunk-TAPBDT47.js.map} +1 -1
- package/dist/{chunk-BMJVKYVB.js → chunk-V5NLQ4L5.js} +123 -7
- package/dist/chunk-V5NLQ4L5.js.map +1 -0
- package/dist/{chunk-KMGCHV6O.js → chunk-V6OXSXIX.js} +63 -30
- package/dist/chunk-V6OXSXIX.js.map +1 -0
- package/dist/{chunk-LMAQUR55.cjs → chunk-WQMPIURW.cjs} +6 -6
- package/dist/{chunk-LMAQUR55.cjs.map → chunk-WQMPIURW.cjs.map} +1 -1
- package/dist/{chunk-ZPE2ZTJ4.cjs → chunk-WZG6GZIL.cjs} +4 -4
- package/dist/{chunk-ZPE2ZTJ4.cjs.map → chunk-WZG6GZIL.cjs.map} +1 -1
- package/dist/{chunk-AE3AAJ4O.js → chunk-XJANKTIL.js} +3 -3
- package/dist/{chunk-AE3AAJ4O.js.map → chunk-XJANKTIL.js.map} +1 -1
- package/dist/{chunk-O7RZRUMZ.js → chunk-XJWED257.js} +14 -309
- package/dist/chunk-XJWED257.js.map +1 -0
- package/dist/chunk-XSSLNINL.js +346 -0
- package/dist/chunk-XSSLNINL.js.map +1 -0
- package/dist/{chunk-6TGB7ECA.cjs → chunk-YD4XY74W.cjs} +12 -8
- package/dist/chunk-YD4XY74W.cjs.map +1 -0
- package/dist/{chunk-YX6TFX7H.js → chunk-YMZUE2IX.js} +66 -11
- package/dist/chunk-YMZUE2IX.js.map +1 -0
- package/dist/{chunk-4MMZD63H.js → chunk-Z77M7Q2R.js} +3 -3
- package/dist/{chunk-4MMZD63H.js.map → chunk-Z77M7Q2R.js.map} +1 -1
- package/dist/{chunk-CZ5IQB3L.js → chunk-ZSRXY5YT.js} +8 -5
- package/dist/chunk-ZSRXY5YT.js.map +1 -0
- package/dist/entries/apps.cjs +43 -42
- package/dist/entries/apps.js +8 -7
- package/dist/entries/captions.cjs +38 -30
- package/dist/entries/captions.d.cts +48 -2
- package/dist/entries/captions.d.ts +48 -2
- package/dist/entries/captions.js +1 -1
- package/dist/entries/credits.cjs +319 -191
- package/dist/entries/credits.d.cts +260 -19
- package/dist/entries/credits.d.ts +260 -19
- package/dist/entries/credits.js +11 -11
- package/dist/entries/entities.cjs +202 -193
- package/dist/entries/entities.d.cts +44 -9
- package/dist/entries/entities.d.ts +44 -9
- package/dist/entries/entities.js +2 -1
- package/dist/entries/llm-models.cjs +86 -62
- package/dist/entries/llm-models.d.cts +73 -20
- package/dist/entries/llm-models.d.ts +73 -20
- package/dist/entries/llm-models.js +2 -2
- package/dist/entries/media.cjs +79 -63
- package/dist/entries/media.d.cts +154 -1
- package/dist/entries/media.d.ts +154 -1
- package/dist/entries/media.js +1 -1
- package/dist/entries/model-catalog.cjs +205 -109
- package/dist/entries/model-catalog.d.cts +65 -58
- package/dist/entries/model-catalog.d.ts +65 -58
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +527 -346
- package/dist/entries/models.d.cts +86 -7
- package/dist/entries/models.d.ts +86 -7
- package/dist/entries/models.js +6 -5
- package/dist/entries/nodes.cjs +220 -211
- package/dist/entries/nodes.d.cts +46 -3
- package/dist/entries/nodes.d.ts +46 -3
- package/dist/entries/nodes.js +10 -9
- package/dist/entries/pipeline.cjs +156 -152
- package/dist/entries/pipeline.d.cts +14 -4
- package/dist/entries/pipeline.d.ts +14 -4
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/social.cjs +177 -177
- 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 +174 -145
- package/dist/entries/video.d.cts +114 -2
- package/dist/entries/video.d.ts +114 -2
- package/dist/entries/video.js +7 -6
- package/dist/entries/workflow.cjs +150 -150
- package/dist/entries/workflow.d.cts +1 -1
- package/dist/entries/workflow.d.ts +1 -1
- package/dist/entries/workflow.js +2 -2
- package/dist/index.cjs +2430 -1929
- package/dist/index.d.cts +13 -12
- package/dist/index.d.ts +13 -12
- package/dist/index.js +28 -27
- package/dist/{model-catalog-C_Eo35tL.d.cts → model-catalog-BoUKGFNl.d.cts} +182 -3
- package/dist/{model-catalog-C_Eo35tL.d.ts → model-catalog-BoUKGFNl.d.ts} +182 -3
- package/dist/{model-constants-DWcxOmaY.d.cts → model-constants-BElS3AeE.d.ts} +142 -23
- package/dist/{model-constants-Bg4ccSQb.d.ts → model-constants-CpQz1bGa.d.cts} +142 -23
- package/dist/tts-capabilities-BtnDWK9K.d.ts +133 -0
- package/dist/tts-capabilities-C52UccTI.d.cts +133 -0
- package/package.json +1 -1
- package/src/__tests__/add-captions-nemotron-pricing.test.ts +111 -0
- package/src/__tests__/dialogue-capabilities.test.ts +167 -6
- package/src/__tests__/extend-providers.test.ts +353 -26
- package/src/__tests__/fixtures/mask-composite-quote-parity.json +1 -1
- package/src/__tests__/fixtures/measured-input-quote-parity.json +1435 -0
- package/src/__tests__/fixtures/planned-length-quote-parity.json +1866 -0
- package/src/__tests__/fixtures/video-utility-quote-parity.json +2343 -0
- package/src/__tests__/flux-3-klein.test.ts +203 -0
- package/src/__tests__/gpt-image-2-6-formats.test.ts +3 -1
- package/src/__tests__/kling4-catalog.test.ts +1 -1
- package/src/__tests__/llm-models.test.ts +48 -13
- package/src/__tests__/llm-price-key.test.ts +12 -0
- package/src/__tests__/model-makers.test.ts +3 -0
- package/src/__tests__/node-runtime-keys.test.ts +7 -0
- package/src/__tests__/normalize-node-params.test.ts +147 -1
- package/src/__tests__/retired-lip-sync-providers.test.ts +43 -0
- package/src/__tests__/seedance-extend-source-credit-id.test.ts +89 -0
- package/src/__tests__/sequence-execution.test.ts +22 -1
- package/src/__tests__/speech-pricing.test.ts +62 -1
- package/src/__tests__/suno-credit-type.test.ts +21 -2
- package/src/__tests__/transcribe-capabilities.test.ts +4 -2
- package/src/__tests__/tts-capabilities.test.ts +160 -4
- package/src/__tests__/video-analysis-catalog-sync.test.ts +4 -2
- package/src/__tests__/video-analysis-pricing.test.ts +22 -9
- package/src/__tests__/video-subjects.test.ts +192 -0
- package/src/__tests__/wired-character-names.test.ts +142 -0
- package/src/caption-styles.ts +62 -0
- package/src/credit-estimators/add-captions-nemotron.ts +73 -0
- package/src/credit-estimators/index.ts +14 -0
- package/src/credit-estimators/speech.ts +57 -9
- package/src/credit-identifiers.ts +284 -13
- package/src/dialogue-capabilities.ts +220 -3
- package/src/dubbing-structure.ts +186 -0
- package/src/entries/captions.ts +2 -0
- package/src/entries/credits.ts +25 -1
- package/src/entries/entities.ts +2 -0
- package/src/entries/llm-models.ts +7 -0
- package/src/entries/media.ts +3 -1
- package/src/entries/model-catalog.ts +30 -0
- package/src/entries/models.ts +54 -0
- package/src/entries/nodes.ts +2 -0
- package/src/entries/pipeline.ts +1 -1
- package/src/entries/video.ts +8 -1
- package/src/flux-3-klein.ts +69 -0
- package/src/gemini-tts.ts +144 -0
- package/src/input-image-pricing.ts +23 -6
- package/src/llm-models.ts +130 -36
- package/src/model-catalog.ts +539 -25
- package/src/model-constants.ts +247 -25
- package/src/node-default-mappings.ts +3 -0
- package/src/node-runtime-keys.ts +3 -0
- package/src/normalize-node-params.ts +123 -2
- package/src/seedance-extend-rate.ts +116 -0
- package/src/sequence-execution.ts +24 -0
- package/src/transcribe-preflight.ts +23 -0
- package/src/tts-capabilities.ts +193 -1
- package/src/video-analysis-pricing.ts +39 -15
- package/src/video-character-refs.ts +160 -3
- package/src/wired-character-names.ts +134 -18
- package/src/wired-character-video-subjects.ts +63 -0
- package/dist/chunk-63H4C56Q.cjs +0 -38
- package/dist/chunk-63H4C56Q.cjs.map +0 -1
- package/dist/chunk-6M563QE6.js.map +0 -1
- package/dist/chunk-6TGB7ECA.cjs.map +0 -1
- package/dist/chunk-6XUG4L7X.cjs +0 -54
- package/dist/chunk-6XUG4L7X.cjs.map +0 -1
- package/dist/chunk-BLJUCPMV.cjs.map +0 -1
- package/dist/chunk-BMJVKYVB.js.map +0 -1
- package/dist/chunk-CZ5IQB3L.js.map +0 -1
- package/dist/chunk-F6WGGYQW.cjs.map +0 -1
- package/dist/chunk-GMBDLNLD.cjs.map +0 -1
- package/dist/chunk-GSKLPI3J.cjs.map +0 -1
- package/dist/chunk-HBXF6RUU.js +0 -31
- package/dist/chunk-HBXF6RUU.js.map +0 -1
- package/dist/chunk-HSHCCBIV.js.map +0 -1
- package/dist/chunk-HWQ2SYNA.js.map +0 -1
- package/dist/chunk-IY3Y462W.js +0 -42
- package/dist/chunk-IY3Y462W.js.map +0 -1
- package/dist/chunk-KHH54GRP.cjs.map +0 -1
- package/dist/chunk-KMGCHV6O.js.map +0 -1
- package/dist/chunk-LH72PQO2.cjs.map +0 -1
- package/dist/chunk-M5OCFGHF.cjs.map +0 -1
- package/dist/chunk-NIAFR5EE.js.map +0 -1
- package/dist/chunk-O7RZRUMZ.js.map +0 -1
- package/dist/chunk-OV3JTKBY.js.map +0 -1
- package/dist/chunk-PSKZKLDG.js.map +0 -1
- package/dist/chunk-Q6IES3U2.js.map +0 -1
- package/dist/chunk-TM5JYSJF.cjs.map +0 -1
- package/dist/chunk-WRSWH7US.cjs.map +0 -1
- package/dist/chunk-XBTYGQ6Z.js.map +0 -1
- package/dist/chunk-XGGZWA4A.cjs.map +0 -1
- package/dist/chunk-XGVJGNZW.cjs.map +0 -1
- package/dist/chunk-Y35JQPT6.cjs.map +0 -1
- package/dist/chunk-Y4GCJJPF.cjs.map +0 -1
- package/dist/chunk-YUER7TJG.js.map +0 -1
- package/dist/chunk-YX6TFX7H.js.map +0 -1
package/src/model-constants.ts
CHANGED
|
@@ -188,7 +188,9 @@ export const MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER: Record<string, number> = {
|
|
|
188
188
|
// docs.kie.ai/market/minimax-h3/text-to-image + image-edit),
|
|
189
189
|
// seedream-5-5, seedream-5-5-i2i (both "5–5000 characters"; the minimum is
|
|
190
190
|
// MIN_IMAGE_PROMPT_CHARS_BY_PROVIDER below;
|
|
191
|
-
// docs.kie.ai/market/seedream/5-5-text-to-image + 5-5-image-to-image)
|
|
191
|
+
// docs.kie.ai/market/seedream/5-5-text-to-image + 5-5-image-to-image),
|
|
192
|
+
// flux-3-klein, flux-3-klein-i2i (both "1–5000 characters";
|
|
193
|
+
// docs.kie.ai/market/flux3/klein-text-to-image + klein-edit-image).
|
|
192
194
|
// grok-i2i: doc states 390000 (78× its t2i sibling) — treated as a KIE schema
|
|
193
195
|
// typo and left at the 5000 default per the sanity-cap decision.
|
|
194
196
|
// UNVERIFIED (no limit stated in schema) → 5000 default: flux-kontext(-max)
|
|
@@ -370,6 +372,9 @@ export const MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER: Record<string, number> = {
|
|
|
370
372
|
// PixVerse V6 Max — 1-5000 chars on both endpoints
|
|
371
373
|
// (docs.kie.ai/market/pixverse/v6-max-text-to-video and /v6-max-image-to-video).
|
|
372
374
|
"pixverse-v6-max": 5000,
|
|
375
|
+
// PixVerse V6 Extend — 3-5000 chars (docs.kie.ai/market/pixverse/extend);
|
|
376
|
+
// its prompt is sent as written, so the whole cap is the user's.
|
|
377
|
+
"pixverse-v6-extend": 5000,
|
|
373
378
|
"bytedance-lite": 10000,
|
|
374
379
|
"bytedance-pro": 10000,
|
|
375
380
|
"bytedance-pro-fast": 10000,
|
|
@@ -663,6 +668,7 @@ export const MODELS_WITH_REFERENCE_IMAGE_SUPPORT = new Set([
|
|
|
663
668
|
"seedream-5-5",
|
|
664
669
|
"flux",
|
|
665
670
|
"flux-flex",
|
|
671
|
+
"flux-3-klein",
|
|
666
672
|
// Image editing / image-to-image (reference = source image)
|
|
667
673
|
"nano-banana-edit",
|
|
668
674
|
"gpt-image-i2i",
|
|
@@ -687,6 +693,7 @@ export const MODELS_WITH_REFERENCE_IMAGE_SUPPORT = new Set([
|
|
|
687
693
|
"seedream-5-flash-i2i",
|
|
688
694
|
"minimax-h3-image-i2i",
|
|
689
695
|
"seedream-5-5-i2i",
|
|
696
|
+
"flux-3-klein-i2i",
|
|
690
697
|
"grok-i2i",
|
|
691
698
|
// Upscale / background ops (source acts as the reference)
|
|
692
699
|
"recraft-remove-bg",
|
|
@@ -734,6 +741,9 @@ export const T2I_TO_I2I_VARIANT: Record<string, string> = {
|
|
|
734
741
|
"seedream-5-5": "seedream-5-5-i2i",
|
|
735
742
|
"flux": "flux-pro-i2i",
|
|
736
743
|
"flux-flex": "flux-i2i",
|
|
744
|
+
// FLUX 3 Klein's text-to-image endpoint takes no image at all: its edit
|
|
745
|
+
// endpoint reads them (the provider swaps too).
|
|
746
|
+
"flux-3-klein": "flux-3-klein-i2i",
|
|
737
747
|
}
|
|
738
748
|
|
|
739
749
|
/**
|
|
@@ -776,6 +786,8 @@ export const REF_IMAGE_MAX_LIMITS: Record<string, number> = {
|
|
|
776
786
|
"minimax-h3-image-i2i": 16,
|
|
777
787
|
// Seedream 5.5 takes 1–10 `image_urls` (docs.kie.ai/market/seedream/5-5-image-to-image).
|
|
778
788
|
"seedream-5-5-i2i": 10,
|
|
789
|
+
// FLUX 3 Klein's edit takes 1–10 `image_urls` (docs.kie.ai/market/flux3/klein-edit-image).
|
|
790
|
+
"flux-3-klein-i2i": 10,
|
|
779
791
|
// Single-source i2i (one input image)
|
|
780
792
|
"flux-kontext": 1,
|
|
781
793
|
"flux-kontext-max": 1,
|
|
@@ -839,8 +851,8 @@ export const DEFAULT_REQUEST_IMAGE_LIMIT = 14
|
|
|
839
851
|
* {@link DEFAULT_REQUEST_IMAGE_LIMIT}. Separate from
|
|
840
852
|
* {@link REF_IMAGE_MAX_LIMITS}, the cap the canvas and the assembler honour: the
|
|
841
853
|
* routes have their own ceiling, and it moves per model only here. GPT Image
|
|
842
|
-
* 2.6 takes more; a model
|
|
843
|
-
*
|
|
854
|
+
* 2.6 takes more; a model whose provider takes fewer (Seedream 5.5 and FLUX 3
|
|
855
|
+
* Klein: 10) is held to its own, so a request is refused before it is
|
|
844
856
|
* reserved instead of failing at the provider.
|
|
845
857
|
*/
|
|
846
858
|
const REQUEST_IMAGE_LIMITS: Record<string, number> = {
|
|
@@ -848,6 +860,7 @@ const REQUEST_IMAGE_LIMITS: Record<string, number> = {
|
|
|
848
860
|
"gpt-image-2-6-sunburst-i2i": 16,
|
|
849
861
|
"minimax-h3-image-i2i": 16,
|
|
850
862
|
"seedream-5-5-i2i": 10,
|
|
863
|
+
"flux-3-klein-i2i": 10,
|
|
851
864
|
}
|
|
852
865
|
|
|
853
866
|
/** The largest per-model limit: the outer bound of the routes' array schemas. */
|
|
@@ -896,6 +909,9 @@ export const VARIABLE_PRICING_MODELS: Record<string, "quality" | "resolution" |
|
|
|
896
909
|
// Also priced per reference image on an edit (`minimaxH3ImageCreditId`).
|
|
897
910
|
"minimax-h3-image": "resolution",
|
|
898
911
|
"minimax-h3-image-i2i": "resolution",
|
|
912
|
+
// By size alone, the same on both ids (`flux3KleinCreditId`).
|
|
913
|
+
"flux-3-klein": "resolution",
|
|
914
|
+
"flux-3-klein-i2i": "resolution",
|
|
899
915
|
}
|
|
900
916
|
|
|
901
917
|
|
|
@@ -962,6 +978,7 @@ export const IMAGE_GEN_PROVIDERS = [
|
|
|
962
978
|
"flux-flex",
|
|
963
979
|
"flux-kontext",
|
|
964
980
|
"flux-kontext-max",
|
|
981
|
+
"flux-3-klein",
|
|
965
982
|
"z-image",
|
|
966
983
|
"wan-2.7",
|
|
967
984
|
"wan-2.7-pro",
|
|
@@ -1001,6 +1018,7 @@ export const IMAGE_I2I_PROVIDERS = [
|
|
|
1001
1018
|
"seedream-5-5-i2i",
|
|
1002
1019
|
"flux-kontext",
|
|
1003
1020
|
"flux-kontext-max",
|
|
1021
|
+
"flux-3-klein-i2i",
|
|
1004
1022
|
// Replicate Open (uncensored) — multi-image Kontext via Replicate
|
|
1005
1023
|
"kontext-multi",
|
|
1006
1024
|
// BFL Flux 2 Pro — runs through Replicate
|
|
@@ -1529,6 +1547,14 @@ export const EXTEND_VIDEO_PROVIDERS = [
|
|
|
1529
1547
|
// Kling 4 extends ANY video the same way (3–30 s added, 720p / 1080p, its
|
|
1530
1548
|
// sound always on), generated on Kling 4.0 and priced on its own rows.
|
|
1531
1549
|
"kling-4-extend",
|
|
1550
|
+
// PixVerse V6 extends ANY video natively (1–15 s added, 360p–1080p, a sound
|
|
1551
|
+
// switch): the whole source goes in and comes back with the new seconds
|
|
1552
|
+
// joined on, of which only the new ones are kept. Priced on its own rows.
|
|
1553
|
+
"pixverse-v6-extend",
|
|
1554
|
+
// Grok extends only its OWN clips (a Grok Imagine text-to-video or
|
|
1555
|
+
// image-to-video run of the same user), named by their task: 6 or 10 s
|
|
1556
|
+
// added at the source's resolution, delivered as Grok returns it.
|
|
1557
|
+
"grok-extend",
|
|
1532
1558
|
] as const
|
|
1533
1559
|
export type ExtendVideoProvider = typeof EXTEND_VIDEO_PROVIDERS[number]
|
|
1534
1560
|
|
|
@@ -1565,6 +1591,71 @@ export function isTailExtendProvider(p: unknown): p is TailExtendProvider {
|
|
|
1565
1591
|
return typeof p === "string" && (TAIL_EXTEND_PROVIDERS as readonly string[]).includes(p)
|
|
1566
1592
|
}
|
|
1567
1593
|
|
|
1594
|
+
/**
|
|
1595
|
+
* PixVerse V6 Extend: a native extend, no tail recipe. The whole source goes
|
|
1596
|
+
* to PixVerse's own extend, which returns it with the new seconds joined on;
|
|
1597
|
+
* the run keeps the user's source and joins only the new seconds to it.
|
|
1598
|
+
*/
|
|
1599
|
+
export type PixverseExtendProvider = Extract<ExtendVideoProvider, "pixverse-v6-extend">
|
|
1600
|
+
export const PIXVERSE_V6_EXTEND_PROVIDER: PixverseExtendProvider = "pixverse-v6-extend"
|
|
1601
|
+
|
|
1602
|
+
/** Whether a value is {@link PIXVERSE_V6_EXTEND_PROVIDER}. */
|
|
1603
|
+
export function isPixverseExtendProvider(p: unknown): p is PixverseExtendProvider {
|
|
1604
|
+
return p === PIXVERSE_V6_EXTEND_PROVIDER
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
/**
|
|
1608
|
+
* The Extend Video providers whose levers come from their own catalog entry —
|
|
1609
|
+
* the seconds added (`durations`, `defaultDuration`) and the resolution
|
|
1610
|
+
* (`resolutions`) — and which are priced one row per second added and
|
|
1611
|
+
* resolution (`catalogExtendCreditId`): the tail recipes
|
|
1612
|
+
* ({@link TailExtendProvider}) and PixVerse V6. Each extends any video by URL.
|
|
1613
|
+
* A retired id answers false: pass it through {@link canonicalVideoProvider} first.
|
|
1614
|
+
*/
|
|
1615
|
+
export type CatalogExtendProvider = TailExtendProvider | PixverseExtendProvider
|
|
1616
|
+
|
|
1617
|
+
/** Whether a value is a {@link CatalogExtendProvider}. */
|
|
1618
|
+
export function isCatalogExtendProvider(p: unknown): p is CatalogExtendProvider {
|
|
1619
|
+
return isTailExtendProvider(p) || isPixverseExtendProvider(p)
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
/**
|
|
1623
|
+
* Whether an Extend Video provider has a sound switch (`generateAudio`, on
|
|
1624
|
+
* unless turned off): Seedance's, which continue the soundtrack, and PixVerse
|
|
1625
|
+
* V6's, whose sound is priced on its own rows. Kling 4's sound is always on.
|
|
1626
|
+
*/
|
|
1627
|
+
export function extendHasSoundSwitch(p: unknown): boolean {
|
|
1628
|
+
return isSeedanceExtendProvider(p) || isPixverseExtendProvider(p)
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
/**
|
|
1632
|
+
* Grok Extend: a native extend of Grok's OWN clips only — a completed Grok
|
|
1633
|
+
* Imagine text-to-video or image-to-video run of the same user, named by its
|
|
1634
|
+
* task (the upstream node hands it on, as VEO's extend takes its own). It adds
|
|
1635
|
+
* 6 or 10 s at the SOURCE's resolution, which is never a lever: so it is no
|
|
1636
|
+
* {@link CatalogExtendProvider}, and is priced by `grokExtendCreditId` on the
|
|
1637
|
+
* resolution the source check answers.
|
|
1638
|
+
*/
|
|
1639
|
+
export type GrokExtendProvider = Extract<ExtendVideoProvider, "grok-extend">
|
|
1640
|
+
export const GROK_EXTEND_PROVIDER: GrokExtendProvider = "grok-extend"
|
|
1641
|
+
|
|
1642
|
+
/** Whether a value is {@link GROK_EXTEND_PROVIDER}. */
|
|
1643
|
+
export function isGrokExtendProvider(p: unknown): p is GrokExtendProvider {
|
|
1644
|
+
return p === GROK_EXTEND_PROVIDER
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
/**
|
|
1648
|
+
* The Grok Imagine video models whose clips Grok Extend can extend: text-to-
|
|
1649
|
+
* video's id and image-to-video's (not Grok Imagine Video 1.5, a different
|
|
1650
|
+
* model on the provider's side).
|
|
1651
|
+
*/
|
|
1652
|
+
export const GROK_EXTEND_SOURCE_MODELS = ["grok", "grok-i2v"] as const
|
|
1653
|
+
|
|
1654
|
+
/** Whether a model is one of {@link GROK_EXTEND_SOURCE_MODELS}. */
|
|
1655
|
+
export function isGrokExtendSourceModel(p: unknown): boolean {
|
|
1656
|
+
return typeof p === "string" && (GROK_EXTEND_SOURCE_MODELS as readonly string[]).includes(p)
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1568
1659
|
/** Lip sync providers */
|
|
1569
1660
|
export const LIP_SYNC_PROVIDERS = [
|
|
1570
1661
|
"kling-avatar",
|
|
@@ -1580,9 +1671,8 @@ export const LIP_SYNC_PROVIDERS = [
|
|
|
1580
1671
|
// (LIP_SYNC_AUDIO_RATES), never by bucket.
|
|
1581
1672
|
"omnihuman-2-0",
|
|
1582
1673
|
"latentsync",
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
"sadtalker",
|
|
1674
|
+
// (Wav2Lip, VideoReTalking and SadTalker were retired 2026-11-12:
|
|
1675
|
+
// RETIRED_LIP_SYNC_PROVIDERS below.)
|
|
1586
1676
|
// HeyGen Lipsync Precision + Sync Lipsync 2 Pro — Replicate-hosted, video-input
|
|
1587
1677
|
// dubbing models billed per second of output. Routed through replicateLipSync;
|
|
1588
1678
|
// priced per-second via buildLipSyncCreditId (see lip-sync-pricing.ts).
|
|
@@ -1614,6 +1704,34 @@ export const LIP_SYNC_PROVIDERS = [
|
|
|
1614
1704
|
] as const
|
|
1615
1705
|
export type LipSyncProvider = typeof LIP_SYNC_PROVIDERS[number]
|
|
1616
1706
|
|
|
1707
|
+
/**
|
|
1708
|
+
* Lip Sync models the platform no longer offers (retired 2026-11-12), with the
|
|
1709
|
+
* name each is shown by. They left every menu, the route's accepted values and
|
|
1710
|
+
* the MCP tool; a request, a saved or imported workflow node or an app run that
|
|
1711
|
+
* still names one is refused before anything is reserved, with
|
|
1712
|
+
* {@link retiredLipSyncProviderMessage} — never moved to another model, whose
|
|
1713
|
+
* inputs and price differ. The editor shows a saved node on one as retired and
|
|
1714
|
+
* leaves the choice of another model to the person.
|
|
1715
|
+
*/
|
|
1716
|
+
export const RETIRED_LIP_SYNC_PROVIDERS: Readonly<Record<string, string>> = {
|
|
1717
|
+
wav2lip: "Wav2Lip",
|
|
1718
|
+
"video-retalking": "VideoReTalking",
|
|
1719
|
+
sadtalker: "SadTalker",
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
/** The name of a retired Lip Sync model, or undefined for any other value. Own keys only (the value is request input). */
|
|
1723
|
+
export function retiredLipSyncProviderName(provider: unknown): string | undefined {
|
|
1724
|
+
return typeof provider === "string" && Object.hasOwn(RETIRED_LIP_SYNC_PROVIDERS, provider)
|
|
1725
|
+
? RETIRED_LIP_SYNC_PROVIDERS[provider]
|
|
1726
|
+
: undefined
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
/** The refusal a run of a retired Lip Sync model gets, or undefined for any other value. */
|
|
1730
|
+
export function retiredLipSyncProviderMessage(provider: unknown): string | undefined {
|
|
1731
|
+
const name = retiredLipSyncProviderName(provider)
|
|
1732
|
+
return name === undefined ? undefined : `${name} is no longer available for Lip Sync. Pick another Lip Sync model.`
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1617
1735
|
/** Multimodal video models exposed via the lip-sync surface (Seedance 2 family
|
|
1618
1736
|
* + MiniMax Hailuo 3). They go through the i2v provider with the audio
|
|
1619
1737
|
* plumbed as `reference_audio_urls` rather than a dedicated lip-sync flow.
|
|
@@ -1626,12 +1744,10 @@ export const SEEDANCE_LIP_SYNC_PROVIDERS = new Set<string>([
|
|
|
1626
1744
|
"minimax-h3",
|
|
1627
1745
|
])
|
|
1628
1746
|
|
|
1629
|
-
/** Replicate-based lip-sync providers (video or image+audio via Replicate SDK)
|
|
1747
|
+
/** Replicate-based lip-sync providers (video or image+audio via Replicate SDK).
|
|
1748
|
+
* The retired ones ran there too (`RETIRED_LIP_SYNC_PROVIDERS`). */
|
|
1630
1749
|
export const REPLICATE_LIP_SYNC_PROVIDERS = new Set([
|
|
1631
1750
|
"latentsync",
|
|
1632
|
-
"wav2lip",
|
|
1633
|
-
"video-retalking",
|
|
1634
|
-
"sadtalker",
|
|
1635
1751
|
"heygen-lipsync-precision",
|
|
1636
1752
|
"lipsync-2-pro",
|
|
1637
1753
|
] as const)
|
|
@@ -1642,7 +1758,9 @@ export const FAL_LIP_SYNC_PROVIDERS = new Set([
|
|
|
1642
1758
|
"sync-lipsync-v3",
|
|
1643
1759
|
] as const)
|
|
1644
1760
|
|
|
1645
|
-
/** Lip-sync providers that require video input (not image)
|
|
1761
|
+
/** Lip-sync providers that require video input (not image). A retired id
|
|
1762
|
+
* stays in this set and the next: a saved node on it keeps the handles its
|
|
1763
|
+
* edges attach to until the person picks another model. */
|
|
1646
1764
|
export const VIDEO_INPUT_LIP_SYNC_PROVIDERS = new Set([
|
|
1647
1765
|
"latentsync",
|
|
1648
1766
|
"video-retalking",
|
|
@@ -1687,6 +1805,12 @@ export const TTS_PROVIDERS = [
|
|
|
1687
1805
|
"elevenlabs-v4-turbo",
|
|
1688
1806
|
"elevenlabs-turbo",
|
|
1689
1807
|
"elevenlabs-multilingual",
|
|
1808
|
+
// Google's Gemini speech through KIE (decided 2026-11-12): named voices of
|
|
1809
|
+
// their own (`TtsCapabilities.voices`), never ElevenLabs'.
|
|
1810
|
+
"gemini-3-8-flash-lite-tts",
|
|
1811
|
+
"gemini-3-8-flash-tts",
|
|
1812
|
+
"gemini-3-1-flash-tts",
|
|
1813
|
+
"gemini-2-5-pro-tts",
|
|
1690
1814
|
"elevenlabs",
|
|
1691
1815
|
] as const
|
|
1692
1816
|
export type TtsProvider = typeof TTS_PROVIDERS[number]
|
|
@@ -1713,10 +1837,20 @@ export const TTS_OUTPUT_FORMAT_FILES: Readonly<Record<TtsOutputFormat, { readonl
|
|
|
1713
1837
|
/**
|
|
1714
1838
|
* Text-to-dialogue models (the `provider` of `/v1/text-to-dialogue` and of the
|
|
1715
1839
|
* Text to Dialogue node). Each IS its catalog id and its credit identifier.
|
|
1716
|
-
*
|
|
1717
|
-
*
|
|
1718
|
-
|
|
1719
|
-
|
|
1840
|
+
* The ElevenLabs dialogue models are dialogue-only ids, never members of
|
|
1841
|
+
* TTS_PROVIDERS: their dialogue endpoint is its own model. Google's Gemini
|
|
1842
|
+
* models take one speaker and two under ONE id, so each is in both lists,
|
|
1843
|
+
* priced on its one row (dialogue costs what one speaker costs per character,
|
|
1844
|
+
* decided 2026-11-12); `dialogue-capabilities.test.ts` pins exactly that.
|
|
1845
|
+
*/
|
|
1846
|
+
export const DIALOGUE_PROVIDERS = [
|
|
1847
|
+
"elevenlabs-dialogue",
|
|
1848
|
+
"elevenlabs-dialogue-v4",
|
|
1849
|
+
"gemini-3-8-flash-lite-tts",
|
|
1850
|
+
"gemini-3-8-flash-tts",
|
|
1851
|
+
"gemini-3-1-flash-tts",
|
|
1852
|
+
"gemini-2-5-pro-tts",
|
|
1853
|
+
] as const
|
|
1720
1854
|
export type DialogueProvider = typeof DIALOGUE_PROVIDERS[number]
|
|
1721
1855
|
|
|
1722
1856
|
/** The model a dialogue request runs on when its provider is missing or unknown: v3 dialogue (decided 2026-10-04 — v3 stays the default). */
|
|
@@ -1835,17 +1969,19 @@ void _TRANSCRIBE_PROVIDERS_ARE_LANES
|
|
|
1835
1969
|
|
|
1836
1970
|
/**
|
|
1837
1971
|
* The lanes Add Captions may transcribe on (its `transcribe_provider`, on the
|
|
1838
|
-
* route, MCP `add_captions` and the SDK's `media.addCaptions`).
|
|
1839
|
-
*
|
|
1840
|
-
*
|
|
1841
|
-
*
|
|
1842
|
-
*
|
|
1843
|
-
*
|
|
1972
|
+
* route, MCP `add_captions` and the SDK's `media.addCaptions`). Its flat render
|
|
1973
|
+
* price (`add-captions:kinetic`) covers the transcription on every lane but
|
|
1974
|
+
* Nemotron 3.5 Transcribe, which is priced by the video's length: a caption
|
|
1975
|
+
* run on it holds the render plus Nemotron's per-minute price as ONE charge
|
|
1976
|
+
* (`add-captions:kinetic:nemotron:<N>m`, decided 2026-11-13), always with word
|
|
1977
|
+
* timings and never a translation. A new lane here is a pricing decision, not
|
|
1978
|
+
* a sync.
|
|
1844
1979
|
*/
|
|
1845
1980
|
export const CAPTION_TRANSCRIBE_LANES = [
|
|
1846
1981
|
"whisper",
|
|
1847
1982
|
"incredibly-fast-whisper",
|
|
1848
1983
|
"elevenlabs-stt",
|
|
1984
|
+
"nemotron-3-5-transcribe",
|
|
1849
1985
|
] as const satisfies readonly TranscribeLane[]
|
|
1850
1986
|
export type CaptionTranscribeLane = typeof CAPTION_TRANSCRIBE_LANES[number]
|
|
1851
1987
|
|
|
@@ -2083,6 +2219,7 @@ export const IMAGE_MASK_MODE: Record<ImageGenProvider, ImageMaskMode> = {
|
|
|
2083
2219
|
"seedream-5-flash": "prompt",
|
|
2084
2220
|
"minimax-h3-image": "prompt",
|
|
2085
2221
|
"seedream-5-5": "prompt",
|
|
2222
|
+
"flux-3-klein": "prompt",
|
|
2086
2223
|
"qwen": "prompt",
|
|
2087
2224
|
"flux-kontext": "prompt",
|
|
2088
2225
|
"flux-kontext-max": "prompt",
|
|
@@ -2115,6 +2252,7 @@ export const SEED_SUPPORT = new Set([
|
|
|
2115
2252
|
"flux", "flux-flex", "flux-i2i", "flux-pro-i2i", "flux-kontext", "flux-kontext-max",
|
|
2116
2253
|
"flux-2-klein", "kontext-multi",
|
|
2117
2254
|
"minimax-h3-image", "minimax-h3-image-i2i",
|
|
2255
|
+
"flux-3-klein", "flux-3-klein-i2i",
|
|
2118
2256
|
])
|
|
2119
2257
|
|
|
2120
2258
|
/** Ideogram models that support rendering_speed selection (TURBO/BALANCED/QUALITY) */
|
|
@@ -3062,6 +3200,25 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
|
|
|
3062
3200
|
* `elements[].voice_url`, no standalone `voices`).
|
|
3063
3201
|
*/
|
|
3064
3202
|
audioBindsToCharacters?: true
|
|
3203
|
+
/**
|
|
3204
|
+
* How many of the `characters` may be VIDEO subjects — a character made
|
|
3205
|
+
* from a short clip of itself (`characterReferences[].videoUrl`) instead of
|
|
3206
|
+
* images. The clip counts as one of the `videos` too: the provider caps
|
|
3207
|
+
* reference videos and video subjects together. Absent ⇒ none (any other
|
|
3208
|
+
* model refuses a character video). Each clip's own length is
|
|
3209
|
+
* `VIDEO_CHARACTER_CLIP_DURATION_LIMITS`.
|
|
3210
|
+
*/
|
|
3211
|
+
videoCharacters?: number
|
|
3212
|
+
/**
|
|
3213
|
+
* The provider bills a video subject's clip as reference-video seconds
|
|
3214
|
+
* (its with-video rate on output + input), so the run is priced as a
|
|
3215
|
+
* reference-video run with the clip among its input seconds. Absent ⇒ a
|
|
3216
|
+
* video subject is priced like an image subject: it adds no input seconds
|
|
3217
|
+
* and does not move the run onto the reference-video rate (its clip still
|
|
3218
|
+
* counts toward the `videos` cap and the reference videos' total length).
|
|
3219
|
+
* Read through `videoCharacterClipsBilledAsReferenceVideo`.
|
|
3220
|
+
*/
|
|
3221
|
+
videoCharactersBillAsReferenceVideo?: true
|
|
3065
3222
|
} | undefined
|
|
3066
3223
|
> = {
|
|
3067
3224
|
// Seedance 2 — full multimodal caps.
|
|
@@ -3106,7 +3263,12 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
|
|
|
3106
3263
|
// (docs.kie.ai/market/kling/v4-reference-to-video). A wired start frame takes
|
|
3107
3264
|
// one of the 10 image slots. No `voices` key: that names Gemini Omni's
|
|
3108
3265
|
// preset personas, which Kling does not take.
|
|
3109
|
-
|
|
3266
|
+
// Of the 7 subjects, at most 3 may be video subjects (a 3-8 s clip each), and
|
|
3267
|
+
// reference videos plus video subjects are at most 5. A video subject is
|
|
3268
|
+
// priced as a reference video here until a measured run confirms how Kling
|
|
3269
|
+
// 4.0 bills one (decided 2026-11-14): Flash, measured, bills it as an image
|
|
3270
|
+
// subject (no flag below).
|
|
3271
|
+
"kling-4": { images: 10, videos: 5, audio: 3, characters: 7, materials: 15, videoCharacters: 3, videoCharactersBillAsReferenceVideo: true },
|
|
3110
3272
|
// Kling 4.0 Keyframes — the Image References are the in-between frames
|
|
3111
3273
|
// (`keyframe_urls`, max 8; the clip's duration lowers the cap, see
|
|
3112
3274
|
// kling4KeyframeFrameCap). No reference videos or audio.
|
|
@@ -3116,8 +3278,10 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
|
|
|
3116
3278
|
// standalone voices: reference audio clip N becomes wired character N's voice
|
|
3117
3279
|
// (`voice_url`) when that character is a subject (2-4 images), so at most one
|
|
3118
3280
|
// per character (7) and none takes a material seat. A wired start frame takes one of the 10 image slots when it
|
|
3119
|
-
// runs on this endpoint.
|
|
3120
|
-
|
|
3281
|
+
// runs on this endpoint. A video subject is billed like an image subject
|
|
3282
|
+
// (measured on a staging run, decided 2026-11-14): no
|
|
3283
|
+
// `videoCharactersBillAsReferenceVideo`.
|
|
3284
|
+
"kling-4-flash": { images: 10, videos: 5, audio: 7, characters: 7, materials: 15, audioBindsToCharacters: true, videoCharacters: 3 },
|
|
3121
3285
|
"grok-i2v": { images: 7 }, // backend kie/models.ts maxRefImages: 7
|
|
3122
3286
|
"happyhorse-ref2v": { images: 9 }, // backend kie/models.ts maxRefImages: 9
|
|
3123
3287
|
// VEO 3.x — REFERENCE_2_VIDEO path caps refs at 3 (kie/video.ts slices to
|
|
@@ -3198,6 +3362,56 @@ export const VIDEO_REF_VIDEO_DURATION_LIMITS: Record<string, RefVideoDurationLim
|
|
|
3198
3362
|
"kling-4-flash": { minSec: 2, maxSec: 20, maxTotalSec: 20 },
|
|
3199
3363
|
}
|
|
3200
3364
|
|
|
3365
|
+
/**
|
|
3366
|
+
* The length a character's own clip (`characterReferences[].videoUrl`, a video
|
|
3367
|
+
* subject) must have, per provider. Kling 4.0 and Kling 4.0 Flash: "one 3-8
|
|
3368
|
+
* second single-shot character video" (docs.kie.ai/market/kling/v4-reference-to-video,
|
|
3369
|
+
* v4-flash-reference-to-video, read 2026-11-13). The clip is also one of the
|
|
3370
|
+
* run's reference videos, so `VIDEO_REF_VIDEO_DURATION_LIMITS` (its per-clip
|
|
3371
|
+
* bound and the combined `maxTotalSec`) applies to it as well.
|
|
3372
|
+
*/
|
|
3373
|
+
export const VIDEO_CHARACTER_CLIP_DURATION_LIMITS: Record<string, { minSec: number; maxSec: number } | undefined> = {
|
|
3374
|
+
"kling-4": { minSec: 3, maxSec: 8 },
|
|
3375
|
+
"kling-4-flash": { minSec: 3, maxSec: 8 },
|
|
3376
|
+
}
|
|
3377
|
+
|
|
3378
|
+
/**
|
|
3379
|
+
* Validate probed character-clip durations against
|
|
3380
|
+
* {@link VIDEO_CHARACTER_CLIP_DURATION_LIMITS}. Unlike a reference video
|
|
3381
|
+
* ({@link checkRefVideoDurations}, which ignores a clip the probe could not
|
|
3382
|
+
* read and charges its worst case), a character's clip must be measured within
|
|
3383
|
+
* its bounds to be accepted (decided 2026-11-13): one the probe could not read
|
|
3384
|
+
* (NaN, ≤0) is refused too, as `character_video_unreadable`.
|
|
3385
|
+
*/
|
|
3386
|
+
export function checkCharacterClipDurations(
|
|
3387
|
+
provider: string,
|
|
3388
|
+
durationsSec: readonly number[],
|
|
3389
|
+
): { ok: true } | { ok: false; code: "video_too_long" | "character_video_unreadable"; message: string } {
|
|
3390
|
+
const limit = VIDEO_CHARACTER_CLIP_DURATION_LIMITS[provider]
|
|
3391
|
+
if (!limit) return { ok: true }
|
|
3392
|
+
if (durationsSec.some((d) => !Number.isFinite(d) || d <= 0)) {
|
|
3393
|
+
return {
|
|
3394
|
+
ok: false,
|
|
3395
|
+
code: "character_video_unreadable",
|
|
3396
|
+
message:
|
|
3397
|
+
`A character's video could not be measured, and it must be ${limit.minSec}–${limit.maxSec} seconds long. ` +
|
|
3398
|
+
"Check that the link is a playable video file anyone can open, and run again. Nothing was charged.",
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
const offender = durationsSec.find((d) => d < limit.minSec || d > limit.maxSec)
|
|
3402
|
+
if (offender === undefined) return { ok: true }
|
|
3403
|
+
// The measured length, rounded UP to hundredths, so a clip just past the
|
|
3404
|
+
// bound never reads as inside it (8.03 s, never "8.0 s").
|
|
3405
|
+
const shown = (Math.ceil(offender * 100 - 1e-9) / 100).toFixed(2)
|
|
3406
|
+
return {
|
|
3407
|
+
ok: false,
|
|
3408
|
+
code: "video_too_long",
|
|
3409
|
+
message:
|
|
3410
|
+
`A character's video must be between ${limit.minSec} and ${limit.maxSec} seconds — one is ${shown} s. ` +
|
|
3411
|
+
`Use a single-shot clip of that length (a Trim Video node upstream works) and run again.`,
|
|
3412
|
+
}
|
|
3413
|
+
}
|
|
3414
|
+
|
|
3201
3415
|
/**
|
|
3202
3416
|
* Validate probed reference-video durations against the provider's limits.
|
|
3203
3417
|
*
|
|
@@ -4370,7 +4584,8 @@ export const VIDEO_DURATION_TIERS: Record<string, Array<{ maxSeconds: number; su
|
|
|
4370
4584
|
// The length tiers of the earlier Seedance Extend rows
|
|
4371
4585
|
// (`seedance-2-extend:<tier>:<res>`). No extend is priced on them any more —
|
|
4372
4586
|
// each Seedance extend provider has a row per second (`tailExtendCreditId`)
|
|
4373
|
-
// —
|
|
4587
|
+
// — and the rows themselves were removed (migration 648); the tiers stay,
|
|
4588
|
+
// unread, as part of this published table.
|
|
4374
4589
|
"seedance-2-extend": [
|
|
4375
4590
|
{ maxSeconds: 4, suffix: "4s" },
|
|
4376
4591
|
{ maxSeconds: 8, suffix: "8s" },
|
|
@@ -4748,6 +4963,13 @@ export function preferredInputModeForModel(
|
|
|
4748
4963
|
|
|
4749
4964
|
export const DEFAULT_VIDEO_PROVIDER = "seedance-2-fast"
|
|
4750
4965
|
|
|
4966
|
+
/**
|
|
4967
|
+
* The model a legacy Image to Video / Text to Video node runs when it names
|
|
4968
|
+
* none: the workflow run's own default for those two (Generate Video's is
|
|
4969
|
+
* {@link DEFAULT_VIDEO_PROVIDER}, through {@link applyDefaultVideoSelection}).
|
|
4970
|
+
*/
|
|
4971
|
+
export const LEGACY_VIDEO_NODE_DEFAULT_PROVIDER = "kling"
|
|
4972
|
+
|
|
4751
4973
|
/**
|
|
4752
4974
|
* Duration paired with the default provider when BOTH provider and duration
|
|
4753
4975
|
* are omitted. Pins the nothing-specified request to the default model's
|
|
@@ -196,6 +196,9 @@ const QUALITY_MAP: Record<string, QualityMapping> = {
|
|
|
196
196
|
// low the cheapest, 1K (1.5K costs the same, and is the panel's to pick).
|
|
197
197
|
"seedream-5-5": { field: "resolution", values: { low: "1K", mid: SEEDREAM_5_5_DEFAULT_RESOLUTION, high: "2K" } },
|
|
198
198
|
"seedream-5-5-i2i": { field: "resolution", values: { low: "1K", mid: SEEDREAM_5_5_DEFAULT_RESOLUTION, high: "2K" } },
|
|
199
|
+
// FLUX 3 Klein: three sizes, 1K its default and cheapest (as GPT Image 2).
|
|
200
|
+
"flux-3-klein": { field: "resolution", values: { low: "1K", mid: "2K", high: "4K" } },
|
|
201
|
+
"flux-3-klein-i2i": { field: "resolution", values: { low: "1K", mid: "2K", high: "4K" } },
|
|
199
202
|
// Video gen — resolution-style (720p/1080p)
|
|
200
203
|
"veo3": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
|
|
201
204
|
"veo3.1": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
|
package/src/node-runtime-keys.ts
CHANGED
|
@@ -55,6 +55,9 @@ export const EXECUTION_DATA_KEYS: ReadonlySet<string> = new Set([
|
|
|
55
55
|
"generatedResults",
|
|
56
56
|
"activeResultIndex",
|
|
57
57
|
"sourceImageUrl",
|
|
58
|
+
// An Extend / Upscale Video node's own run's output task — what a VEO or
|
|
59
|
+
// Runway extend after it continues (its `kieTaskId` is the task it works on).
|
|
60
|
+
"outputKieTaskId",
|
|
58
61
|
"__listTotal",
|
|
59
62
|
"__listCompleted",
|
|
60
63
|
"__listResults",
|
|
@@ -18,11 +18,23 @@
|
|
|
18
18
|
* rejecting it, so the user sees a valid value on the canvas rather than a
|
|
19
19
|
* failed run. It reads exclusively from `MODEL_CATALOG`, so a model added later
|
|
20
20
|
* is covered without touching this file.
|
|
21
|
+
*
|
|
22
|
+
* Besides the image trio below, it holds three single levers: a Video Upscale
|
|
23
|
+
* node's `targetResolution`, a Motion Transfer node's `resolution`, and a
|
|
24
|
+
* video node's stored Seedance reference task type (`referenceTaskType`,
|
|
25
|
+
* removed where no model the node runs lists it).
|
|
21
26
|
*/
|
|
22
27
|
|
|
23
|
-
import { autoAspectNeedsSourceImage, normalizeModelInput, type ModelInputAdjustment } from "./model-catalog.js"
|
|
28
|
+
import { autoAspectNeedsSourceImage, MODEL_CATALOG, normalizeModelInput, type ModelInputAdjustment, type ModelInputAdjustmentField } from "./model-catalog.js"
|
|
24
29
|
import { imageGenAutoAspectNeedsSourceImage, motionTransferResolution } from "./credit-identifiers.js"
|
|
25
30
|
import { normalizeVideoUpscaleResolution, VIDEO_UPSCALE_RESOLUTIONS, videoUpscaleResolutionsFor } from "./video-upscale-params.js"
|
|
31
|
+
import {
|
|
32
|
+
applyDefaultVideoSelection,
|
|
33
|
+
DEFAULT_VIDEO_TO_VIDEO_PROVIDER,
|
|
34
|
+
LEGACY_VIDEO_NODE_DEFAULT_PROVIDER,
|
|
35
|
+
listedSeedanceTaskType,
|
|
36
|
+
resolveVideoProviderForMode,
|
|
37
|
+
} from "./model-constants.js"
|
|
26
38
|
|
|
27
39
|
/**
|
|
28
40
|
* Node types whose `data` carries catalog-governed model parameters under the
|
|
@@ -105,7 +117,9 @@ export function nodeAspectRatio(nodeType: string | undefined, aspectRatio: unkno
|
|
|
105
117
|
return nodeType !== undefined && PHOTO_AUTO_ASPECT_NODE_TYPES.has(nodeType) ? "auto" : undefined
|
|
106
118
|
}
|
|
107
119
|
|
|
108
|
-
export interface NodeParamAdjustment extends ModelInputAdjustment {
|
|
120
|
+
export interface NodeParamAdjustment extends Omit<ModelInputAdjustment, "field"> {
|
|
121
|
+
/** A catalog-governed parameter, or a video node's stored `referenceTaskType` (always removed: `to` is undefined). */
|
|
122
|
+
field: ModelInputAdjustmentField | "referenceTaskType"
|
|
109
123
|
nodeId: string
|
|
110
124
|
provider: string
|
|
111
125
|
}
|
|
@@ -143,6 +157,8 @@ export function normalizeNodeModelParams<T extends NodeLike>(
|
|
|
143
157
|
const type = typeof node.type === "string" ? node.type : ""
|
|
144
158
|
if (type === "video-upscale") return normalizeVideoUpscaleNode(node, adjustments)
|
|
145
159
|
if (type === "motion-transfer") return normalizeMotionTransferNode(node, adjustments)
|
|
160
|
+
// The stored reference task type: the one rule every workflow write runs.
|
|
161
|
+
if (REFERENCE_TASK_TYPE_NODE_MODES.has(type)) return withListedReferenceTaskTypes([node], adjustments)[0]!
|
|
146
162
|
if (!MODEL_PARAM_NODE_TYPES.has(type)) return node
|
|
147
163
|
|
|
148
164
|
const data = node.data
|
|
@@ -247,6 +263,111 @@ function normalizeMotionTransferNode<T extends NodeLike>(node: T, adjustments: N
|
|
|
247
263
|
return { ...node, data: { ...d, resolution: sized.resolution } }
|
|
248
264
|
}
|
|
249
265
|
|
|
266
|
+
/** A video run's mode: the twin of an aliased model it sends to (`resolveVideoProviderForMode`). */
|
|
267
|
+
type VideoRunMode = "image-to-video" | "text-to-video"
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* The video node types that store a Seedance reference task type
|
|
271
|
+
* (`referenceTaskType`, "Use the reference video as"), each with the modes its
|
|
272
|
+
* run sends a model in: Generate Video either (the wiring picks), Image to
|
|
273
|
+
* Video and Text to Video their own, Video to Video none (its model's own id;
|
|
274
|
+
* its run is an edit whatever is stored).
|
|
275
|
+
*/
|
|
276
|
+
const REFERENCE_TASK_TYPE_NODE_MODES: ReadonlyMap<string, readonly VideoRunMode[]> = new Map([
|
|
277
|
+
["generate-video", ["image-to-video", "text-to-video"]],
|
|
278
|
+
["image-to-video", ["image-to-video"]],
|
|
279
|
+
["text-to-video", ["text-to-video"]],
|
|
280
|
+
["video-to-video", []],
|
|
281
|
+
])
|
|
282
|
+
|
|
283
|
+
const namedModel = (v: unknown): string | undefined => (typeof v === "string" && v !== "" ? v : undefined)
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* The models a video node's run uses: each entry of a Provider list
|
|
287
|
+
* (`data.providers`, two or more, each run on its own), else its one model —
|
|
288
|
+
* the run's own default when it names none (Generate Video's
|
|
289
|
+
* `applyDefaultVideoSelection`, the legacy Image / Text to Video default, Video
|
|
290
|
+
* to Video's).
|
|
291
|
+
*/
|
|
292
|
+
function videoRunModels(type: string, d: Record<string, unknown>): string[] {
|
|
293
|
+
const list = Array.isArray(d.providers) ? d.providers.flatMap((p) => namedModel(p) ?? []) : []
|
|
294
|
+
if (list.length >= 2) return list
|
|
295
|
+
const named = namedModel(d.provider)
|
|
296
|
+
if (type === "generate-video") return [applyDefaultVideoSelection({ provider: named }).provider]
|
|
297
|
+
return [named ?? (type === "video-to-video" ? DEFAULT_VIDEO_TO_VIDEO_PROVIDER : LEGACY_VIDEO_NODE_DEFAULT_PROVIDER)]
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* A video node's stored reference task type (decided 2026-11-13): kept, the
|
|
302
|
+
* node returned as it came, while a model its run sends to lists the value
|
|
303
|
+
* (`listedSeedanceTaskType`, the one membership test the run itself asks —
|
|
304
|
+
* matched exactly, read from `MODEL_CATALOG[id].referenceTaskTypes`);
|
|
305
|
+
* otherwise the key is REMOVED (absent is Auto, the setting's own meaning).
|
|
306
|
+
* A run already ignores such a value, so nothing a run sends or is charged
|
|
307
|
+
* changes; what changes is that it can no longer ride hidden on a model that
|
|
308
|
+
* ignores it and come back when the node is later switched to one that reads
|
|
309
|
+
* it. `auto`, a wrong case, a number and every value no model lists are
|
|
310
|
+
* removed on every model. A node storing no value is returned as it came.
|
|
311
|
+
*/
|
|
312
|
+
function normalizeReferenceTaskTypeNode<T extends NodeLike>(node: T, type: string, adjustments: NodeParamAdjustment[]): T {
|
|
313
|
+
const data = node.data
|
|
314
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) return node
|
|
315
|
+
const d = data as Record<string, unknown>
|
|
316
|
+
const value = d.referenceTaskType
|
|
317
|
+
// Unset (absent, or an in-memory `undefined` the editor writes for Auto): nothing to judge.
|
|
318
|
+
if (value === undefined) return node
|
|
319
|
+
const modes = REFERENCE_TASK_TYPE_NODE_MODES.get(type) ?? []
|
|
320
|
+
const models = videoRunModels(type, d)
|
|
321
|
+
const sentTo = models.flatMap((m) => [m, ...modes.map((mode) => resolveVideoProviderForMode(m, mode))])
|
|
322
|
+
if (sentTo.some((m) => listedSeedanceTaskType(m, value) !== undefined)) return node
|
|
323
|
+
|
|
324
|
+
const listedAnywhere = Object.values(MODEL_CATALOG).some((m) => m.referenceTaskTypes?.some((t) => t === value))
|
|
325
|
+
const label = MODEL_CATALOG[models[0]!]?.label ?? models[0]!
|
|
326
|
+
const reason = listedAnywhere
|
|
327
|
+
? `${label} does not take the reference task type "${String(value)}": removed, so the run declares none (Auto).`
|
|
328
|
+
: `"${String(value)}" is not a reference task type a model takes (reference, edit or extend): removed — Auto is the setting left unset.`
|
|
329
|
+
const nodeId = typeof node.id === "string" ? node.id : "(unknown node)"
|
|
330
|
+
adjustments.push({ field: "referenceTaskType", from: typeof value === "number" ? value : String(value), to: undefined, reason, nodeId, provider: models[0]! })
|
|
331
|
+
const { referenceTaskType: _removed, ...rest } = d
|
|
332
|
+
return { ...node, data: rest }
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* A workflow graph's nodes with every stored Seedance reference task type held
|
|
337
|
+
* to the models its node runs (decided 2026-11-13) — the ONE rule for that
|
|
338
|
+
* field, which {@link normalizeNodeModelParams} runs too: on a Generate Video,
|
|
339
|
+
* Image to Video, Text to Video or Video to Video node, a `referenceTaskType`
|
|
340
|
+
* no model the node runs lists (and `auto`, or any value no model lists) is
|
|
341
|
+
* removed; nothing else on any node is touched.
|
|
342
|
+
*
|
|
343
|
+
* Every path that stores a workflow graph runs it: the editor's saves, the
|
|
344
|
+
* REST and MCP writes, imports, copies, template clones and the published
|
|
345
|
+
* snapshots. So a value can never sit unused on a model that ignores it and
|
|
346
|
+
* take effect when the node is later switched to one that reads it.
|
|
347
|
+
*
|
|
348
|
+
* Takes the stored value as it comes (`nodes` may be any JSON): anything that
|
|
349
|
+
* is not an array is returned as it came. The SAME array is returned when no
|
|
350
|
+
* node changes, and an unchanged node keeps its reference, so a graph without
|
|
351
|
+
* such a value is written byte for byte as before.
|
|
352
|
+
*
|
|
353
|
+
* @param adjustments told each removal (what `normalizeNodeModelParams` reports).
|
|
354
|
+
*/
|
|
355
|
+
export function withListedReferenceTaskTypes<N>(nodes: N, adjustments?: NodeParamAdjustment[]): N {
|
|
356
|
+
if (!Array.isArray(nodes)) return nodes
|
|
357
|
+
const sink = adjustments ?? []
|
|
358
|
+
let changed = false
|
|
359
|
+
const out = (nodes as unknown[]).map((node) => {
|
|
360
|
+
if (!node || typeof node !== "object" || Array.isArray(node)) return node
|
|
361
|
+
const n = node as NodeLike
|
|
362
|
+
const type = typeof n.type === "string" ? n.type : ""
|
|
363
|
+
if (!REFERENCE_TASK_TYPE_NODE_MODES.has(type)) return node
|
|
364
|
+
const next = normalizeReferenceTaskTypeNode(n, type, sink)
|
|
365
|
+
if (next !== n) changed = true
|
|
366
|
+
return next
|
|
367
|
+
})
|
|
368
|
+
return (changed ? out : nodes) as N
|
|
369
|
+
}
|
|
370
|
+
|
|
250
371
|
/** One-line-per-change summary, for surfacing back to an agent or a log. */
|
|
251
372
|
export function describeNodeAdjustments(adjustments: readonly NodeParamAdjustment[]): string[] {
|
|
252
373
|
return adjustments.map(
|