@nodaro/shared 3.70.0 → 3.72.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-M7LU4NTI.cjs → chunk-26GM45QE.cjs} +18 -2
- package/dist/chunk-26GM45QE.cjs.map +1 -0
- package/dist/{chunk-PWIKUOLB.cjs → chunk-32QY5AIY.cjs} +8 -8
- package/dist/{chunk-PWIKUOLB.cjs.map → chunk-32QY5AIY.cjs.map} +1 -1
- package/dist/{chunk-4U7QAUV3.cjs → chunk-4BCODXK6.cjs} +61 -61
- package/dist/{chunk-4U7QAUV3.cjs.map → chunk-4BCODXK6.cjs.map} +1 -1
- package/dist/{chunk-DOY47F7S.cjs → chunk-5WXVPPRH.cjs} +7 -7
- package/dist/{chunk-DOY47F7S.cjs.map → chunk-5WXVPPRH.cjs.map} +1 -1
- package/dist/{chunk-NS34PZ2S.js → chunk-7DMK7B3Q.js} +3 -3
- package/dist/{chunk-NS34PZ2S.js.map → chunk-7DMK7B3Q.js.map} +1 -1
- package/dist/{chunk-5DRSENY3.cjs → chunk-AIPOZKQV.cjs} +14 -12
- package/dist/{chunk-PKWRAMVB.js.map → chunk-AIPOZKQV.cjs.map} +1 -1
- package/dist/{chunk-HWBLZSM3.cjs → chunk-AXDTMRWR.cjs} +51 -28
- package/dist/chunk-AXDTMRWR.cjs.map +1 -0
- package/dist/{chunk-OW5AXH2Y.js → chunk-CL7ECTK2.js} +5 -4
- package/dist/chunk-CL7ECTK2.js.map +1 -0
- package/dist/{chunk-KKFFQUMM.js → chunk-D5NRBVUH.js} +5 -5
- package/dist/chunk-D5NRBVUH.js.map +1 -0
- package/dist/{chunk-52JNQG4K.js → chunk-D7DCDIMU.js} +3 -3
- package/dist/{chunk-52JNQG4K.js.map → chunk-D7DCDIMU.js.map} +1 -1
- package/dist/{chunk-HW6TLOK4.cjs → chunk-DRPHRE4J.cjs} +2 -2
- package/dist/{chunk-HW6TLOK4.cjs.map → chunk-DRPHRE4J.cjs.map} +1 -1
- package/dist/{chunk-PKWRAMVB.js → chunk-EI4V43DI.js} +7 -5
- package/dist/chunk-EI4V43DI.js.map +1 -0
- package/dist/{chunk-EWNDK4FV.js → chunk-EOYQD6DU.js} +3 -3
- package/dist/{chunk-EWNDK4FV.js.map → chunk-EOYQD6DU.js.map} +1 -1
- package/dist/{chunk-HA2PVTER.js → chunk-GCOS7CFL.js} +4 -4
- package/dist/{chunk-HA2PVTER.js.map → chunk-GCOS7CFL.js.map} +1 -1
- package/dist/{chunk-XBHDXURR.cjs → chunk-HJGL2UNQ.cjs} +78 -78
- package/dist/chunk-HJGL2UNQ.cjs.map +1 -0
- package/dist/{chunk-HBRDKHIW.cjs → chunk-HOQ4TLDW.cjs} +21 -21
- package/dist/{chunk-HBRDKHIW.cjs.map → chunk-HOQ4TLDW.cjs.map} +1 -1
- package/dist/{chunk-POZBRZUM.cjs → chunk-I2GFLOLD.cjs} +41 -41
- package/dist/{chunk-POZBRZUM.cjs.map → chunk-I2GFLOLD.cjs.map} +1 -1
- package/dist/{chunk-LTBM2KMY.js → chunk-INJP7EFI.js} +235 -9
- package/dist/chunk-INJP7EFI.js.map +1 -0
- package/dist/{chunk-BLGZW3UF.cjs → chunk-JUCWBIEE.cjs} +291 -20
- package/dist/chunk-JUCWBIEE.cjs.map +1 -0
- package/dist/{chunk-JEUZNHLL.cjs → chunk-L2WHTUBA.cjs} +40 -34
- package/dist/chunk-L2WHTUBA.cjs.map +1 -0
- package/dist/{chunk-V6TC2NDG.js → chunk-LMBHF5TZ.js} +4 -4
- package/dist/{chunk-V6TC2NDG.js.map → chunk-LMBHF5TZ.js.map} +1 -1
- package/dist/{chunk-QCVQVKCI.js → chunk-LP5KZZAF.js} +3 -3
- package/dist/{chunk-QCVQVKCI.js.map → chunk-LP5KZZAF.js.map} +1 -1
- package/dist/{chunk-42ICEVUN.js → chunk-M4MXK7RJ.js} +3 -3
- package/dist/{chunk-42ICEVUN.js.map → chunk-M4MXK7RJ.js.map} +1 -1
- package/dist/{chunk-BIQ7COJP.js → chunk-MR4KSZY3.js} +5 -5
- package/dist/{chunk-BIQ7COJP.js.map → chunk-MR4KSZY3.js.map} +1 -1
- package/dist/{chunk-OZHE77T3.cjs → chunk-NEBO32KZ.cjs} +9 -9
- package/dist/{chunk-OZHE77T3.cjs.map → chunk-NEBO32KZ.cjs.map} +1 -1
- package/dist/{chunk-MZ772ZXA.cjs → chunk-NSKH5ULV.cjs} +17 -17
- package/dist/{chunk-MZ772ZXA.cjs.map → chunk-NSKH5ULV.cjs.map} +1 -1
- package/dist/{chunk-QV32JI4L.cjs → chunk-OALWH5VV.cjs} +4 -4
- package/dist/{chunk-QV32JI4L.cjs.map → chunk-OALWH5VV.cjs.map} +1 -1
- package/dist/{chunk-IKN54UGB.js → chunk-OWNGS4DF.js} +3 -3
- package/dist/{chunk-IKN54UGB.js.map → chunk-OWNGS4DF.js.map} +1 -1
- package/dist/{chunk-FWPGRC4X.cjs → chunk-QFW25UCC.cjs} +5 -5
- package/dist/{chunk-FWPGRC4X.cjs.map → chunk-QFW25UCC.cjs.map} +1 -1
- package/dist/{chunk-FMQ43SJP.cjs → chunk-QVRAPR4D.cjs} +6 -6
- package/dist/{chunk-FMQ43SJP.cjs.map → chunk-QVRAPR4D.cjs.map} +1 -1
- package/dist/{chunk-PYYYBINP.cjs → chunk-RMDTBXYT.cjs} +6 -6
- package/dist/{chunk-PYYYBINP.cjs.map → chunk-RMDTBXYT.cjs.map} +1 -1
- package/dist/{chunk-O53P2D4V.js → chunk-SXDLBXSB.js} +9 -5
- package/dist/chunk-SXDLBXSB.js.map +1 -0
- package/dist/{chunk-YLDY23N2.js → chunk-U7PHAD2O.js} +5 -5
- package/dist/{chunk-YLDY23N2.js.map → chunk-U7PHAD2O.js.map} +1 -1
- package/dist/{chunk-TADEEG5E.js → chunk-UC3CMPDN.js} +18 -3
- package/dist/chunk-UC3CMPDN.js.map +1 -0
- package/dist/{chunk-QCZYYAPZ.cjs → chunk-UMUSJHH2.cjs} +48 -48
- package/dist/{chunk-QCZYYAPZ.cjs.map → chunk-UMUSJHH2.cjs.map} +1 -1
- package/dist/{chunk-H2E4QXEZ.js → chunk-VVLW63HD.js} +3 -3
- package/dist/{chunk-H2E4QXEZ.js.map → chunk-VVLW63HD.js.map} +1 -1
- package/dist/{chunk-HP3YIWNJ.js → chunk-WARGPM7P.js} +2 -2
- package/dist/{chunk-HP3YIWNJ.js.map → chunk-WARGPM7P.js.map} +1 -1
- package/dist/{chunk-QVAUBB2T.js → chunk-WXJMPWYR.js} +9 -9
- package/dist/{chunk-QVAUBB2T.js.map → chunk-WXJMPWYR.js.map} +1 -1
- package/dist/{chunk-R22UHRR6.js → chunk-X7UDZGXW.js} +51 -28
- package/dist/chunk-X7UDZGXW.js.map +1 -0
- package/dist/{chunk-2VOXSVIE.js → chunk-XEMEUKXK.js} +3 -3
- package/dist/{chunk-2VOXSVIE.js.map → chunk-XEMEUKXK.js.map} +1 -1
- package/dist/{chunk-GC77W57T.cjs → chunk-YHDTBO45.cjs} +9 -9
- package/dist/{chunk-GC77W57T.cjs.map → chunk-YHDTBO45.cjs.map} +1 -1
- package/dist/{chunk-WHV7MDNC.cjs → chunk-ZJQ2L3MI.cjs} +5 -3
- package/dist/chunk-ZJQ2L3MI.cjs.map +1 -0
- package/dist/entries/apps.cjs +42 -42
- package/dist/entries/apps.js +7 -7
- package/dist/entries/credits.cjs +418 -238
- package/dist/entries/credits.d.cts +263 -2
- package/dist/entries/credits.d.ts +263 -2
- package/dist/entries/credits.js +9 -9
- package/dist/entries/edl.cjs +60 -60
- package/dist/entries/edl.d.cts +96 -1
- package/dist/entries/edl.d.ts +96 -1
- package/dist/entries/edl.js +1 -1
- package/dist/entries/i18n.cjs +15 -11
- package/dist/entries/i18n.d.cts +19 -1
- package/dist/entries/i18n.d.ts +19 -1
- package/dist/entries/i18n.js +1 -1
- package/dist/entries/llm-models.d.cts +1 -1
- package/dist/entries/llm-models.d.ts +1 -1
- package/dist/entries/model-catalog.cjs +133 -133
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +412 -404
- package/dist/entries/models.d.cts +2 -2
- package/dist/entries/models.d.ts +2 -2
- package/dist/entries/models.js +5 -5
- package/dist/entries/nodes.cjs +212 -212
- package/dist/entries/nodes.js +8 -8
- 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 +195 -191
- package/dist/entries/social.d.cts +9 -3
- package/dist/entries/social.d.ts +9 -3
- package/dist/entries/social.js +1 -1
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +152 -152
- package/dist/entries/video.js +6 -6
- package/dist/index.cjs +1835 -1639
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +21 -21
- package/dist/{model-constants-CQr_d3Kw.d.cts → model-constants-C4RL9Xtn.d.cts} +20 -4
- package/dist/{model-constants-B5DNHIP8.d.ts → model-constants-kRg3YCIJ.d.ts} +20 -4
- package/dist/style.ar-4WUT56YH.js +63 -0
- package/dist/style.ar-4WUT56YH.js.map +1 -0
- package/dist/style.ar-ZRS6ZSSS.cjs +65 -0
- package/dist/style.ar-ZRS6ZSSS.cjs.map +1 -0
- package/dist/style.de-6543OVTB.cjs +65 -0
- package/dist/style.de-6543OVTB.cjs.map +1 -0
- package/dist/style.de-HQS4NOVN.js +63 -0
- package/dist/style.de-HQS4NOVN.js.map +1 -0
- package/dist/style.es-ADFPO6LM.cjs +65 -0
- package/dist/style.es-ADFPO6LM.cjs.map +1 -0
- package/dist/style.es-O4N36TIJ.js +63 -0
- package/dist/style.es-O4N36TIJ.js.map +1 -0
- package/dist/style.fr-A3ZO6BP3.cjs +65 -0
- package/dist/style.fr-A3ZO6BP3.cjs.map +1 -0
- package/dist/style.fr-XKYO3NOK.js +63 -0
- package/dist/style.fr-XKYO3NOK.js.map +1 -0
- package/dist/style.he-DI4PXGJG.cjs +65 -0
- package/dist/style.he-DI4PXGJG.cjs.map +1 -0
- package/dist/style.he-L4SD3G7D.js +63 -0
- package/dist/style.he-L4SD3G7D.js.map +1 -0
- package/dist/style.hi-K625E6UR.js +63 -0
- package/dist/style.hi-K625E6UR.js.map +1 -0
- package/dist/style.hi-LMDM6S3Q.cjs +65 -0
- package/dist/style.hi-LMDM6S3Q.cjs.map +1 -0
- package/dist/style.ja-3YGEMQKQ.js +63 -0
- package/dist/style.ja-3YGEMQKQ.js.map +1 -0
- package/dist/style.ja-QV4Z4B3Y.cjs +65 -0
- package/dist/style.ja-QV4Z4B3Y.cjs.map +1 -0
- package/dist/style.ko-KIKAE2WS.js +63 -0
- package/dist/style.ko-KIKAE2WS.js.map +1 -0
- package/dist/style.ko-WXYT3ZAL.cjs +65 -0
- package/dist/style.ko-WXYT3ZAL.cjs.map +1 -0
- package/dist/style.pt-BR-R6WOR67L.js +64 -0
- package/dist/style.pt-BR-R6WOR67L.js.map +1 -0
- package/dist/style.pt-BR-WWGO7RUX.cjs +66 -0
- package/dist/style.pt-BR-WWGO7RUX.cjs.map +1 -0
- package/dist/style.ru-UVLIITMR.js +63 -0
- package/dist/style.ru-UVLIITMR.js.map +1 -0
- package/dist/style.ru-ZCB4IUCW.cjs +65 -0
- package/dist/style.ru-ZCB4IUCW.cjs.map +1 -0
- package/dist/style.zh-CN-IFAAZ475.cjs +65 -0
- package/dist/style.zh-CN-IFAAZ475.cjs.map +1 -0
- package/dist/style.zh-CN-RQEZCV44.js +63 -0
- package/dist/style.zh-CN-RQEZCV44.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/audio-isolation-pricing.test.ts +49 -0
- package/src/__tests__/competitors.test.ts +6 -1
- package/src/__tests__/credit-identifiers.test.ts +9 -10
- package/src/__tests__/motion-transfer-pricing.test.ts +252 -0
- package/src/__tests__/normalize-node-params.test.ts +9 -2
- package/src/__tests__/style-sidecar-loaders.test.ts +29 -0
- package/src/__tests__/video-catalog-totality.test.ts +37 -5
- package/src/__tests__/video-to-video-pricing.test.ts +151 -0
- package/src/audio-isolation-pricing.ts +80 -0
- package/src/competitors.ts +8 -2
- package/src/credit-identifiers.ts +6 -0
- package/src/entries/credits.ts +54 -0
- package/src/entries/edl.ts +2 -0
- package/src/entries/i18n.ts +1 -0
- package/src/entries/models.ts +2 -0
- package/src/entries/social.ts +1 -0
- package/src/i18n/style-sidecar-loaders.ts +30 -0
- package/src/model-catalog.ts +49 -23
- package/src/model-constants.ts +24 -4
- package/src/motion-transfer-pricing.ts +239 -0
- package/src/producer-types.ts +2 -0
- package/src/use-case-output.ts +102 -0
- package/src/video-to-video-pricing.ts +248 -0
- package/dist/chunk-5DRSENY3.cjs.map +0 -1
- package/dist/chunk-BLGZW3UF.cjs.map +0 -1
- package/dist/chunk-HWBLZSM3.cjs.map +0 -1
- package/dist/chunk-JEUZNHLL.cjs.map +0 -1
- package/dist/chunk-KKFFQUMM.js.map +0 -1
- package/dist/chunk-LTBM2KMY.js.map +0 -1
- package/dist/chunk-M7LU4NTI.cjs.map +0 -1
- package/dist/chunk-O53P2D4V.js.map +0 -1
- package/dist/chunk-OW5AXH2Y.js.map +0 -1
- package/dist/chunk-R22UHRR6.js.map +0 -1
- package/dist/chunk-TADEEG5E.js.map +0 -1
- package/dist/chunk-WHV7MDNC.cjs.map +0 -1
- package/dist/chunk-XBHDXURR.cjs.map +0 -1
package/src/entries/credits.ts
CHANGED
|
@@ -120,6 +120,60 @@ export {
|
|
|
120
120
|
LIP_SYNC_UNMEASURED_ESTIMATE_SECONDS,
|
|
121
121
|
} from "../lip-sync-pricing.js"
|
|
122
122
|
export type { LipSyncDurationBucket, LipSyncAudioRate } from "../lip-sync-pricing.js"
|
|
123
|
+
export {
|
|
124
|
+
MOTION_TRANSFER_MIN_SEC,
|
|
125
|
+
MOTION_TRANSFER_IMAGE_ORIENTATION_MAX_SEC,
|
|
126
|
+
MOTION_TRANSFER_MAX_SEC,
|
|
127
|
+
MOTION_TRANSFER_SECOND_RATES,
|
|
128
|
+
MOTION_TRANSFER_RATE_IDS,
|
|
129
|
+
MOTION_TRANSFER_FLOOR_IDS,
|
|
130
|
+
motionTransferOrientation,
|
|
131
|
+
motionTransferMaxSec,
|
|
132
|
+
motionTransferRateOf,
|
|
133
|
+
motionTransferBilledSeconds,
|
|
134
|
+
motionTransferPrice,
|
|
135
|
+
motionTransferChargedPrice,
|
|
136
|
+
motionTransferBaseCharge,
|
|
137
|
+
checkMotionTransferLength,
|
|
138
|
+
motionTransferEstimateSeconds,
|
|
139
|
+
motionTransferEstimatePrice,
|
|
140
|
+
} from "../motion-transfer-pricing.js"
|
|
141
|
+
export type { MotionTransferSecondRate, MotionTransferPrice, MotionTransferLengthCheck } from "../motion-transfer-pricing.js"
|
|
142
|
+
export {
|
|
143
|
+
CLIP_PRICED_V2V_PROVIDERS,
|
|
144
|
+
HAPPYHORSE_EDIT_MIN_SEC,
|
|
145
|
+
HAPPYHORSE_EDIT_MAX_SEC,
|
|
146
|
+
WAN_VIDEOEDIT_MIN_SEC,
|
|
147
|
+
WAN_VIDEOEDIT_MAX_SEC,
|
|
148
|
+
WAN_VIDEOEDIT_FLOOR_CREDIT_ID,
|
|
149
|
+
V2V_CLIP_RATES,
|
|
150
|
+
V2V_CLIP_RATE_IDS,
|
|
151
|
+
isClipPricedV2vProvider,
|
|
152
|
+
v2vSeededRowCredits,
|
|
153
|
+
videoToVideoClipMinSec,
|
|
154
|
+
videoToVideoClipMaxSec,
|
|
155
|
+
videoToVideoSentResolution,
|
|
156
|
+
videoToVideoClipRateOf,
|
|
157
|
+
videoToVideoBilledSeconds,
|
|
158
|
+
checkVideoToVideoClipLength,
|
|
159
|
+
videoToVideoClipPrice,
|
|
160
|
+
wanVideoEditRateFromSeconds,
|
|
161
|
+
videoToVideoEstimateSeconds,
|
|
162
|
+
videoToVideoEstimatePrice,
|
|
163
|
+
} from "../video-to-video-pricing.js"
|
|
164
|
+
export type { ClipPricedV2vProvider, V2vClipRate, V2vClipLengthCheck, V2vClipPrice } from "../video-to-video-pricing.js"
|
|
165
|
+
export {
|
|
166
|
+
AUDIO_ISOLATION_RATE_ID,
|
|
167
|
+
AUDIO_ISOLATION_RATE_SECONDS,
|
|
168
|
+
AUDIO_ISOLATION_MAX_SEC,
|
|
169
|
+
AUDIO_ISOLATION_MAX_BYTES,
|
|
170
|
+
AUDIO_ISOLATION_MAX_UNITS,
|
|
171
|
+
audioIsolationUnits,
|
|
172
|
+
audioIsolationTooLongMessage,
|
|
173
|
+
checkAudioIsolationLength,
|
|
174
|
+
audioIsolationEstimateUnits,
|
|
175
|
+
} from "../audio-isolation-pricing.js"
|
|
176
|
+
export type { AudioIsolationLengthCheck } from "../audio-isolation-pricing.js"
|
|
123
177
|
export {
|
|
124
178
|
SEEDANCE_LIP_SYNC_SECONDS,
|
|
125
179
|
isSeedanceLipSyncProvider,
|
package/src/entries/edl.ts
CHANGED
|
@@ -42,3 +42,5 @@ export * from "../speaker-map-contract.js"
|
|
|
42
42
|
export * from "../edit-plan-contract.js"
|
|
43
43
|
// A person's review of an Edit Plan (`editedEdl`) and the one resolver that applies it.
|
|
44
44
|
export * from "../edit-plan-review.js"
|
|
45
|
+
// What a podcast use-case run reports on its job's output_data (clip spans, trailer moments, speakers).
|
|
46
|
+
export * from "../use-case-output.js"
|
package/src/entries/i18n.ts
CHANGED
package/src/entries/models.ts
CHANGED
|
@@ -86,6 +86,8 @@ export {
|
|
|
86
86
|
isSeedanceVideoEditProvider,
|
|
87
87
|
VIDEO_TO_VIDEO_NODE_PROVIDERS,
|
|
88
88
|
DEFAULT_VIDEO_TO_VIDEO_PROVIDER,
|
|
89
|
+
QUEUED_VIDEO_TO_VIDEO_JOB_PROVIDER,
|
|
90
|
+
videoToVideoProviderOf,
|
|
89
91
|
SEEDANCE_VIDEO_EDIT_SHAPE,
|
|
90
92
|
SEEDANCE_VIDEO_EDIT_TASK_TYPE,
|
|
91
93
|
FACE_SWAP_PROVIDERS,
|
package/src/entries/social.ts
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loaders of the `style` catalog's locale sidecars, for a host with no
|
|
3
|
+
* bundler glob of its own (a Node server): the same files a Vite app hands to
|
|
4
|
+
* `registerSidecarLoaders` through `import.meta.glob`, each still its own lazy
|
|
5
|
+
* chunk, so nothing here grows a bundle that does not ask for a locale.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* registerSidecarLoaders(STYLE_SIDECAR_LOADERS)
|
|
9
|
+
* await ensureLocaleCatalogLoaded("style", locale)
|
|
10
|
+
* resolveLabel("style", id, englishLabel, locale)
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Keys are the sidecars' file names as `registerSidecarLoaders` matches them
|
|
14
|
+
* (`"./style.<locale>.ts"`), one per non-English language (a test holds this).
|
|
15
|
+
*/
|
|
16
|
+
import type { SidecarLoader } from "./index.js"
|
|
17
|
+
|
|
18
|
+
export const STYLE_SIDECAR_LOADERS: Readonly<Record<string, SidecarLoader>> = {
|
|
19
|
+
"./style.ar.ts": () => import("./style.ar.js"),
|
|
20
|
+
"./style.de.ts": () => import("./style.de.js"),
|
|
21
|
+
"./style.es.ts": () => import("./style.es.js"),
|
|
22
|
+
"./style.fr.ts": () => import("./style.fr.js"),
|
|
23
|
+
"./style.he.ts": () => import("./style.he.js"),
|
|
24
|
+
"./style.hi.ts": () => import("./style.hi.js"),
|
|
25
|
+
"./style.ja.ts": () => import("./style.ja.js"),
|
|
26
|
+
"./style.ko.ts": () => import("./style.ko.js"),
|
|
27
|
+
"./style.pt-BR.ts": () => import("./style.pt-BR.js"),
|
|
28
|
+
"./style.ru.ts": () => import("./style.ru.js"),
|
|
29
|
+
"./style.zh-CN.ts": () => import("./style.zh-CN.js"),
|
|
30
|
+
}
|
package/src/model-catalog.ts
CHANGED
|
@@ -61,6 +61,9 @@ export type ModelMode =
|
|
|
61
61
|
// video
|
|
62
62
|
| "i2v"
|
|
63
63
|
| "t2v"
|
|
64
|
+
// v2v: the model EDITS the clip it is given. It is what an "edit" list
|
|
65
|
+
// reads, so a Video to Video provider that makes a new clip from the
|
|
66
|
+
// input's subject instead (Wan 2.6, Wan 2.6 Flash) does not carry it.
|
|
64
67
|
| "v2v"
|
|
65
68
|
| "extend"
|
|
66
69
|
| "motion-transfer"
|
|
@@ -3188,15 +3191,19 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
3188
3191
|
"wan": {
|
|
3189
3192
|
id: "wan",
|
|
3190
3193
|
kind: "video",
|
|
3191
|
-
// "wan" id covers
|
|
3192
|
-
// pricing variants tag which
|
|
3193
|
-
|
|
3194
|
+
// "wan" id covers text-to-video AND the Video to Video route under
|
|
3195
|
+
// different KIE endpoints; the pricing variants tag which each cost
|
|
3196
|
+
// belongs to. No "v2v" mode on purpose: that mode lists the models that
|
|
3197
|
+
// EDIT a clip, and this one makes a new clip featuring the input video's
|
|
3198
|
+
// subject. It stays a Video to Video provider (VIDEO_TO_VIDEO_PROVIDERS)
|
|
3199
|
+
// and is picked there by its id.
|
|
3200
|
+
modes: ["t2v"] as const,
|
|
3194
3201
|
family: "Alibaba",
|
|
3195
3202
|
maker: "alibaba",
|
|
3196
3203
|
label: "Wan 2.6",
|
|
3197
3204
|
series: "Wan",
|
|
3198
|
-
description: "Wan 2.6 — text-to-video and video-to-video under a single id.",
|
|
3199
|
-
useCases: ["v2v", "t2v", "
|
|
3205
|
+
description: "Wan 2.6 — text-to-video and video-to-video under a single id. Its video-to-video makes a new clip featuring the subject of the input video, in the scene the prompt describes; it does not edit or restyle the clip.",
|
|
3206
|
+
useCases: ["v2v", "t2v", "reference"],
|
|
3200
3207
|
durations: [5],
|
|
3201
3208
|
defaultDuration: 5,
|
|
3202
3209
|
resolutions: ["720p", "1080p"],
|
|
@@ -3208,12 +3215,15 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
3208
3215
|
"wan-flash": {
|
|
3209
3216
|
id: "wan-flash",
|
|
3210
3217
|
kind: "video",
|
|
3211
|
-
|
|
3218
|
+
// No mode on purpose: "v2v" lists the models that EDIT a clip, and this
|
|
3219
|
+
// one makes a new clip featuring the input video's subject. It runs only
|
|
3220
|
+
// on the Video to Video route (VIDEO_TO_VIDEO_PROVIDERS), picked by its id.
|
|
3221
|
+
modes: [] as const,
|
|
3212
3222
|
family: "Alibaba",
|
|
3213
3223
|
maker: "alibaba",
|
|
3214
|
-
label: "Wan Flash
|
|
3224
|
+
label: "Wan 2.6 Flash",
|
|
3215
3225
|
series: "Wan",
|
|
3216
|
-
description: "Faster Wan
|
|
3226
|
+
description: "Faster Wan 2.6 video-to-video: a new clip featuring the subject of the input video, in the scene the prompt describes (not an edit or restyle of the clip); optional audio and multi-shot.",
|
|
3217
3227
|
useCases: ["v2v", "fast"],
|
|
3218
3228
|
pricing: [{ identifier: "wan-flash", credits: 100 }],
|
|
3219
3229
|
},
|
|
@@ -3225,10 +3235,13 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
3225
3235
|
maker: "alibaba",
|
|
3226
3236
|
label: "Wan 2.7 VideoEdit",
|
|
3227
3237
|
series: "Wan",
|
|
3228
|
-
description: "Guided video editing with optional reference image, audio control, and prompt expansion.",
|
|
3238
|
+
description: "Guided video editing of a 2-10s clip with optional reference image, audio control, and prompt expansion; priced per second of the clip it delivers, never below the listed price.",
|
|
3229
3239
|
useCases: ["v2v", "restyle", "reference"],
|
|
3230
3240
|
resolutions: ["720p", "1080p"],
|
|
3231
|
-
pricing: [
|
|
3241
|
+
pricing: [
|
|
3242
|
+
{ identifier: "wan-videoedit", credits: 320, note: "the least a run costs" },
|
|
3243
|
+
{ identifier: "wan-videoedit:1080p:per-4s", credits: 240, note: "per 4 seconds of the clip it delivers (720p at this row too); charged per whole second, never below the flat row" },
|
|
3244
|
+
],
|
|
3232
3245
|
},
|
|
3233
3246
|
// ── Wan 2.7 ──
|
|
3234
3247
|
"wan-2.7": {
|
|
@@ -3446,11 +3459,13 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
3446
3459
|
maker: "alibaba",
|
|
3447
3460
|
label: "HappyHorse Edit",
|
|
3448
3461
|
series: "HappyHorse",
|
|
3449
|
-
description: "HappyHorse video-edit — video-to-video transformation
|
|
3462
|
+
description: "HappyHorse video-edit — video-to-video transformation of a 3-60s clip, 720p/1080p output; priced per started half-second of the clip, above the listed flat price.",
|
|
3450
3463
|
useCases: ["v2v", "restyle"],
|
|
3451
3464
|
resolutions: ["720p", "1080p"],
|
|
3452
3465
|
pricing: [
|
|
3453
|
-
{ identifier: "happyhorse-edit", credits: 350, note: "
|
|
3466
|
+
{ identifier: "happyhorse-edit", credits: 350, note: "flat row of runs priced before per-clip-second pricing" },
|
|
3467
|
+
{ identifier: "happyhorse-edit:720p:per-4s", credits: 560, note: "720p (default): per 4 seconds of the clip; charged per started half-second" },
|
|
3468
|
+
{ identifier: "happyhorse-edit:1080p:per-4s", credits: 960, note: "1080p: per 4 seconds of the clip; charged per started half-second" },
|
|
3454
3469
|
],
|
|
3455
3470
|
},
|
|
3456
3471
|
// ── Vidu (ShengShu Technology) ──
|
|
@@ -3953,6 +3968,8 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
3953
3968
|
{ identifier: "motion-transfer:15s", credits: 230 },
|
|
3954
3969
|
{ identifier: "motion-transfer:30s", credits: 450 },
|
|
3955
3970
|
{ identifier: "motion-transfer:1080p:10s", credits: 230 },
|
|
3971
|
+
{ identifier: "motion-transfer:720p:per-4s", credits: 126, note: "720p: per 4 seconds of the driving video; charged per whole second" },
|
|
3972
|
+
{ identifier: "motion-transfer:1080p:per-4s", credits: 203, note: "1080p: per 4 seconds of the driving video; charged per whole second" },
|
|
3956
3973
|
],
|
|
3957
3974
|
},
|
|
3958
3975
|
"kling-3.0-motion": {
|
|
@@ -3972,16 +3989,20 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
3972
3989
|
{ identifier: "kling-3.0-motion:5s", credits: 150 },
|
|
3973
3990
|
{ identifier: "kling-3.0-motion:10s", credits: 300 },
|
|
3974
3991
|
{ identifier: "kling-3.0-motion:1080p:10s", credits: 500 },
|
|
3992
|
+
{ identifier: "kling-3.0-motion:720p:per-4s", credits: 228, note: "720p: per 4 seconds of the driving video; charged per whole second" },
|
|
3993
|
+
{ identifier: "kling-3.0-motion:1080p:per-4s", credits: 302, note: "1080p: per 4 seconds of the driving video; charged per whole second" },
|
|
3975
3994
|
],
|
|
3976
3995
|
},
|
|
3977
3996
|
// Wan Animate (decided 2026-11-12): catalog entries so a deployment's model
|
|
3978
3997
|
// restriction can name them. Before, `models.allow` could not withhold them
|
|
3979
3998
|
// while the Motion Transfer node and /v1/motion-transfer kept running them
|
|
3980
|
-
// beside the Kling models.
|
|
3981
|
-
//
|
|
3982
|
-
//
|
|
3983
|
-
// size `normalizeModelInput` moves it to
|
|
3984
|
-
// the size a request naming none has always
|
|
3999
|
+
// beside the Kling models. Replace runs at three sizes; Move at 720p only (the
|
|
4000
|
+
// one size the provider takes for it). A size a model does not have (Move's
|
|
4001
|
+
// 480p / 580p, the route's 1080p) runs, and is charged, as 720p —
|
|
4002
|
+
// `defaultResolution`, the size `normalizeModelInput` moves it to
|
|
4003
|
+
// (`motionTransferResolution`), and the size a request naming none has always
|
|
4004
|
+
// run at. Each is charged per second of the driving video at its `:per-4s`
|
|
4005
|
+
// row, never below its flat row for the size it runs at.
|
|
3985
4006
|
"wan-animate-move": {
|
|
3986
4007
|
id: "wan-animate-move",
|
|
3987
4008
|
kind: "video",
|
|
@@ -3992,12 +4013,14 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
3992
4013
|
series: "Wan",
|
|
3993
4014
|
description: "Wan 2.2 Animate: moves the subject of a still image with the motion of a driving video.",
|
|
3994
4015
|
useCases: ["motion-transfer", "cheap"],
|
|
3995
|
-
resolutions: ["
|
|
4016
|
+
resolutions: ["720p"],
|
|
3996
4017
|
defaultResolution: "720p",
|
|
3997
4018
|
pricing: [
|
|
3998
|
-
|
|
3999
|
-
{ identifier: "wan-animate-move:
|
|
4000
|
-
{ identifier: "wan-animate-move
|
|
4019
|
+
// 720p first: the size Move runs at, so its default variant's price.
|
|
4020
|
+
{ identifier: "wan-animate-move:720p", credits: 410, note: "720p, the only size it runs at" },
|
|
4021
|
+
{ identifier: "wan-animate-move", credits: 255, note: "480p (runs, and is charged, as 720p)" },
|
|
4022
|
+
{ identifier: "wan-animate-move:580p", credits: 330, note: "580p (runs, and is charged, as 720p)" },
|
|
4023
|
+
{ identifier: "wan-animate-move:720p:per-4s", credits: 125, note: "per 4 seconds of the driving video, never below the 720p row; charged per whole second" },
|
|
4001
4024
|
],
|
|
4002
4025
|
},
|
|
4003
4026
|
"wan-animate-replace": {
|
|
@@ -4016,6 +4039,9 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
4016
4039
|
{ identifier: "wan-animate-replace", credits: 255, note: "480p" },
|
|
4017
4040
|
{ identifier: "wan-animate-replace:580p", credits: 330, note: "580p" },
|
|
4018
4041
|
{ identifier: "wan-animate-replace:720p", credits: 410, note: "720p" },
|
|
4042
|
+
{ identifier: "wan-animate-replace:480p:per-4s", credits: 60, note: "480p: per 4 seconds of the driving video, never below the 480p row; charged per whole second" },
|
|
4043
|
+
{ identifier: "wan-animate-replace:580p:per-4s", credits: 95, note: "580p: per 4 seconds of the driving video, never below the 580p row; charged per whole second" },
|
|
4044
|
+
{ identifier: "wan-animate-replace:720p:per-4s", credits: 125, note: "720p: per 4 seconds of the driving video, never below the 720p row; charged per whole second" },
|
|
4019
4045
|
],
|
|
4020
4046
|
},
|
|
4021
4047
|
|
|
@@ -4934,9 +4960,9 @@ const AUDIO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
4934
4960
|
maker: "elevenlabs",
|
|
4935
4961
|
label: "ElevenLabs Voice Isolation",
|
|
4936
4962
|
series: "ElevenLabs",
|
|
4937
|
-
description: "Strip background noise / music from a vocal track.",
|
|
4963
|
+
description: "Strip background noise / music from a vocal track. Audio up to 30 minutes; priced per started 10 seconds of the audio.",
|
|
4938
4964
|
useCases: ["cleanup", "isolation"],
|
|
4939
|
-
pricing: [{ identifier: "elevenlabs-isolation", credits:
|
|
4965
|
+
pricing: [{ identifier: "elevenlabs-isolation:per-10s", credits: 10, note: "per started 10 seconds of the audio, up to 30 minutes" }],
|
|
4940
4966
|
},
|
|
4941
4967
|
"elevenlabs-dubbing": {
|
|
4942
4968
|
id: "elevenlabs-dubbing",
|
package/src/model-constants.ts
CHANGED
|
@@ -1559,11 +1559,31 @@ export const VIDEO_TO_VIDEO_NODE_PROVIDERS = [...VIDEO_TO_VIDEO_PROVIDERS, ...SE
|
|
|
1559
1559
|
export type VideoToVideoNodeProvider = typeof VIDEO_TO_VIDEO_NODE_PROVIDERS[number]
|
|
1560
1560
|
|
|
1561
1561
|
/**
|
|
1562
|
-
* The model a Video to Video request or node that names none runs on:
|
|
1563
|
-
*
|
|
1564
|
-
*
|
|
1562
|
+
* The model a Video to Video request or node that names none runs on: Seedance
|
|
1563
|
+
* 2.5, which edits the clip by instruction. One constant, read through
|
|
1564
|
+
* {@link videoToVideoProviderOf} by the route, the MCP tool, the workflow run
|
|
1565
|
+
* and every editor surface, so a quote, a hold and a run always name the same
|
|
1566
|
+
* model.
|
|
1565
1567
|
*/
|
|
1566
|
-
export const DEFAULT_VIDEO_TO_VIDEO_PROVIDER: VideoToVideoNodeProvider = "
|
|
1568
|
+
export const DEFAULT_VIDEO_TO_VIDEO_PROVIDER: VideoToVideoNodeProvider = "seedance-2-5"
|
|
1569
|
+
|
|
1570
|
+
/**
|
|
1571
|
+
* The model a Video to Video request body or node runs on: the one it names,
|
|
1572
|
+
* else {@link DEFAULT_VIDEO_TO_VIDEO_PROVIDER}. Anything but a non-empty string
|
|
1573
|
+
* reads as unnamed. The ONE place the default is resolved.
|
|
1574
|
+
*/
|
|
1575
|
+
export function videoToVideoProviderOf(named: unknown): string {
|
|
1576
|
+
return typeof named === "string" && named !== "" ? named : DEFAULT_VIDEO_TO_VIDEO_PROVIDER
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
/**
|
|
1580
|
+
* The model of a `video-to-video` job that is ALREADY QUEUED with no provider.
|
|
1581
|
+
* Such a job was created while the default was Wan 2.6 and was priced as one,
|
|
1582
|
+
* and a Seedance edit is never a `video-to-video` job (it runs as
|
|
1583
|
+
* `text-to-video`), so it is by construction a Wan job. Only the worker side
|
|
1584
|
+
* reads this; a new request never does.
|
|
1585
|
+
*/
|
|
1586
|
+
export const QUEUED_VIDEO_TO_VIDEO_JOB_PROVIDER: VideoToVideoProvider = "wan"
|
|
1567
1587
|
|
|
1568
1588
|
/**
|
|
1569
1589
|
* The request shape Seedance edit mode requires, sent UP FRONT by the Video to
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a Motion Transfer run is priced (decided 2026-11-18): from the length of
|
|
3
|
+
* its DRIVING video as the server reads it, never a length the caller
|
|
4
|
+
* declares.
|
|
5
|
+
*
|
|
6
|
+
* - Every model is refused below {@link MOTION_TRANSFER_MIN_SEC} and past its
|
|
7
|
+
* limit ({@link motionTransferMaxSec}: Kling 2.6 and Kling 3.0 take 10
|
|
8
|
+
* seconds while the character keeps the image's orientation — the default —
|
|
9
|
+
* and 30 while it follows the video's; Wan Animate takes 30). A clip up to
|
|
10
|
+
* `CLIP_PRICE_GRACE_SEC` past a limit is accepted and priced at it.
|
|
11
|
+
* - Every model and size is charged per second of that video
|
|
12
|
+
* ({@link MOTION_TRANSFER_SECOND_RATES}): its rate row × the billed seconds
|
|
13
|
+
* ÷ the seconds the row prices, rounded up once, marked up once — the hold
|
|
14
|
+
* IS the charge.
|
|
15
|
+
* - Wan Animate keeps its flat price by size as a FLOOR: a run is charged the
|
|
16
|
+
* larger of its rate's figure and its floor row, compared as base credits
|
|
17
|
+
* ({@link motionTransferChargedPrice}), and the run is
|
|
18
|
+
* charged at the row that won — the floor row once, or the rate row × its
|
|
19
|
+
* units — so the usage log, the whole-run quote id (`<rate>:<N>u`) and the
|
|
20
|
+
* flat row's own price each name exactly what was charged.
|
|
21
|
+
*
|
|
22
|
+
* Billed seconds are the length rounded up to a whole second after the house
|
|
23
|
+
* grace ({@link motionTransferBilledSeconds}). The route, the workflow run,
|
|
24
|
+
* the MCP verb (which calls the route) and both estimates read this one
|
|
25
|
+
* module. The old length-tier rows (`buildMotionCreditModelIdentifier`) are no
|
|
26
|
+
* run's price any more; they stay for older code and saved quotes.
|
|
27
|
+
*/
|
|
28
|
+
import { motionTransferResolution } from "./credit-identifiers.js"
|
|
29
|
+
import { CLIP_PRICE_GRACE_SEC, gracedMeasuredSec } from "./priced-clip-seconds.js"
|
|
30
|
+
|
|
31
|
+
/** Float noise: a length that is arithmetic can land a hair past a limit, and must not be refused for it. */
|
|
32
|
+
const FLOAT_NOISE_SEC = 1e-9
|
|
33
|
+
|
|
34
|
+
/** The shortest driving video any Motion Transfer model takes. */
|
|
35
|
+
export const MOTION_TRANSFER_MIN_SEC = 3
|
|
36
|
+
|
|
37
|
+
/** The longest driving video Kling 2.6 / Kling 3.0 take while the character keeps the image's orientation. */
|
|
38
|
+
export const MOTION_TRANSFER_IMAGE_ORIENTATION_MAX_SEC = 10
|
|
39
|
+
|
|
40
|
+
/** The longest driving video any Motion Transfer model takes (Kling following the video's orientation, Wan Animate). */
|
|
41
|
+
export const MOTION_TRANSFER_MAX_SEC = 30
|
|
42
|
+
|
|
43
|
+
/** The orientation a run uses: `"video"` only when it says so; anything else (absent included) is the default, `"image"`. */
|
|
44
|
+
export function motionTransferOrientation(characterOrientation: unknown): "image" | "video" {
|
|
45
|
+
return characterOrientation === "video" ? "video" : "image"
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const isWanAnimate = (provider: string): boolean => provider === "wan-animate-move" || provider === "wan-animate-replace"
|
|
49
|
+
|
|
50
|
+
/** The longest driving video a run of `provider` at `characterOrientation` takes. */
|
|
51
|
+
export function motionTransferMaxSec(provider: string, characterOrientation: unknown): number {
|
|
52
|
+
if (isWanAnimate(provider)) return MOTION_TRANSFER_MAX_SEC
|
|
53
|
+
return motionTransferOrientation(characterOrientation) === "video" ? MOTION_TRANSFER_MAX_SEC : MOTION_TRANSFER_IMAGE_ORIENTATION_MAX_SEC
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** A per-second rate: the row that prices `rateSeconds` seconds of driving video, and the floor a run of it never goes below. */
|
|
57
|
+
export interface MotionTransferSecondRate {
|
|
58
|
+
readonly rateId: string
|
|
59
|
+
readonly rateSeconds: number
|
|
60
|
+
/**
|
|
61
|
+
* The row a run of this model and size is never charged below (Wan Animate:
|
|
62
|
+
* its flat price for the size the request names); absent when the rate
|
|
63
|
+
* alone prices the run (Kling).
|
|
64
|
+
*/
|
|
65
|
+
readonly floorId?: string
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Every rate row prices four seconds, so its value stays a whole credit and dividing by 4 is exact in floating point. */
|
|
69
|
+
const PER_4S = 4
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The rate of every model and size, keyed `<provider>:<charged size>`.
|
|
73
|
+
* Wan Animate Move runs at 720p only (its catalog entry lists that one size,
|
|
74
|
+
* so `motionTransferResolution` sends and charges any size it names as 720p).
|
|
75
|
+
*/
|
|
76
|
+
export const MOTION_TRANSFER_SECOND_RATES: Readonly<Record<string, MotionTransferSecondRate>> = {
|
|
77
|
+
"kling:720p": { rateId: "motion-transfer:720p:per-4s", rateSeconds: PER_4S },
|
|
78
|
+
"kling:1080p": { rateId: "motion-transfer:1080p:per-4s", rateSeconds: PER_4S },
|
|
79
|
+
"kling-3.0:720p": { rateId: "kling-3.0-motion:720p:per-4s", rateSeconds: PER_4S },
|
|
80
|
+
"kling-3.0:1080p": { rateId: "kling-3.0-motion:1080p:per-4s", rateSeconds: PER_4S },
|
|
81
|
+
"wan-animate-replace:480p": { rateId: "wan-animate-replace:480p:per-4s", rateSeconds: PER_4S, floorId: "wan-animate-replace" },
|
|
82
|
+
"wan-animate-replace:580p": { rateId: "wan-animate-replace:580p:per-4s", rateSeconds: PER_4S, floorId: "wan-animate-replace:580p" },
|
|
83
|
+
"wan-animate-replace:720p": { rateId: "wan-animate-replace:720p:per-4s", rateSeconds: PER_4S, floorId: "wan-animate-replace:720p" },
|
|
84
|
+
"wan-animate-move:720p": { rateId: "wan-animate-move:720p:per-4s", rateSeconds: PER_4S, floorId: "wan-animate-move:720p" },
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Every per-second rate row, once each. */
|
|
88
|
+
export const MOTION_TRANSFER_RATE_IDS: readonly string[] = [...new Set(Object.values(MOTION_TRANSFER_SECOND_RATES).map((r) => r.rateId))]
|
|
89
|
+
|
|
90
|
+
/** Every floor row a per-second rate names, once each. */
|
|
91
|
+
export const MOTION_TRANSFER_FLOOR_IDS: readonly string[] = [
|
|
92
|
+
...new Set(Object.values(MOTION_TRANSFER_SECOND_RATES).flatMap((r) => (r.floorId === undefined ? [] : [r.floorId]))),
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
/** The model a run of `provider` runs: a model Motion Transfer has, else its default (Kling 2.6), as the route and the workflow run resolve it. */
|
|
96
|
+
function runProvider(provider: unknown): string {
|
|
97
|
+
return typeof provider === "string" && Object.keys(MOTION_TRANSFER_SECOND_RATES).some((k) => k.startsWith(`${provider}:`)) ? provider : "kling"
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The size a run is CHARGED at: the size it runs at (`motionTransferResolution`),
|
|
102
|
+
* and for Kling any size but 1080p is charged as 720p (its rows have no other).
|
|
103
|
+
*/
|
|
104
|
+
function chargedSize(provider: string, resolution: unknown): string {
|
|
105
|
+
const sized = motionTransferResolution(provider, typeof resolution === "string" && resolution !== "" ? resolution : "720p").resolution
|
|
106
|
+
if (isWanAnimate(provider)) return sized
|
|
107
|
+
return sized === "1080p" ? "1080p" : "720p"
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** The per-second rate a run of `provider` at `resolution` is charged at; a model Motion Transfer does not have is priced as its default (Kling 2.6). */
|
|
111
|
+
export function motionTransferRateOf(provider: unknown, resolution: unknown): MotionTransferSecondRate {
|
|
112
|
+
const model = runProvider(provider)
|
|
113
|
+
const key = `${model}:${chargedSize(model, resolution)}`
|
|
114
|
+
// Every size `motionTransferResolution` answers has an entry (motion-transfer-pricing.test.ts); a size it does not is priced at the model's 720p.
|
|
115
|
+
return MOTION_TRANSFER_SECOND_RATES[key] ?? MOTION_TRANSFER_SECOND_RATES[`${model}:720p`]!
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The whole seconds a driving video read at `measuredSec` is billed for:
|
|
120
|
+
* rounded up after forgiving `CLIP_PRICE_GRACE_SEC` past a whole second, at
|
|
121
|
+
* least one. THE one rounding every lane reads.
|
|
122
|
+
*/
|
|
123
|
+
export function motionTransferBilledSeconds(measuredSec: number): number {
|
|
124
|
+
return Math.max(1, Math.ceil(gracedMeasuredSec(measuredSec)))
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** A Motion Transfer run's price: the row it is charged at and, for a rate row, the units of it. */
|
|
128
|
+
export interface MotionTransferPrice {
|
|
129
|
+
/** The row the run reserves: a per-second rate row, or (once {@link motionTransferChargedPrice} chose it) a floor row. */
|
|
130
|
+
readonly creditId: string
|
|
131
|
+
/** Units of the rate row the run is charged (billed seconds ÷ the rate's seconds); undefined for a floor row, charged once. */
|
|
132
|
+
readonly units?: number
|
|
133
|
+
/** The floor row the rate is compared with (Wan Animate) before the run is charged; undefined once chosen, and for Kling. */
|
|
134
|
+
readonly floorId?: string
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* The rate price of a run of `provider` at `resolution` whose driving video is
|
|
139
|
+
* billed for `billedSeconds` whole seconds: the rate row and its units, and
|
|
140
|
+
* the floor row it is compared with ({@link motionTransferChargedPrice}).
|
|
141
|
+
*/
|
|
142
|
+
export function motionTransferPrice(provider: string, resolution: unknown, billedSeconds: number): MotionTransferPrice {
|
|
143
|
+
const rate = motionTransferRateOf(provider, resolution)
|
|
144
|
+
return { creditId: rate.rateId, units: billedSeconds / rate.rateSeconds, ...(rate.floorId !== undefined ? { floorId: rate.floorId } : {}) }
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The row a run is CHARGED at — THE floor rule every lane reads: a price with
|
|
149
|
+
* no floor is its rate; one with a floor is charged its floor row when the
|
|
150
|
+
* floor's figure is at least the rate's figure for the run (a tie goes to the
|
|
151
|
+
* floor: the same credits, at today's row), else its rate row × the units.
|
|
152
|
+
* `perSecond` and `floor` must be figures of the same kind — both base credits
|
|
153
|
+
* (the server: the rate row × the units rounded up once, and the floor row)
|
|
154
|
+
* or both charged credits (the editor, from the server's quotes). A figure
|
|
155
|
+
* that is not known leaves the rate (whose own lookup refuses an unpriced
|
|
156
|
+
* row).
|
|
157
|
+
*/
|
|
158
|
+
export function motionTransferChargedPrice(
|
|
159
|
+
price: MotionTransferPrice,
|
|
160
|
+
figures: { readonly perSecond: number | undefined; readonly floor: number | undefined },
|
|
161
|
+
): MotionTransferPrice {
|
|
162
|
+
const rate: MotionTransferPrice = { creditId: price.creditId, ...(price.units !== undefined ? { units: price.units } : {}) }
|
|
163
|
+
if (price.floorId === undefined || figures.perSecond === undefined || figures.floor === undefined) return rate
|
|
164
|
+
return figures.floor >= figures.perSecond ? { creditId: price.floorId } : rate
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* {@link motionTransferChargedPrice} from base rows (`baseOf`: a row's base
|
|
169
|
+
* credits, undefined when it is priced nowhere), with the base credits the
|
|
170
|
+
* run is charged, as base credits: the rate row × the units rounded up once,
|
|
171
|
+
* or the floor row.
|
|
172
|
+
*/
|
|
173
|
+
export function motionTransferBaseCharge(
|
|
174
|
+
price: MotionTransferPrice,
|
|
175
|
+
baseOf: (creditId: string) => number | undefined,
|
|
176
|
+
): MotionTransferPrice & { readonly baseCredits: number | undefined } {
|
|
177
|
+
const rateBase = baseOf(price.creditId)
|
|
178
|
+
const perSecond = rateBase === undefined ? undefined : Math.ceil(rateBase * (price.units ?? 1))
|
|
179
|
+
const floor = price.floorId === undefined ? undefined : baseOf(price.floorId)
|
|
180
|
+
const charged = motionTransferChargedPrice(price, { perSecond, floor })
|
|
181
|
+
return { ...charged, baseCredits: charged.units === undefined ? floor : perSecond }
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** What the length check answers for a measured driving video. */
|
|
185
|
+
export type MotionTransferLengthCheck =
|
|
186
|
+
| { readonly ok: true; readonly billedSeconds: number }
|
|
187
|
+
| { readonly ok: false; readonly code: "video_too_short" | "video_too_long"; readonly message: string }
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Whether a driving video measured at `measuredSec` can run on `provider` at
|
|
191
|
+
* `characterOrientation`, and the seconds it is billed for. Shorter than
|
|
192
|
+
* {@link MOTION_TRANSFER_MIN_SEC} is refused; past the limit by more than
|
|
193
|
+
* `CLIP_PRICE_GRACE_SEC` is refused; a clip within that grace is billed at the
|
|
194
|
+
* limit.
|
|
195
|
+
*/
|
|
196
|
+
export function checkMotionTransferLength(provider: string, characterOrientation: unknown, measuredSec: number): MotionTransferLengthCheck {
|
|
197
|
+
if (measuredSec < MOTION_TRANSFER_MIN_SEC) {
|
|
198
|
+
return {
|
|
199
|
+
ok: false,
|
|
200
|
+
code: "video_too_short",
|
|
201
|
+
message: `The motion video is ${measuredSec.toFixed(1)} seconds. Motion Transfer needs a motion video of at least ${MOTION_TRANSFER_MIN_SEC} seconds.`,
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const max = motionTransferMaxSec(provider, characterOrientation)
|
|
205
|
+
if (measuredSec > max + CLIP_PRICE_GRACE_SEC + FLOAT_NOISE_SEC) {
|
|
206
|
+
const followVideo = !isWanAnimate(provider) && motionTransferOrientation(characterOrientation) === "image"
|
|
207
|
+
? ` (or ${MOTION_TRANSFER_MAX_SEC} seconds with the character following the video's orientation)`
|
|
208
|
+
: ""
|
|
209
|
+
return {
|
|
210
|
+
ok: false,
|
|
211
|
+
code: "video_too_long",
|
|
212
|
+
message: `The motion video is ${measuredSec.toFixed(1)} seconds. This model takes at most ${max} seconds${followVideo}. Trim the video first.`,
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return { ok: true, billedSeconds: Math.min(max, motionTransferBilledSeconds(measuredSec)) }
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* The billed seconds an ESTIMATE quotes before the video is measured: the
|
|
220
|
+
* length the graph gives, at most the limit, billed as a run bills it; a
|
|
221
|
+
* length it does not know quotes the limit — the most the run can be charged
|
|
222
|
+
* (decided 2026-11-18), marked as an estimate by the caller.
|
|
223
|
+
*/
|
|
224
|
+
export function motionTransferEstimateSeconds(provider: string, characterOrientation: unknown, knownSec?: number | null): number {
|
|
225
|
+
const max = motionTransferMaxSec(provider, characterOrientation)
|
|
226
|
+
if (knownSec == null || !Number.isFinite(knownSec) || knownSec <= 0) return max
|
|
227
|
+
return Math.min(max, motionTransferBilledSeconds(Math.max(MOTION_TRANSFER_MIN_SEC, knownSec)))
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** The price an estimate quotes ({@link motionTransferEstimateSeconds}), and whether it stood in for an unknown length. */
|
|
231
|
+
export function motionTransferEstimatePrice(
|
|
232
|
+
provider: string,
|
|
233
|
+
resolution: unknown,
|
|
234
|
+
characterOrientation: unknown,
|
|
235
|
+
knownSec?: number | null,
|
|
236
|
+
): MotionTransferPrice & { readonly lengthKnown: boolean } {
|
|
237
|
+
const lengthKnown = knownSec != null && Number.isFinite(knownSec) && knownSec > 0
|
|
238
|
+
return { ...motionTransferPrice(provider, resolution, motionTransferEstimateSeconds(provider, characterOrientation, knownSec)), lengthKnown }
|
|
239
|
+
}
|
package/src/producer-types.ts
CHANGED
|
@@ -71,6 +71,8 @@ export const VIDEO_PRODUCER_TYPES: ReadonlySet<string> = composeUnitSet("VIDEO_P
|
|
|
71
71
|
"video-sfx",
|
|
72
72
|
"suno-music-video",
|
|
73
73
|
"merge-video-audio",
|
|
74
|
+
// Replace Audio (Nodaro Cloud plugin): the video with its sound replaced → video.
|
|
75
|
+
"replace-audio",
|
|
74
76
|
"add-captions",
|
|
75
77
|
"resize-video",
|
|
76
78
|
"social-media-format",
|