@nodaro/shared 3.62.0 → 3.64.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-C7POAYFE.js → chunk-36VWLB4J.js} +3 -3
- package/dist/{chunk-C7POAYFE.js.map → chunk-36VWLB4J.js.map} +1 -1
- package/dist/{chunk-S24ZBUB4.js → chunk-3AYM47GW.js} +6 -32
- package/dist/chunk-3AYM47GW.js.map +1 -0
- package/dist/{chunk-YCXRSWCQ.js → chunk-3KTWYYCN.js} +8 -5
- package/dist/chunk-3KTWYYCN.js.map +1 -0
- package/dist/{chunk-ZES6EZC4.js → chunk-4IUE2JB7.js} +3 -3
- package/dist/{chunk-ZES6EZC4.js.map → chunk-4IUE2JB7.js.map} +1 -1
- package/dist/{chunk-MYJQELFN.cjs → chunk-5OBTGNUQ.cjs} +547 -29
- package/dist/chunk-5OBTGNUQ.cjs.map +1 -0
- package/dist/{chunk-TWF2OSH4.cjs → chunk-67CMMTLN.cjs} +4 -4
- package/dist/{chunk-TWF2OSH4.cjs.map → chunk-67CMMTLN.cjs.map} +1 -1
- package/dist/{chunk-WRSWH7US.cjs → chunk-6BRWPJPP.cjs} +17 -2
- package/dist/chunk-6BRWPJPP.cjs.map +1 -0
- package/dist/{chunk-S5TMRJMX.js → chunk-6YIV37V7.js} +4 -4
- package/dist/{chunk-S5TMRJMX.js.map → chunk-6YIV37V7.js.map} +1 -1
- package/dist/{chunk-3M4BNKFJ.cjs → chunk-7AJGUI7L.cjs} +202 -16
- package/dist/chunk-7AJGUI7L.cjs.map +1 -0
- package/dist/{chunk-JZGZ26YB.js → chunk-7KQ6W5DS.js} +4 -4
- package/dist/{chunk-JZGZ26YB.js.map → chunk-7KQ6W5DS.js.map} +1 -1
- package/dist/{chunk-IWWVPR3W.cjs → chunk-ACZZHHFZ.cjs} +149 -34
- package/dist/chunk-ACZZHHFZ.cjs.map +1 -0
- package/dist/{chunk-2W745U4A.cjs → chunk-AZNZ5WNZ.cjs} +42 -70
- package/dist/chunk-AZNZ5WNZ.cjs.map +1 -0
- package/dist/{chunk-HSHCCBIV.js → chunk-BQYCZLMF.js} +16 -3
- package/dist/chunk-BQYCZLMF.js.map +1 -0
- package/dist/chunk-CHS2SIP6.cjs +504 -0
- package/dist/chunk-CHS2SIP6.cjs.map +1 -0
- package/dist/{chunk-CIPPPT7E.cjs → chunk-CHTZZRAL.cjs} +6 -6
- package/dist/{chunk-CIPPPT7E.cjs.map → chunk-CHTZZRAL.cjs.map} +1 -1
- package/dist/{chunk-AOJ6B7K4.cjs → chunk-D4KWNDPH.cjs} +12 -12
- package/dist/chunk-D4KWNDPH.cjs.map +1 -0
- package/dist/{chunk-5YYN5X57.js → chunk-DZ4IOP3Q.js} +536 -30
- package/dist/chunk-DZ4IOP3Q.js.map +1 -0
- package/dist/{chunk-VACPZPUA.cjs → chunk-EXEVT6D2.cjs} +15 -5
- package/dist/chunk-EXEVT6D2.cjs.map +1 -0
- package/dist/{chunk-5M43XMRB.cjs → chunk-FHGRKQVZ.cjs} +8 -8
- package/dist/{chunk-5M43XMRB.cjs.map → chunk-FHGRKQVZ.cjs.map} +1 -1
- package/dist/{chunk-KJSRPHJ2.cjs → chunk-GTWUS6MQ.cjs} +165 -54
- package/dist/chunk-GTWUS6MQ.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-G3KVK7OU.cjs → chunk-HDPJNNMF.cjs} +21 -21
- package/dist/{chunk-G3KVK7OU.cjs.map → chunk-HDPJNNMF.cjs.map} +1 -1
- package/dist/{chunk-3OYO3XCC.js → chunk-IYSOVS7O.js} +118 -24
- package/dist/chunk-IYSOVS7O.js.map +1 -0
- package/dist/{chunk-AFYTX4AI.cjs → chunk-J6B7J73J.cjs} +110 -50
- package/dist/chunk-J6B7J73J.cjs.map +1 -0
- package/dist/{chunk-I2RQB7VG.js → chunk-KB2SQAR3.js} +3 -3
- package/dist/{chunk-I2RQB7VG.js.map → chunk-KB2SQAR3.js.map} +1 -1
- package/dist/{chunk-BLJUCPMV.cjs → chunk-KSHAAPQF.cjs} +5 -2
- package/dist/chunk-KSHAAPQF.cjs.map +1 -0
- package/dist/{chunk-6G7NN4S4.js → chunk-NIAFR5EE.js} +2 -2
- package/dist/chunk-NIAFR5EE.js.map +1 -0
- package/dist/{chunk-CF4S4N5X.js → chunk-O2QOBA6Q.js} +2 -2
- package/dist/{chunk-CF4S4N5X.js.map → chunk-O2QOBA6Q.js.map} +1 -1
- package/dist/{chunk-IDTKF5EX.cjs → chunk-O4RPXBDZ.cjs} +12 -8
- package/dist/chunk-O4RPXBDZ.cjs.map +1 -0
- package/dist/{chunk-4GGLKRYI.cjs → chunk-O6TBB4IF.cjs} +2 -2
- package/dist/{chunk-4GGLKRYI.cjs.map → chunk-O6TBB4IF.cjs.map} +1 -1
- package/dist/{chunk-PTD6EDUU.js → chunk-OBOOHG3N.js} +13 -4
- package/dist/chunk-OBOOHG3N.js.map +1 -0
- package/dist/{chunk-2D5LQFV4.cjs → chunk-OOZW2MM6.cjs} +9 -9
- package/dist/{chunk-2D5LQFV4.cjs.map → chunk-OOZW2MM6.cjs.map} +1 -1
- 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-G4U3HW6W.js → chunk-PJJAZQVZ.js} +3 -3
- package/dist/{chunk-G4U3HW6W.js.map → chunk-PJJAZQVZ.js.map} +1 -1
- package/dist/{chunk-E2HZTGYX.js → chunk-Q2Y4JHF7.js} +7 -7
- package/dist/chunk-Q2Y4JHF7.js.map +1 -0
- package/dist/{chunk-FVII3KHN.js → chunk-QYU7J5EQ.js} +198 -17
- package/dist/chunk-QYU7J5EQ.js.map +1 -0
- package/dist/{chunk-JJNNM23P.js → chunk-S3UGLZSF.js} +3 -3
- package/dist/{chunk-JJNNM23P.js.map → chunk-S3UGLZSF.js.map} +1 -1
- package/dist/{chunk-CC4V2B7S.js → chunk-SHH2T4CR.js} +3 -3
- package/dist/{chunk-CC4V2B7S.js.map → chunk-SHH2T4CR.js.map} +1 -1
- package/dist/{chunk-4ZEFP2FQ.cjs → chunk-SPAHI7DY.cjs} +4 -4
- package/dist/{chunk-4ZEFP2FQ.cjs.map → chunk-SPAHI7DY.cjs.map} +1 -1
- package/dist/{chunk-Y6X7UJSD.js → chunk-SXHHLZ22.js} +122 -15
- package/dist/chunk-SXHHLZ22.js.map +1 -0
- package/dist/{chunk-HRY7KGAE.cjs → chunk-T2OVDF2M.cjs} +6 -6
- package/dist/{chunk-HRY7KGAE.cjs.map → chunk-T2OVDF2M.cjs.map} +1 -1
- 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-NGKKNSK6.js → chunk-TPQJKS7D.js} +139 -16
- package/dist/chunk-TPQJKS7D.js.map +1 -0
- package/dist/{chunk-N7OUQK7E.cjs → chunk-TQW3R44P.cjs} +8 -8
- package/dist/{chunk-N7OUQK7E.cjs.map → chunk-TQW3R44P.cjs.map} +1 -1
- package/dist/{chunk-GSFB537T.js → chunk-TTGZ2L3O.js} +23 -4
- package/dist/chunk-TTGZ2L3O.js.map +1 -0
- package/dist/{chunk-SYWR5G3T.js → chunk-VPTA4Z7G.js} +54 -7
- package/dist/chunk-VPTA4Z7G.js.map +1 -0
- package/dist/{chunk-2HZGDZZN.cjs → chunk-VZ6TE23U.cjs} +6 -6
- package/dist/{chunk-2HZGDZZN.cjs.map → chunk-VZ6TE23U.cjs.map} +1 -1
- package/dist/{chunk-TRVWMKNE.cjs → chunk-W6VJAUGM.cjs} +285 -64
- package/dist/chunk-W6VJAUGM.cjs.map +1 -0
- package/dist/{chunk-UDDVDQMF.js → chunk-W7KHHNZR.js} +235 -37
- package/dist/chunk-W7KHHNZR.js.map +1 -0
- package/dist/{chunk-KYMHFVAZ.cjs → chunk-Y4GCJJPF.cjs} +2 -2
- package/dist/chunk-Y4GCJJPF.cjs.map +1 -0
- package/dist/{chunk-6CSXMWL4.cjs → chunk-YQV53HRR.cjs} +27 -4
- package/dist/chunk-YQV53HRR.cjs.map +1 -0
- package/dist/{chunk-7FCTCWHD.js → chunk-ZI3QDUHO.js} +3 -3
- package/dist/{chunk-7FCTCWHD.js.map → chunk-ZI3QDUHO.js.map} +1 -1
- 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 +47 -1
- package/dist/entries/captions.d.ts +47 -1
- package/dist/entries/captions.js +1 -1
- package/dist/entries/credits.cjs +354 -174
- package/dist/entries/credits.d.cts +378 -27
- package/dist/entries/credits.d.ts +378 -27
- package/dist/entries/credits.js +11 -11
- package/dist/entries/llm-models.cjs +77 -57
- package/dist/entries/llm-models.d.cts +108 -7
- package/dist/entries/llm-models.d.ts +108 -7
- package/dist/entries/llm-models.js +2 -2
- package/dist/entries/media.cjs +63 -63
- package/dist/entries/media.d.cts +8 -0
- package/dist/entries/media.d.ts +8 -0
- package/dist/entries/media.js +1 -1
- package/dist/entries/model-catalog.cjs +161 -105
- package/dist/entries/model-catalog.d.cts +109 -22
- package/dist/entries/model-catalog.d.ts +109 -22
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +466 -322
- package/dist/entries/models.d.cts +71 -5
- package/dist/entries/models.d.ts +71 -5
- package/dist/entries/models.js +5 -5
- package/dist/entries/nodes.cjs +226 -209
- package/dist/entries/nodes.d.cts +66 -7
- package/dist/entries/nodes.d.ts +66 -7
- 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/runtime-config.cjs +29 -29
- package/dist/entries/runtime-config.d.cts +10 -7
- package/dist/entries/runtime-config.d.ts +10 -7
- package/dist/entries/runtime-config.js +1 -1
- package/dist/entries/social.cjs +177 -177
- package/dist/entries/social.js +2 -2
- package/dist/entries/types.d.cts +8 -0
- package/dist/entries/types.d.ts +8 -0
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +154 -150
- package/dist/entries/video.d.cts +11 -2
- package/dist/entries/video.d.ts +11 -2
- package/dist/entries/video.js +6 -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 +2136 -1704
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +27 -27
- package/dist/{model-catalog-CCEcv08q.d.ts → model-catalog-Cf9fkEUp.d.cts} +45 -2
- package/dist/{model-catalog-CCEcv08q.d.cts → model-catalog-Cf9fkEUp.d.ts} +45 -2
- package/dist/{model-constants-B88p6XR0.d.ts → model-constants-BxjiWVQ9.d.ts} +215 -32
- package/dist/{model-constants-Cf3zaITt.d.cts → model-constants-C_Nyft_i.d.cts} +215 -32
- package/package.json +1 -1
- package/src/__tests__/add-captions-nemotron-pricing.test.ts +111 -0
- package/src/__tests__/credit-identifiers.test.ts +29 -0
- package/src/__tests__/extend-providers.test.ts +359 -39
- 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__/gvp-supported-providers.test.ts +27 -2
- package/src/__tests__/lip-sync-audio-rate.test.ts +74 -0
- package/src/__tests__/lip-sync-levers.test.ts +31 -0
- package/src/__tests__/llm-models.test.ts +139 -12
- package/src/__tests__/llm-price-key.test.ts +164 -1
- package/src/__tests__/model-makers.test.ts +3 -0
- package/src/__tests__/nemotron-transcribe-pricing.test.ts +61 -0
- package/src/__tests__/node-runtime-keys.test.ts +7 -0
- package/src/__tests__/normalize-node-params.test.ts +172 -1
- package/src/__tests__/pixverse-v6-max-catalog.test.ts +271 -0
- package/src/__tests__/prompt-length-limits.test.ts +4 -0
- 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__/seedance-task-type.test.ts +13 -3
- package/src/__tests__/sequence-execution.test.ts +22 -1
- package/src/__tests__/suno-credit-type.test.ts +21 -2
- package/src/__tests__/transcribe-capabilities.test.ts +41 -2
- package/src/__tests__/transcribe-preflight.test.ts +50 -1
- package/src/__tests__/video-analysis-catalog-sync.test.ts +4 -2
- package/src/__tests__/video-analysis-pricing.test.ts +10 -9
- package/src/__tests__/video-audio-capability.test.ts +35 -6
- package/src/__tests__/video-resolution-billed-as-named.test.ts +30 -0
- package/src/__tests__/video-upscale-params.test.ts +62 -0
- package/src/caption-styles.ts +62 -0
- package/src/catalog-projection.ts +8 -0
- package/src/credit-estimators/add-captions-nemotron.ts +73 -0
- package/src/credit-estimators/index.ts +20 -0
- package/src/credit-estimators/nemotron-transcribe.ts +87 -0
- package/src/credit-identifiers.ts +351 -41
- package/src/entries/captions.ts +2 -0
- package/src/entries/credits.ts +37 -2
- package/src/entries/llm-models.ts +6 -0
- package/src/entries/model-catalog.ts +22 -0
- package/src/entries/models.ts +50 -0
- package/src/entries/nodes.ts +4 -0
- package/src/entries/pipeline.ts +1 -1
- package/src/entries/video.ts +1 -1
- package/src/flux-3-klein.ts +69 -0
- package/src/freecut-protocol.ts +8 -0
- package/src/input-image-pricing.ts +23 -6
- package/src/lip-sync-levers.ts +56 -0
- package/src/lip-sync-pricing.ts +91 -1
- package/src/llm-models.ts +305 -16
- package/src/model-catalog.ts +529 -28
- package/src/model-constants.ts +417 -41
- package/src/model-tree.ts +2 -1
- package/src/nodaro-video-upscale.ts +48 -0
- package/src/node-default-mappings.ts +6 -0
- package/src/node-runtime-keys.ts +3 -0
- package/src/normalize-node-params.ts +172 -3
- package/src/runtime-config/contract.ts +10 -7
- package/src/seedance-draft.ts +2 -1
- package/src/seedance-extend-rate.ts +116 -0
- package/src/sequence-execution.ts +24 -0
- package/src/transcribe-preflight.ts +81 -7
- package/src/video-analysis-pricing.ts +28 -15
- package/src/video-duration.ts +9 -0
- package/src/video-ui-defaults.ts +5 -3
- package/src/video-upscale-params.ts +67 -0
- package/dist/chunk-2W745U4A.cjs.map +0 -1
- package/dist/chunk-3M4BNKFJ.cjs.map +0 -1
- package/dist/chunk-3OYO3XCC.js.map +0 -1
- package/dist/chunk-5YYN5X57.js.map +0 -1
- package/dist/chunk-6CSXMWL4.cjs.map +0 -1
- package/dist/chunk-6G7NN4S4.js.map +0 -1
- package/dist/chunk-AFYTX4AI.cjs.map +0 -1
- package/dist/chunk-AOJ6B7K4.cjs.map +0 -1
- package/dist/chunk-BLJUCPMV.cjs.map +0 -1
- package/dist/chunk-E2HZTGYX.js.map +0 -1
- package/dist/chunk-FVII3KHN.js.map +0 -1
- package/dist/chunk-GSFB537T.js.map +0 -1
- package/dist/chunk-HSHCCBIV.js.map +0 -1
- package/dist/chunk-IDTKF5EX.cjs.map +0 -1
- package/dist/chunk-IWWVPR3W.cjs.map +0 -1
- package/dist/chunk-KJSRPHJ2.cjs.map +0 -1
- package/dist/chunk-KYMHFVAZ.cjs.map +0 -1
- package/dist/chunk-MYJQELFN.cjs.map +0 -1
- package/dist/chunk-NGKKNSK6.js.map +0 -1
- package/dist/chunk-PTD6EDUU.js.map +0 -1
- package/dist/chunk-Q6IES3U2.js.map +0 -1
- package/dist/chunk-QWYFHQYK.cjs +0 -357
- package/dist/chunk-QWYFHQYK.cjs.map +0 -1
- package/dist/chunk-S24ZBUB4.js.map +0 -1
- package/dist/chunk-SYWR5G3T.js.map +0 -1
- package/dist/chunk-TRVWMKNE.cjs.map +0 -1
- package/dist/chunk-UDDVDQMF.js.map +0 -1
- package/dist/chunk-VACPZPUA.cjs.map +0 -1
- package/dist/chunk-WRSWH7US.cjs.map +0 -1
- package/dist/chunk-Y6X7UJSD.js.map +0 -1
- package/dist/chunk-YCXRSWCQ.js.map +0 -1
package/src/entries/models.ts
CHANGED
|
@@ -63,6 +63,8 @@ export {
|
|
|
63
63
|
videoModelSupportsAudio,
|
|
64
64
|
videoModelCanSpeakDialogue,
|
|
65
65
|
applyVideoAudioToggle,
|
|
66
|
+
videoAudioIntent,
|
|
67
|
+
videoAudioPricedOn,
|
|
66
68
|
VIDEO_VARIABLE_PRICING,
|
|
67
69
|
VIDEO_DURATION_TIERS,
|
|
68
70
|
ASPECT_RATIO_DIMENSIONS,
|
|
@@ -87,7 +89,19 @@ export {
|
|
|
87
89
|
VIDEO_UPSCALE_PROVIDERS,
|
|
88
90
|
EXTEND_VIDEO_PROVIDERS,
|
|
89
91
|
isSeedanceExtendProvider,
|
|
92
|
+
isTailExtendProvider,
|
|
93
|
+
PIXVERSE_V6_EXTEND_PROVIDER,
|
|
94
|
+
isPixverseExtendProvider,
|
|
95
|
+
isCatalogExtendProvider,
|
|
96
|
+
extendHasSoundSwitch,
|
|
97
|
+
GROK_EXTEND_PROVIDER,
|
|
98
|
+
isGrokExtendProvider,
|
|
99
|
+
GROK_EXTEND_SOURCE_MODELS,
|
|
100
|
+
isGrokExtendSourceModel,
|
|
90
101
|
LIP_SYNC_PROVIDERS,
|
|
102
|
+
RETIRED_LIP_SYNC_PROVIDERS,
|
|
103
|
+
retiredLipSyncProviderName,
|
|
104
|
+
retiredLipSyncProviderMessage,
|
|
91
105
|
REPLICATE_LIP_SYNC_PROVIDERS,
|
|
92
106
|
FAL_LIP_SYNC_PROVIDERS,
|
|
93
107
|
VIDEO_INPUT_LIP_SYNC_PROVIDERS,
|
|
@@ -111,8 +125,12 @@ export {
|
|
|
111
125
|
TRANSCRIBE_PROVIDERS,
|
|
112
126
|
TRANSCRIBE_LANES,
|
|
113
127
|
TRANSCRIBE_PROVIDER_CAPABILITIES,
|
|
128
|
+
CAPTION_TRANSCRIBE_LANES,
|
|
129
|
+
TRANSCRIBE_TARGET_LANGUAGES,
|
|
114
130
|
transcribeProvidersWithWordTimestamps,
|
|
115
131
|
transcribeLaneSupportsWordTimestamps,
|
|
132
|
+
transcribeProvidersWithTranslation,
|
|
133
|
+
transcribeLaneSupportsTranslation,
|
|
116
134
|
DEFAULT_TRANSCRIBE_PROVIDER,
|
|
117
135
|
DEFAULT_TRANSCRIBE_NODE_PROVIDER,
|
|
118
136
|
SCRIPT_PROVIDERS,
|
|
@@ -196,6 +214,10 @@ export {
|
|
|
196
214
|
normalizeGrokVideo15Resolution,
|
|
197
215
|
GROK_VIDEO_15_MAX_MIDDLE_FRAMES,
|
|
198
216
|
grokVideo15MiddleFrameSlots,
|
|
217
|
+
PIXVERSE_V6_MAX_PROVIDER,
|
|
218
|
+
isPixverseV6MaxProvider,
|
|
219
|
+
PIXVERSE_V6_MAX_DEFAULT_QUALITY,
|
|
220
|
+
normalizePixverseV6MaxQuality,
|
|
199
221
|
videoKeyframesMiddleCap,
|
|
200
222
|
VIDEO_REF_RATE_PROVIDERS,
|
|
201
223
|
billsReferenceVideoSeconds,
|
|
@@ -236,6 +258,7 @@ export {
|
|
|
236
258
|
VIDEO_REF_AUDIO_RULES,
|
|
237
259
|
checkRefAudioRules,
|
|
238
260
|
DEFAULT_VIDEO_PROVIDER,
|
|
261
|
+
LEGACY_VIDEO_NODE_DEFAULT_PROVIDER,
|
|
239
262
|
DEFAULT_VIDEO_DURATION_SEC,
|
|
240
263
|
applyDefaultVideoSelection,
|
|
241
264
|
PRICING_DEFAULT_DURATION_SEC,
|
|
@@ -302,6 +325,10 @@ export type {
|
|
|
302
325
|
VideoUpscaleProvider,
|
|
303
326
|
ExtendVideoProvider,
|
|
304
327
|
SeedanceExtendProvider,
|
|
328
|
+
TailExtendProvider,
|
|
329
|
+
PixverseExtendProvider,
|
|
330
|
+
CatalogExtendProvider,
|
|
331
|
+
GrokExtendProvider,
|
|
305
332
|
FaceSwapProvider,
|
|
306
333
|
LipSyncProvider,
|
|
307
334
|
MotionTransferProviderType,
|
|
@@ -312,6 +339,8 @@ export type {
|
|
|
312
339
|
MusicProvider,
|
|
313
340
|
TranscribeProvider,
|
|
314
341
|
TranscribeLane,
|
|
342
|
+
CaptionTranscribeLane,
|
|
343
|
+
TranscribeTargetLanguage,
|
|
315
344
|
ScriptProvider,
|
|
316
345
|
AiWriterProvider,
|
|
317
346
|
QaCheckProvider,
|
|
@@ -327,6 +356,7 @@ export type {
|
|
|
327
356
|
ModelPromptingStyle,
|
|
328
357
|
VideoModelCapabilities,
|
|
329
358
|
VideoAudioMode,
|
|
359
|
+
VideoAudioRequest,
|
|
330
360
|
VideoAudioCapability,
|
|
331
361
|
GvpAnchorChoice,
|
|
332
362
|
GvpAnchorWireMode,
|
|
@@ -421,6 +451,18 @@ export type {
|
|
|
421
451
|
TopazVideoTargetInput,
|
|
422
452
|
TopazVideoTarget,
|
|
423
453
|
} from "../topaz-video.js"
|
|
454
|
+
// --- Nodaro Video Upscale (tiers, limits) ---
|
|
455
|
+
export {
|
|
456
|
+
NODARO_VIDEO_UPSCALE_PROVIDER,
|
|
457
|
+
NODARO_VIDEO_UPSCALE_TIERS,
|
|
458
|
+
NODARO_VIDEO_UPSCALE_DEFAULT_TIER,
|
|
459
|
+
NODARO_VIDEO_UPSCALE_BOX,
|
|
460
|
+
NODARO_VIDEO_UPSCALE_MAX_SEC,
|
|
461
|
+
NODARO_VIDEO_UPSCALE_MAX_BYTES,
|
|
462
|
+
isNodaroVideoUpscaleTier,
|
|
463
|
+
isNodaroVideoUpscaleProvider,
|
|
464
|
+
} from "../nodaro-video-upscale.js"
|
|
465
|
+
export type { NodaroVideoUpscaleTier } from "../nodaro-video-upscale.js"
|
|
424
466
|
export {
|
|
425
467
|
AUDIO_SOUNDTRACK_MIN_SEC,
|
|
426
468
|
AUDIO_SOUNDTRACK_FPS,
|
|
@@ -428,3 +470,11 @@ export {
|
|
|
428
470
|
audioSoundtrackClipSec,
|
|
429
471
|
audioSoundtrackPrompt,
|
|
430
472
|
} from "../audio-soundtrack.js"
|
|
473
|
+
export {
|
|
474
|
+
LIP_SYNC_MODEL_LEVERS,
|
|
475
|
+
lipSyncLeversNotTaken,
|
|
476
|
+
lipSyncTakesLever,
|
|
477
|
+
lipSyncLeverClearPatch,
|
|
478
|
+
withoutLipSyncLeversNotTaken,
|
|
479
|
+
} from "../lip-sync-levers.js"
|
|
480
|
+
export type { LipSyncModelLever } from "../lip-sync-levers.js"
|
package/src/entries/nodes.ts
CHANGED
|
@@ -191,7 +191,10 @@ export {
|
|
|
191
191
|
export * from "../node-pass-through.js"
|
|
192
192
|
export {
|
|
193
193
|
transcribeWordTimestampsRefusal,
|
|
194
|
+
transcribeTranslationRefusal,
|
|
195
|
+
transcribeTargetLanguageOf,
|
|
194
196
|
findWordlessTranscriptFeeds,
|
|
197
|
+
transcribeNodeReturnsWords,
|
|
195
198
|
} from "../transcribe-preflight.js"
|
|
196
199
|
export type { PreflightGraphNode, PreflightGraphEdge, WordlessTranscriptFeed } from "../transcribe-preflight.js"
|
|
197
200
|
export {
|
|
@@ -222,6 +225,7 @@ export {
|
|
|
222
225
|
PHOTO_AUTO_ASPECT_NODE_TYPES,
|
|
223
226
|
nodeAspectRatio,
|
|
224
227
|
normalizeNodeModelParams,
|
|
228
|
+
withListedReferenceTaskTypes,
|
|
225
229
|
describeNodeAdjustments,
|
|
226
230
|
} from "../normalize-node-params.js"
|
|
227
231
|
export type { NodeParamAdjustment, NormalizedNodes } from "../normalize-node-params.js"
|
package/src/entries/pipeline.ts
CHANGED
|
@@ -40,4 +40,4 @@ export {
|
|
|
40
40
|
STUDIO_KEYFRAME_REVIEW_KEYS,
|
|
41
41
|
STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS,
|
|
42
42
|
} from "../studio-transient.js"
|
|
43
|
-
export { STUDIO_DEPENDENT_FRAMES_CAPABILITY, SequenceExecutionRequiredError, requiresSequenceExecution, assertCanvasExecutionAllowed } from "../sequence-execution"
|
|
43
|
+
export { STUDIO_DEPENDENT_FRAMES_CAPABILITY, SequenceExecutionRequiredError, requiresSequenceExecution, assertCanvasExecutionAllowed, isCodecOwnedDocument } from "../sequence-execution"
|
package/src/entries/video.ts
CHANGED
|
@@ -23,7 +23,7 @@ export {
|
|
|
23
23
|
VIDEO_CHARACTER_VOICE_EXAMPLE_MAX,
|
|
24
24
|
} from "../video-character-refs.js"
|
|
25
25
|
export type { VideoCharacterReference, VideoCharacterVoice, VideoCharacterRefProblem } from "../video-character-refs.js"
|
|
26
|
-
export { extractVideoDurationFromNode, editPlanSourceDurationSec } from "../video-duration.js"
|
|
26
|
+
export { CONTAINER_OVERHANG_SEC, extractVideoDurationFromNode, editPlanSourceDurationSec } from "../video-duration.js"
|
|
27
27
|
// --- Video URL node + social-video import (host allowlist, node output rule) ---
|
|
28
28
|
export {
|
|
29
29
|
SOCIAL_VIDEO_HOSTS,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FLUX 3 Klein: a text-to-image id and its edit sibling, priced by size alone
|
|
3
|
+
* (1K, 2K or 4K). An edit's reference images cost nothing extra, so the edit
|
|
4
|
+
* id has the same rows as the text-to-image id.
|
|
5
|
+
*
|
|
6
|
+
* Only the ids and levers live in this published package. The rates are
|
|
7
|
+
* `backend/src/ee/billing/flux-3-klein-pricing.ts`.
|
|
8
|
+
*
|
|
9
|
+
* A different model from FLUX 2 Klein (`flux-2-klein`, which runs elsewhere):
|
|
10
|
+
* neither id may join a set keyed on the FLUX 2 family (`isFlux2Model`).
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const FLUX_3_KLEIN_T2I = "flux-3-klein"
|
|
14
|
+
export const FLUX_3_KLEIN_I2I = "flux-3-klein-i2i"
|
|
15
|
+
export type Flux3KleinModel = typeof FLUX_3_KLEIN_T2I | typeof FLUX_3_KLEIN_I2I
|
|
16
|
+
|
|
17
|
+
/** The sizes it renders, smallest first. */
|
|
18
|
+
export const FLUX_3_KLEIN_RESOLUTIONS = ["1K", "2K", "4K"] as const
|
|
19
|
+
export type Flux3KleinResolution = (typeof FLUX_3_KLEIN_RESOLUTIONS)[number]
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The size a run renders when it names none: the provider's own default, and
|
|
23
|
+
* the size an unset or unknown value is priced and sent at.
|
|
24
|
+
*/
|
|
25
|
+
export const FLUX_3_KLEIN_DEFAULT_RESOLUTION: Flux3KleinResolution = "1K"
|
|
26
|
+
|
|
27
|
+
/** The most reference images one edit takes (`REF_IMAGE_MAX_LIMITS`). */
|
|
28
|
+
export const FLUX_3_KLEIN_MAX_INPUT_IMAGES = 10
|
|
29
|
+
|
|
30
|
+
export function isFlux3Klein(model: unknown): model is Flux3KleinModel {
|
|
31
|
+
return model === FLUX_3_KLEIN_T2I || model === FLUX_3_KLEIN_I2I
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function isFlux3KleinI2i(model: unknown): model is typeof FLUX_3_KLEIN_I2I {
|
|
35
|
+
return model === FLUX_3_KLEIN_I2I
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The size a FLUX 3 Klein run is priced and sent at: the one asked for when it
|
|
40
|
+
* is one of its sizes (any case), else the default. Unset is the default.
|
|
41
|
+
*/
|
|
42
|
+
export function flux3KleinResolution(resolution: unknown): Flux3KleinResolution {
|
|
43
|
+
const asked = typeof resolution === "string" ? resolution.trim().toUpperCase() : ""
|
|
44
|
+
return FLUX_3_KLEIN_RESOLUTIONS.find((r) => r === asked) ?? FLUX_3_KLEIN_DEFAULT_RESOLUTION
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The price id of a FLUX 3 Klein run: `flux-3-klein:<size>`, or
|
|
49
|
+
* `flux-3-klein-i2i:<size>` for an edit. The bare ids are never built here.
|
|
50
|
+
*
|
|
51
|
+
* A size off its list (a stored node, the multi-model preview pricing one
|
|
52
|
+
* node's data against every model) or none is priced at the default, 1K, which
|
|
53
|
+
* is what the provider renders with none. A text-to-image id sent any image
|
|
54
|
+
* runs on the edit endpoint (the KIE provider swaps it), so it is priced on the
|
|
55
|
+
* edit id whenever `referenceImageCount` is above 0. Every caller passes the
|
|
56
|
+
* images the run sends (`priceReadsInputImages` in `input-image-pricing.ts`: a
|
|
57
|
+
* base image, references, wired images, an entity's source), so the id priced
|
|
58
|
+
* is the id run. Both ids cost the same at each size.
|
|
59
|
+
*/
|
|
60
|
+
export function flux3KleinCreditId(
|
|
61
|
+
provider: Flux3KleinModel,
|
|
62
|
+
resolution: unknown,
|
|
63
|
+
referenceImageCount: number | undefined,
|
|
64
|
+
): string {
|
|
65
|
+
const size = flux3KleinResolution(resolution)
|
|
66
|
+
const images = Number.isFinite(referenceImageCount) ? Math.trunc(referenceImageCount as number) : 0
|
|
67
|
+
const model = provider === FLUX_3_KLEIN_I2I || images > 0 ? FLUX_3_KLEIN_I2I : FLUX_3_KLEIN_T2I
|
|
68
|
+
return `${model}:${size}`
|
|
69
|
+
}
|
package/src/freecut-protocol.ts
CHANGED
|
@@ -32,6 +32,14 @@ export interface NodaroLoadVideoPayload {
|
|
|
32
32
|
readonly videoBuffer?: ArrayBuffer
|
|
33
33
|
readonly projectJson?: unknown
|
|
34
34
|
readonly additionalFiles?: ReadonlyArray<FreecutImportFile>
|
|
35
|
+
/**
|
|
36
|
+
* What the editor's Save & Exit hands back. "video": it renders the timeline
|
|
37
|
+
* and answers with FREECUT_EXPORT_COMPLETE (the video and the project JSON),
|
|
38
|
+
* for a parent that keeps an edit as a new video (the workflow editor).
|
|
39
|
+
* Absent or "project": it answers with the project JSON alone
|
|
40
|
+
* (FREECUT_SAVE_EXIT), for a parent that renders the cut itself (Studio).
|
|
41
|
+
*/
|
|
42
|
+
readonly saveExit?: "video" | "project"
|
|
35
43
|
}
|
|
36
44
|
|
|
37
45
|
export interface NodaroLoadTimelinePayload {
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
* The image models whose price depends on how many input images a run sends:
|
|
3
3
|
* GPT Image 2.6 Flare and Sunburst, MiniMax H3 Image and Seedream 5.5. Every place that
|
|
4
4
|
* prices a run counts those images through here, so a model that joins
|
|
5
|
-
* `isPricedPerInputImage` is counted on every path at once.
|
|
5
|
+
* `isPricedPerInputImage` is counted on every path at once. FLUX 3 Klein is
|
|
6
|
+
* counted the same way (`priceReadsInputImages`): its price does not move with
|
|
7
|
+
* the images, but whether any go decides the id it runs, and is priced, on.
|
|
6
8
|
*/
|
|
7
9
|
import {
|
|
8
10
|
GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES,
|
|
@@ -11,6 +13,7 @@ import {
|
|
|
11
13
|
} from "./gpt-image-2-6.js"
|
|
12
14
|
import { isMinimaxH3Image, isMinimaxH3ImageI2i } from "./minimax-h3-image.js"
|
|
13
15
|
import { isSeedream55, isSeedream55I2i } from "./seedream-5-5.js"
|
|
16
|
+
import { isFlux3Klein } from "./flux-3-klein.js"
|
|
14
17
|
|
|
15
18
|
/** True for a model whose price counts the input images a run sends. */
|
|
16
19
|
export function isPricedPerInputImage(model: unknown): boolean {
|
|
@@ -22,11 +25,25 @@ export function isPricedPerInputImageEdit(model: unknown): boolean {
|
|
|
22
25
|
return typeof model === "string" && (isGptImage26I2i(model) || isMinimaxH3ImageI2i(model) || isSeedream55I2i(model))
|
|
23
26
|
}
|
|
24
27
|
|
|
28
|
+
/**
|
|
29
|
+
* True for a model whose price id reads the input images a run sends: one
|
|
30
|
+
* priced per input image ({@link isPricedPerInputImage}), or FLUX 3 Klein, which
|
|
31
|
+
* runs on its edit id whenever an image goes (its text-to-image endpoint takes
|
|
32
|
+
* none) and is priced on that id, at the same price. Every place that prices a
|
|
33
|
+
* run counts the images through {@link pricedSentImages} and
|
|
34
|
+
* {@link pricedEstimatedImages} for such a model, so the id priced is the id
|
|
35
|
+
* the provider runs.
|
|
36
|
+
*/
|
|
37
|
+
export function priceReadsInputImages(model: unknown): boolean {
|
|
38
|
+
return isPricedPerInputImage(model) || isFlux3Klein(model)
|
|
39
|
+
}
|
|
40
|
+
|
|
25
41
|
/**
|
|
26
42
|
* The images a Generate Image run sends its provider: its references and, when
|
|
27
43
|
* it edits a base image, that image too (the worker puts it first, unless it is
|
|
28
|
-
* already one of the references).
|
|
29
|
-
*
|
|
44
|
+
* already one of the references). The base is counted only on a model whose
|
|
45
|
+
* price reads the images ({@link priceReadsInputImages}); any other model is
|
|
46
|
+
* priced, and held to its image limit, on its references alone, as before.
|
|
30
47
|
*/
|
|
31
48
|
export function pricedSentImages(
|
|
32
49
|
provider: string | undefined,
|
|
@@ -34,7 +51,7 @@ export function pricedSentImages(
|
|
|
34
51
|
baseImageUrl: unknown,
|
|
35
52
|
): number {
|
|
36
53
|
const countsBase =
|
|
37
|
-
|
|
54
|
+
priceReadsInputImages(provider) &&
|
|
38
55
|
typeof baseImageUrl === "string" &&
|
|
39
56
|
baseImageUrl.length > 0 &&
|
|
40
57
|
!references.includes(baseImageUrl)
|
|
@@ -50,8 +67,8 @@ function namesMoodboard(direction: unknown): boolean {
|
|
|
50
67
|
}
|
|
51
68
|
|
|
52
69
|
/**
|
|
53
|
-
* The input images a workflow estimate counts for one node on a model
|
|
54
|
-
*
|
|
70
|
+
* The input images a workflow estimate counts for one node on a model whose
|
|
71
|
+
* price reads them ({@link priceReadsInputImages}): every list on the node, its source or base image, what is
|
|
55
72
|
* wired in, a moodboard its direction names (at the most a moodboard holds),
|
|
56
73
|
* and an edit model's own source. An estimate may over-quote, never under.
|
|
57
74
|
*/
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Lip Sync node's model-specific levers that a model may not take.
|
|
3
|
+
*
|
|
4
|
+
* OmniHuman 2.0 sits beside OmniHuman 1.5 but is not a superset of it: it has
|
|
5
|
+
* no resolution choice (always 720p), no fast mode and no seed (decided
|
|
6
|
+
* 2026-11-11). A node switched from 1.5 keeps those values in its data unless
|
|
7
|
+
* something clears them, and a node written straight into workflow JSON, an
|
|
8
|
+
* API body or an MCP call can carry them too. One table, read by every
|
|
9
|
+
* surface: the config panel (its dropdown and fail-safe effect), the quick
|
|
10
|
+
* strip's model switch, the lip-sync route and the workflow payload.
|
|
11
|
+
*
|
|
12
|
+
* Only models listed here lose anything: every other model's levers are left
|
|
13
|
+
* exactly as they were.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** The generic levers the Lip Sync node carries beside its inputs and prompt. */
|
|
17
|
+
export const LIP_SYNC_MODEL_LEVERS = ["resolution", "fastMode", "seed"] as const
|
|
18
|
+
export type LipSyncModelLever = typeof LIP_SYNC_MODEL_LEVERS[number]
|
|
19
|
+
|
|
20
|
+
const LEVERS_NOT_TAKEN: Readonly<Record<string, readonly LipSyncModelLever[]>> = {
|
|
21
|
+
"omnihuman-2-0": ["resolution", "fastMode", "seed"],
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** The levers `provider` does not take (none for a model this table does not list). */
|
|
25
|
+
export function lipSyncLeversNotTaken(provider: unknown): readonly LipSyncModelLever[] {
|
|
26
|
+
return typeof provider === "string" && Object.prototype.hasOwnProperty.call(LEVERS_NOT_TAKEN, provider)
|
|
27
|
+
? LEVERS_NOT_TAKEN[provider]!
|
|
28
|
+
: []
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Does `provider` take this lever? */
|
|
32
|
+
export function lipSyncTakesLever(provider: unknown, lever: LipSyncModelLever): boolean {
|
|
33
|
+
return !lipSyncLeversNotTaken(provider).includes(lever)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A patch that clears every lever `provider` does not take and `data` still
|
|
38
|
+
* holds (each written as `undefined`). Empty when there is nothing to clear,
|
|
39
|
+
* so a caller can skip the write.
|
|
40
|
+
*/
|
|
41
|
+
export function lipSyncLeverClearPatch(
|
|
42
|
+
provider: unknown,
|
|
43
|
+
data: Readonly<Record<string, unknown>>,
|
|
44
|
+
): Partial<Record<LipSyncModelLever, undefined>> {
|
|
45
|
+
const patch: Partial<Record<LipSyncModelLever, undefined>> = {}
|
|
46
|
+
for (const lever of lipSyncLeversNotTaken(provider)) {
|
|
47
|
+
if (data[lever] !== undefined) patch[lever] = undefined
|
|
48
|
+
}
|
|
49
|
+
return patch
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** `data` without the levers `provider` does not take: a copy when any was dropped, else `data` itself. */
|
|
53
|
+
export function withoutLipSyncLeversNotTaken<T extends Readonly<Record<string, unknown>>>(provider: unknown, data: T): T {
|
|
54
|
+
const patch = lipSyncLeverClearPatch(provider, data)
|
|
55
|
+
return Object.keys(patch).length === 0 ? data : { ...data, ...patch }
|
|
56
|
+
}
|
package/src/lip-sync-pricing.ts
CHANGED
|
@@ -7,7 +7,78 @@
|
|
|
7
7
|
* (e.g. `kling-avatar:60s`) so credit reservation scales with input length.
|
|
8
8
|
*
|
|
9
9
|
* InfiniTalk still enforces a 15s upstream cap.
|
|
10
|
+
*
|
|
11
|
+
* A model listed in {@link LIP_SYNC_AUDIO_RATES} is priced differently: at a
|
|
12
|
+
* per-second RATE times the seconds of its audio, never by bucket.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { unitQuoteCreditId } from "./credit-estimators/unit-quote.js"
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A lip-sync model charged at a per-second rate: the rate's one-second price
|
|
19
|
+
* row times the seconds of the audio that drives it, rounded up once and marked
|
|
20
|
+
* up once by the pricing chain that charges every per-unit rate.
|
|
21
|
+
*/
|
|
22
|
+
export interface LipSyncAudioRate {
|
|
23
|
+
/** The one-second price row (`model_pricing`, else `STATIC_CREDIT_COSTS`). */
|
|
24
|
+
readonly rateId: string
|
|
25
|
+
/** The fewest seconds a run is charged. Shorter audio is padded with silence to this length before the model sees it. */
|
|
26
|
+
readonly minSeconds: number
|
|
27
|
+
/** The longest audio the model takes. Longer audio is refused before anything is held. */
|
|
28
|
+
readonly maxSeconds: number
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** OmniHuman 2.0's one-second price row. */
|
|
32
|
+
export const OMNIHUMAN_2_0_PER_SECOND_CREDIT_ID = "omnihuman-2-0:per-second"
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The lip-sync models charged per second of audio at a rate (decided
|
|
36
|
+
* 2026-11-11 for OmniHuman 2.0). Every price of such a run, its quote and its
|
|
37
|
+
* hold are the rate × {@link lipSyncBilledSeconds}.
|
|
38
|
+
*/
|
|
39
|
+
export const LIP_SYNC_AUDIO_RATES: Readonly<Record<string, LipSyncAudioRate>> = {
|
|
40
|
+
// OmniHuman 2.0 (KIE): audio from 4 to 300 seconds; the output is as long as the audio.
|
|
41
|
+
"omnihuman-2-0": { rateId: OMNIHUMAN_2_0_PER_SECOND_CREDIT_ID, minSeconds: 4, maxSeconds: 300 },
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** The per-second rate a lip-sync model is charged at, or undefined for every model priced another way. */
|
|
45
|
+
export function lipSyncAudioRateOf(provider: unknown): LipSyncAudioRate | undefined {
|
|
46
|
+
return typeof provider === "string" && Object.prototype.hasOwnProperty.call(LIP_SYNC_AUDIO_RATES, provider)
|
|
47
|
+
? LIP_SYNC_AUDIO_RATES[provider]
|
|
48
|
+
: undefined
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The seconds a run of a per-second-rate model is charged for audio measured at
|
|
53
|
+
* `measuredSec`: rounded up to a whole second, and at least the rate's minimum.
|
|
54
|
+
* THE one place this rounding happens — the route, the workflow run, the
|
|
55
|
+
* estimates and the provider's own cost all read it. Pass the length of the
|
|
56
|
+
* audio as it was given, never of a copy padded to the minimum (a padded clip
|
|
57
|
+
* runs a hair past it and would round up a whole second more).
|
|
58
|
+
*/
|
|
59
|
+
export function lipSyncBilledSeconds(rate: LipSyncAudioRate, measuredSec: number): number {
|
|
60
|
+
if (!Number.isFinite(measuredSec) || measuredSec <= 0) return rate.minSeconds
|
|
61
|
+
return Math.max(rate.minSeconds, Math.ceil(measuredSec))
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The length the editor quotes a lip-sync run on while its audio's length is
|
|
66
|
+
* not known yet — the 15 seconds every model priced by its audio shows then
|
|
67
|
+
* (a bucketed model's `:15s` row), marked as an estimate.
|
|
10
68
|
*/
|
|
69
|
+
export const LIP_SYNC_UNMEASURED_ESTIMATE_SECONDS = 15
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The seconds an ESTIMATE prices a per-second-rate run at: the billed seconds
|
|
73
|
+
* of the audio when its length is known (at most the model's maximum, the most
|
|
74
|
+
* a run can be charged), else `unknownSec` — by default the maximum, so a
|
|
75
|
+
* server estimate never quotes below what the run may hold; the editor passes
|
|
76
|
+
* {@link LIP_SYNC_UNMEASURED_ESTIMATE_SECONDS} and shows the figure as an estimate.
|
|
77
|
+
*/
|
|
78
|
+
export function lipSyncEstimateSeconds(rate: LipSyncAudioRate, knownSec: number | undefined, unknownSec: number = rate.maxSeconds): number {
|
|
79
|
+
if (knownSec === undefined || !Number.isFinite(knownSec) || knownSec <= 0) return lipSyncBilledSeconds(rate, unknownSec)
|
|
80
|
+
return lipSyncBilledSeconds(rate, Math.min(knownSec, rate.maxSeconds))
|
|
81
|
+
}
|
|
11
82
|
|
|
12
83
|
export const LIP_SYNC_DURATION_BUCKETS = [15, 30, 60, 120, 300] as const
|
|
13
84
|
|
|
@@ -42,13 +113,32 @@ export const LIP_SYNC_MAX_AUDIO_SECONDS: Record<string, number> = {
|
|
|
42
113
|
"sync-lipsync-v3": 300,
|
|
43
114
|
// Volcengine (KIE) — video-to-video dubbing, per-second, 5-min ceiling.
|
|
44
115
|
"volcengine-lipsync": 300,
|
|
116
|
+
// The per-second-rate models: their own maximum (longer audio is refused, never trimmed).
|
|
117
|
+
...Object.fromEntries(Object.entries(LIP_SYNC_AUDIO_RATES).map(([provider, rate]) => [provider, rate.maxSeconds])),
|
|
45
118
|
}
|
|
46
119
|
|
|
47
120
|
export function getLipSyncMaxAudioSeconds(provider: string): number {
|
|
48
121
|
return LIP_SYNC_MAX_AUDIO_SECONDS[provider] ?? 15
|
|
49
122
|
}
|
|
50
123
|
|
|
51
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* The id whose price is a 15-second run of a lip-sync model priced by the
|
|
126
|
+
* length of its audio — the bucket row of a bucketed model (`<provider>:15s`),
|
|
127
|
+
* the 15-second quote of a per-second-rate model — or undefined for a model
|
|
128
|
+
* with one price. A model menu shows a per-second rate from it.
|
|
129
|
+
*/
|
|
130
|
+
export function lipSyncFifteenSecondCreditId(provider: string): string | undefined {
|
|
131
|
+
const rate = lipSyncAudioRateOf(provider)
|
|
132
|
+
if (rate) return unitQuoteCreditId(rate.rateId, LIP_SYNC_UNMEASURED_ESTIMATE_SECONDS)
|
|
133
|
+
return isPerSecondLipSyncProvider(provider) ? `${provider}:${LIP_SYNC_UNMEASURED_ESTIMATE_SECONDS}s` : undefined
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Providers whose credit cost varies with audio duration, priced by BUCKET
|
|
138
|
+
* (`<provider>:<bucket>s`). A model charged at a per-second rate
|
|
139
|
+
* ({@link LIP_SYNC_AUDIO_RATES}) is never listed here: every caller that
|
|
140
|
+
* branches on this set would bucket it.
|
|
141
|
+
*/
|
|
52
142
|
const PER_SECOND_LIP_SYNC_PROVIDERS = new Set([
|
|
53
143
|
"kling-avatar",
|
|
54
144
|
"kling-avatar-pro",
|