@nodaro/shared 3.68.0 → 3.69.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-T4GIHHXY.cjs → chunk-25C2E2GI.cjs} +6 -6
- package/dist/{chunk-T4GIHHXY.cjs.map → chunk-25C2E2GI.cjs.map} +1 -1
- package/dist/{chunk-OXTF4Y3P.cjs → chunk-3AB3YIFM.cjs} +6 -6
- package/dist/{chunk-OXTF4Y3P.cjs.map → chunk-3AB3YIFM.cjs.map} +1 -1
- package/dist/{chunk-BCY3A62O.cjs → chunk-3OHRFSQL.cjs} +51 -49
- package/dist/{chunk-BCY3A62O.cjs.map → chunk-3OHRFSQL.cjs.map} +1 -1
- package/dist/{chunk-GNLA5NTT.cjs → chunk-4IMEJQVQ.cjs} +4 -4
- package/dist/{chunk-GNLA5NTT.cjs.map → chunk-4IMEJQVQ.cjs.map} +1 -1
- package/dist/{chunk-4XR66IWF.cjs → chunk-54E2JO4E.cjs} +51 -22
- package/dist/chunk-54E2JO4E.cjs.map +1 -0
- package/dist/{chunk-HTDKEYMY.cjs → chunk-5EQRIUGI.cjs} +139 -91
- package/dist/chunk-5EQRIUGI.cjs.map +1 -0
- package/dist/{chunk-AT53ZQUC.js → chunk-5WHU7CYE.js} +3 -3
- package/dist/{chunk-AT53ZQUC.js.map → chunk-5WHU7CYE.js.map} +1 -1
- package/dist/{chunk-BNR5FKL5.js → chunk-5ZCZL73I.js} +3 -3
- package/dist/{chunk-BNR5FKL5.js.map → chunk-5ZCZL73I.js.map} +1 -1
- package/dist/{chunk-WZG6GZIL.cjs → chunk-6QJHSN6J.cjs} +4 -4
- package/dist/{chunk-WZG6GZIL.cjs.map → chunk-6QJHSN6J.cjs.map} +1 -1
- package/dist/{chunk-OFQ6CU6S.js → chunk-7EQJIGVT.js} +3 -3
- package/dist/{chunk-OFQ6CU6S.js.map → chunk-7EQJIGVT.js.map} +1 -1
- package/dist/{chunk-XEPKONJC.js → chunk-7OSUEYZ4.js} +3 -3
- package/dist/{chunk-XEPKONJC.js.map → chunk-7OSUEYZ4.js.map} +1 -1
- package/dist/{chunk-3L7GMQ4M.cjs → chunk-7PC2YHBN.cjs} +54 -49
- package/dist/chunk-7PC2YHBN.cjs.map +1 -0
- package/dist/{chunk-BMDOPJBP.cjs → chunk-AGIG5HUU.cjs} +17 -17
- package/dist/{chunk-BMDOPJBP.cjs.map → chunk-AGIG5HUU.cjs.map} +1 -1
- package/dist/{chunk-5LWYX4GV.js → chunk-AH6OQXLW.js} +3 -3
- package/dist/{chunk-5LWYX4GV.js.map → chunk-AH6OQXLW.js.map} +1 -1
- package/dist/{chunk-BHL7TAQO.js → chunk-BDW25A7Y.js} +32 -9
- package/dist/chunk-BDW25A7Y.js.map +1 -0
- package/dist/{chunk-5J2LIQYU.js → chunk-DE55SA2X.js} +5 -5
- package/dist/{chunk-5J2LIQYU.js.map → chunk-DE55SA2X.js.map} +1 -1
- package/dist/{chunk-VBP4DH37.js → chunk-DNWFFVC6.js} +130 -15
- package/dist/chunk-DNWFFVC6.js.map +1 -0
- package/dist/{chunk-MVXZP6VB.js → chunk-FUYBUT65.js} +97 -2
- package/dist/chunk-FUYBUT65.js.map +1 -0
- package/dist/{chunk-SW5ZD7BO.js → chunk-G6AOKNAY.js} +3 -3
- package/dist/{chunk-SW5ZD7BO.js.map → chunk-G6AOKNAY.js.map} +1 -1
- package/dist/{chunk-EFYWV2V5.cjs → chunk-I6TBKTW3.cjs} +61 -61
- package/dist/{chunk-EFYWV2V5.cjs.map → chunk-I6TBKTW3.cjs.map} +1 -1
- package/dist/{chunk-3YWZ5SOZ.js → chunk-KLEKJUQI.js} +5 -5
- package/dist/{chunk-3YWZ5SOZ.js.map → chunk-KLEKJUQI.js.map} +1 -1
- package/dist/{chunk-OXBU5AGH.js → chunk-LSX2OFNB.js} +3 -3
- package/dist/{chunk-OXBU5AGH.js.map → chunk-LSX2OFNB.js.map} +1 -1
- package/dist/{chunk-66QSUUB4.cjs → chunk-LY6IR5LL.cjs} +12 -12
- package/dist/{chunk-66QSUUB4.cjs.map → chunk-LY6IR5LL.cjs.map} +1 -1
- package/dist/{chunk-5GG4CG4Y.js → chunk-LZPG4XHT.js} +3 -3
- package/dist/{chunk-5GG4CG4Y.js.map → chunk-LZPG4XHT.js.map} +1 -1
- package/dist/{chunk-PGDR7CO3.cjs → chunk-MGSGLRHZ.cjs} +8 -8
- package/dist/{chunk-PGDR7CO3.cjs.map → chunk-MGSGLRHZ.cjs.map} +1 -1
- package/dist/{chunk-Z77M7Q2R.js → chunk-ML55U7WM.js} +3 -3
- package/dist/{chunk-Z77M7Q2R.js.map → chunk-ML55U7WM.js.map} +1 -1
- package/dist/{chunk-IWUW3YPM.cjs → chunk-NTCSXKZ3.cjs} +5 -5
- package/dist/{chunk-IWUW3YPM.cjs.map → chunk-NTCSXKZ3.cjs.map} +1 -1
- package/dist/{chunk-SCDE676D.js → chunk-OEOOXL3F.js} +65 -23
- package/dist/chunk-OEOOXL3F.js.map +1 -0
- package/dist/{chunk-GF7ZA26H.js → chunk-OOUJZR4K.js} +4 -4
- package/dist/{chunk-GF7ZA26H.js.map → chunk-OOUJZR4K.js.map} +1 -1
- package/dist/{chunk-5IZHECUP.js → chunk-OZA4DE23.js} +3 -3
- package/dist/{chunk-5IZHECUP.js.map → chunk-OZA4DE23.js.map} +1 -1
- package/dist/{chunk-XNJDAW3M.js → chunk-PHQVAPSD.js} +7 -5
- package/dist/{chunk-XNJDAW3M.js.map → chunk-PHQVAPSD.js.map} +1 -1
- package/dist/{chunk-5NVGKXJV.cjs → chunk-PLANUXQL.cjs} +89 -3
- package/dist/chunk-PLANUXQL.cjs.map +1 -0
- package/dist/{chunk-PJAJCFLP.cjs → chunk-QNPYYSLT.cjs} +168 -44
- package/dist/chunk-QNPYYSLT.cjs.map +1 -0
- package/dist/{chunk-G2G7XGFU.cjs → chunk-RURPG6IS.cjs} +7 -7
- package/dist/{chunk-G2G7XGFU.cjs.map → chunk-RURPG6IS.cjs.map} +1 -1
- package/dist/{chunk-PAUWEWTY.js → chunk-TDU45K6Z.js} +12 -7
- package/dist/chunk-TDU45K6Z.js.map +1 -0
- package/dist/{chunk-X2YHKP4D.cjs → chunk-TWUFC32F.cjs} +8 -8
- package/dist/{chunk-X2YHKP4D.cjs.map → chunk-TWUFC32F.cjs.map} +1 -1
- package/dist/{chunk-F6XIH3TZ.cjs → chunk-UJREE6EQ.cjs} +9 -9
- package/dist/{chunk-F6XIH3TZ.cjs.map → chunk-UJREE6EQ.cjs.map} +1 -1
- package/dist/{chunk-37ZSFS6A.cjs → chunk-WML66SUV.cjs} +9 -9
- package/dist/{chunk-37ZSFS6A.cjs.map → chunk-WML66SUV.cjs.map} +1 -1
- package/dist/{chunk-M5QY464F.cjs → chunk-XZYZYWKG.cjs} +21 -21
- package/dist/{chunk-M5QY464F.cjs.map → chunk-XZYZYWKG.cjs.map} +1 -1
- package/dist/{chunk-3QJ3UR5Z.js → chunk-YT4ZTJVC.js} +9 -9
- package/dist/{chunk-3QJ3UR5Z.js.map → chunk-YT4ZTJVC.js.map} +1 -1
- package/dist/{chunk-V6OXSXIX.js → chunk-YVQFYW2U.js} +86 -4
- package/dist/chunk-YVQFYW2U.js.map +1 -0
- package/dist/{chunk-E62W5I6A.cjs → chunk-ZWEVRMFN.cjs} +97 -2
- package/dist/chunk-ZWEVRMFN.cjs.map +1 -0
- package/dist/entries/apps.cjs +42 -42
- package/dist/entries/apps.js +7 -7
- package/dist/entries/credits.cjs +273 -225
- package/dist/entries/credits.d.cts +152 -66
- package/dist/entries/credits.d.ts +152 -66
- package/dist/entries/credits.js +10 -10
- package/dist/entries/llm-models.cjs +84 -68
- package/dist/entries/llm-models.d.cts +36 -3
- package/dist/entries/llm-models.d.ts +36 -3
- package/dist/entries/llm-models.js +2 -2
- package/dist/entries/model-catalog.cjs +133 -133
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +431 -395
- package/dist/entries/models.d.cts +2 -2
- package/dist/entries/models.d.ts +2 -2
- package/dist/entries/models.js +6 -6
- 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 +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 +152 -152
- package/dist/entries/video.d.cts +2 -1
- package/dist/entries/video.d.ts +2 -1
- package/dist/entries/video.js +6 -6
- package/dist/index.cjs +1697 -1597
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +21 -21
- package/dist/{model-constants-DZ3tPGFO.d.ts → model-constants-B5DNHIP8.d.ts} +156 -12
- package/dist/{model-constants-BstsUup6.d.cts → model-constants-CQr_d3Kw.d.cts} +156 -12
- package/package.json +1 -1
- package/src/__tests__/extend-providers.test.ts +43 -6
- package/src/__tests__/fixtures/measured-input-quote-parity.json +537 -1
- package/src/__tests__/fixtures/planned-length-quote-parity.json +46 -1
- package/src/__tests__/fixtures/probed-node-quote-parity.json +132 -0
- package/src/__tests__/fixtures/video-utility-quote-parity.json +112 -1
- package/src/__tests__/gemini-omni-extend.test.ts +110 -0
- package/src/__tests__/gvp-supported-providers.test.ts +3 -0
- package/src/__tests__/llm-models.test.ts +116 -2
- package/src/__tests__/llm-price-key.test.ts +2 -0
- package/src/__tests__/seedance-2-5-flash-catalog.test.ts +194 -0
- package/src/__tests__/video-character-refs.test.ts +48 -0
- package/src/credit-identifiers.ts +51 -32
- package/src/entries/credits.ts +17 -0
- package/src/entries/llm-models.ts +4 -0
- package/src/entries/models.ts +11 -0
- package/src/gemini-omni-extend-quote.ts +76 -0
- package/src/lip-sync-pricing.ts +1 -1
- package/src/llm-models.ts +117 -2
- package/src/model-catalog.ts +95 -0
- package/src/model-constants.ts +274 -11
- package/src/node-default-mappings.ts +2 -0
- package/src/seedance-extend-rate.ts +83 -20
- package/src/seedance-lip-sync.ts +68 -0
- package/src/video-character-refs.ts +26 -6
- package/dist/chunk-3L7GMQ4M.cjs.map +0 -1
- package/dist/chunk-4XR66IWF.cjs.map +0 -1
- package/dist/chunk-5NVGKXJV.cjs.map +0 -1
- package/dist/chunk-BHL7TAQO.js.map +0 -1
- package/dist/chunk-E62W5I6A.cjs.map +0 -1
- package/dist/chunk-HTDKEYMY.cjs.map +0 -1
- package/dist/chunk-MVXZP6VB.js.map +0 -1
- package/dist/chunk-PAUWEWTY.js.map +0 -1
- package/dist/chunk-PJAJCFLP.cjs.map +0 -1
- package/dist/chunk-SCDE676D.js.map +0 -1
- package/dist/chunk-V6OXSXIX.js.map +0 -1
- package/dist/chunk-VBP4DH37.js.map +0 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The price rows of the Extend Video providers priced by the seconds they
|
|
3
|
+
* send (Seedance 2.5 Extend, Seedance 2.5 Flash Extend) — part of the public
|
|
4
|
+
* credit-id contract:
|
|
3
5
|
* the rows a run is charged a multiple of, and so the ids a client names to
|
|
4
6
|
* ask what a run costs (`tailExtendCreditId`, `credit-identifiers.ts`).
|
|
5
7
|
*
|
|
6
|
-
*
|
|
8
|
+
* Such a run sends the source's last
|
|
7
9
|
* {@link SEEDANCE_EXTEND_CONTEXT_MAX_SEC} seconds (all of a shorter source)
|
|
8
10
|
* and is charged per second sent and added. A per-second price is not a
|
|
9
11
|
* whole credit, so each resolution's row is the price of
|
|
@@ -20,14 +22,36 @@
|
|
|
20
22
|
* (`seedance-extend-pricing.ts`) and the backend read them from here.
|
|
21
23
|
*/
|
|
22
24
|
import { MODEL_CATALOG } from "./model-catalog.js"
|
|
23
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
pricedOutputDurationSec,
|
|
27
|
+
SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC,
|
|
28
|
+
VIDEO_REF_VIDEO_DURATION_LIMITS,
|
|
29
|
+
type SeedanceExtendProvider,
|
|
30
|
+
type TailExtendProvider,
|
|
31
|
+
} from "./model-constants.js"
|
|
24
32
|
import { CONTAINER_OVERHANG_SEC } from "./video-duration.js"
|
|
25
33
|
|
|
26
|
-
/**
|
|
27
|
-
|
|
34
|
+
/**
|
|
35
|
+
* The Extend Video providers priced by the seconds they send, each on its own
|
|
36
|
+
* rows (decided 2026-11-16: Seedance 2.5 Flash Extend beside Seedance 2.5
|
|
37
|
+
* Extend). The window ({@link SEEDANCE_EXTEND_CONTEXT_MAX_SEC}), the two
|
|
38
|
+
* seconds a row prices and the seconds rule are the same for all of them; the
|
|
39
|
+
* rows are each provider's own, one per resolution its catalog entry offers.
|
|
40
|
+
*/
|
|
41
|
+
export const SEEDANCE_EXTEND_SENT_PRICED_PROVIDERS = [
|
|
42
|
+
"seedance-2-5-extend",
|
|
43
|
+
"seedance-2-5-flash-extend",
|
|
44
|
+
] as const satisfies readonly SeedanceExtendProvider[]
|
|
45
|
+
|
|
46
|
+
/** An Extend Video provider priced by the seconds it sends. */
|
|
47
|
+
export type SentPricedSeedanceExtendProvider = typeof SEEDANCE_EXTEND_SENT_PRICED_PROVIDERS[number]
|
|
28
48
|
|
|
29
|
-
/**
|
|
30
|
-
|
|
49
|
+
/**
|
|
50
|
+
* The first provider priced by the seconds it sends, Seedance 2.5 Extend: what
|
|
51
|
+
* the helpers below price when a caller names no provider (their signatures
|
|
52
|
+
* before Seedance 2.5 Flash Extend joined).
|
|
53
|
+
*/
|
|
54
|
+
export const SEEDANCE_EXTEND_SENT_PRICED_PROVIDER = "seedance-2-5-extend" satisfies SentPricedSeedanceExtendProvider
|
|
31
55
|
|
|
32
56
|
/** The most of the source's end a run sends as `@video_1`, in seconds. */
|
|
33
57
|
export const SEEDANCE_EXTEND_CONTEXT_MAX_SEC = 10
|
|
@@ -35,21 +59,41 @@ export const SEEDANCE_EXTEND_CONTEXT_MAX_SEC = 10
|
|
|
35
59
|
/** The seconds one rate row prices. */
|
|
36
60
|
export const SEEDANCE_EXTEND_RATE_SECONDS = 2
|
|
37
61
|
|
|
38
|
-
/**
|
|
62
|
+
/** A provider's rate row at `resolution`: `<provider>:<resolution>:per-2s`. */
|
|
63
|
+
function rateRowId(provider: SentPricedSeedanceExtendProvider, resolution: string): string {
|
|
64
|
+
return `${provider}:${resolution}:per-${SEEDANCE_EXTEND_RATE_SECONDS}s`
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Each sent-priced provider's rate rows, by resolution: one per resolution its
|
|
69
|
+
* catalog entry offers (Seedance 2.5 Extend 480p / 720p / 1080p; Seedance 2.5
|
|
70
|
+
* Flash Extend 480p / 720p), each the price of
|
|
71
|
+
* {@link SEEDANCE_EXTEND_RATE_SECONDS} seconds. Read from the catalog, so a
|
|
72
|
+
* provider's rows and the resolutions it renders cannot differ.
|
|
73
|
+
*/
|
|
74
|
+
export const SEEDANCE_EXTEND_RATE_CREDIT_IDS_BY_PROVIDER: Readonly<Record<SentPricedSeedanceExtendProvider, Readonly<Record<string, string>>>> =
|
|
75
|
+
Object.fromEntries(
|
|
76
|
+
SEEDANCE_EXTEND_SENT_PRICED_PROVIDERS.map((provider) => [
|
|
77
|
+
provider,
|
|
78
|
+
Object.fromEntries((MODEL_CATALOG[provider]?.resolutions ?? []).map((resolution) => [resolution, rateRowId(provider, resolution)])),
|
|
79
|
+
]),
|
|
80
|
+
) as Record<SentPricedSeedanceExtendProvider, Record<string, string>>
|
|
81
|
+
|
|
82
|
+
/** Seedance 2.5 Extend's rate row of each resolution: the price of {@link SEEDANCE_EXTEND_RATE_SECONDS} seconds. */
|
|
39
83
|
export const SEEDANCE_EXTEND_RATE_CREDIT_IDS: Readonly<Record<"480p" | "720p" | "1080p", string>> = {
|
|
40
84
|
"480p": "seedance-2-5-extend:480p:per-2s",
|
|
41
85
|
"720p": "seedance-2-5-extend:720p:per-2s",
|
|
42
86
|
"1080p": "seedance-2-5-extend:1080p:per-2s",
|
|
43
87
|
}
|
|
44
88
|
|
|
45
|
-
/** Is `provider`
|
|
89
|
+
/** Is `provider` an Extend Video provider priced by the seconds it sends? A retired id answers false: pass it through `canonicalVideoProvider` first. */
|
|
46
90
|
export function isSeedanceExtendPricedBySecondsSent(provider: unknown): provider is SentPricedSeedanceExtendProvider {
|
|
47
|
-
return provider ===
|
|
91
|
+
return typeof provider === "string" && (SEEDANCE_EXTEND_SENT_PRICED_PROVIDERS as readonly string[]).includes(provider)
|
|
48
92
|
}
|
|
49
93
|
|
|
50
|
-
/** Is `id` one of the rate rows? */
|
|
94
|
+
/** Is `id` one of the rate rows (of any sent-priced provider)? */
|
|
51
95
|
export function isSeedanceExtendRateCreditId(id: unknown): boolean {
|
|
52
|
-
return typeof id === "string" &&
|
|
96
|
+
return typeof id === "string" && Object.values(SEEDANCE_EXTEND_RATE_CREDIT_IDS_BY_PROVIDER).some((rows) => Object.values(rows).includes(id))
|
|
53
97
|
}
|
|
54
98
|
|
|
55
99
|
/**
|
|
@@ -67,6 +111,20 @@ export function seedanceExtendAddedSec(provider: TailExtendProvider, duration: u
|
|
|
67
111
|
return Math.min(max, Math.max(min, Math.round(pricedOutputDurationSec(provider, requested))))
|
|
68
112
|
}
|
|
69
113
|
|
|
114
|
+
/**
|
|
115
|
+
* The shortest source (its picture) each sent-priced provider continues, in
|
|
116
|
+
* seconds: the shortest reference video its model takes. Seedance 2.5 Extend:
|
|
117
|
+
* 1.8 s, measured on the 2.0 family (`SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC`; a
|
|
118
|
+
* nominal 2 s clip that probes a frame short still runs). Seedance 2.5 Flash
|
|
119
|
+
* Extend: Flash's documented 2 s (`VIDEO_REF_VIDEO_DURATION_LIMITS`, decided
|
|
120
|
+
* 2026-11-16). The route and a quote refuse a shorter source, and the worker
|
|
121
|
+
* again before it generates.
|
|
122
|
+
*/
|
|
123
|
+
export const SEEDANCE_EXTEND_MIN_SOURCE_SEC: Readonly<Record<SentPricedSeedanceExtendProvider, number>> = {
|
|
124
|
+
"seedance-2-5-extend": SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC,
|
|
125
|
+
"seedance-2-5-flash-extend": VIDEO_REF_VIDEO_DURATION_LIMITS["seedance-2-5-flash"]!.minSec,
|
|
126
|
+
}
|
|
127
|
+
|
|
70
128
|
/** A length the source gives, when it is one: finite and above 0. */
|
|
71
129
|
function knownSec(sec: number | null | undefined): number | undefined {
|
|
72
130
|
return typeof sec === "number" && Number.isFinite(sec) && sec > 0 ? sec : undefined
|
|
@@ -98,16 +156,21 @@ export function seedanceExtendSentSec(sourcePictureSec: number | null | undefine
|
|
|
98
156
|
}
|
|
99
157
|
|
|
100
158
|
/**
|
|
101
|
-
* Whether a
|
|
102
|
-
* length: a known length (positive, finite) under the shortest source
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* measures the source itself).
|
|
159
|
+
* Whether a sent-priced extend on `provider` refuses a source of this measured
|
|
160
|
+
* picture length: a known length (positive, finite) under the shortest source
|
|
161
|
+
* the provider takes ({@link SEEDANCE_EXTEND_MIN_SOURCE_SEC}: 1.8 s, 2 s on
|
|
162
|
+
* Seedance 2.5 Flash Extend), compared as measured, as the route refuses it
|
|
163
|
+
* before anything is reserved and the worker before it generates. A length
|
|
164
|
+
* that is not known is never refused here (the run measures the source itself).
|
|
107
165
|
*/
|
|
108
|
-
export function
|
|
166
|
+
export function seedanceExtendSourceRefused(provider: SentPricedSeedanceExtendProvider, sourcePictureSec: number | null | undefined): boolean {
|
|
109
167
|
const known = knownSec(sourcePictureSec)
|
|
110
|
-
return known !== undefined && known <
|
|
168
|
+
return known !== undefined && known < SEEDANCE_EXTEND_MIN_SOURCE_SEC[provider]
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** Seedance 2.5 Extend's {@link seedanceExtendSourceRefused} (its 1.8 s floor). */
|
|
172
|
+
export function seedanceExtendRefusesSource(sourcePictureSec: number | null | undefined): boolean {
|
|
173
|
+
return seedanceExtendSourceRefused(SEEDANCE_EXTEND_SENT_PRICED_PROVIDER, sourcePictureSec)
|
|
111
174
|
}
|
|
112
175
|
|
|
113
176
|
/** The units of a rate row a run that sends `sentSec` and adds `addedSec` is charged. */
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a Seedance Lip Sync run renders and is priced at — ONE rule for the
|
|
3
|
+
* route, the workflow run, the editor's estimate and the worker (decided
|
|
4
|
+
* 2026-11-16).
|
|
5
|
+
*
|
|
6
|
+
* A Seedance Lip Sync run (the Seedance 2 family on the Lip Sync node: one
|
|
7
|
+
* portrait plus the voice line as reference AUDIO, no reference video) renders
|
|
8
|
+
* a fixed {@link SEEDANCE_LIP_SYNC_SECONDS}-second clip. The provider bills it
|
|
9
|
+
* at the model's plain per-second rate — a reference video is what moves a
|
|
10
|
+
* Seedance run onto the `-ref` rate (input + output seconds), and this run has
|
|
11
|
+
* none — so it is priced on the plain row `<model>:8s:<resolution>`.
|
|
12
|
+
*
|
|
13
|
+
* The resolution is the one asked when the model renders it, else the model's
|
|
14
|
+
* top catalog tier (a 1080p asked of Seedance 2 Fast renders and bills 720p),
|
|
15
|
+
* and 720p when none is asked. Every catalog tier of every family member has a
|
|
16
|
+
* plain 8-second row. The worker sends this same resolution, so what renders is
|
|
17
|
+
* what was priced.
|
|
18
|
+
*
|
|
19
|
+
* MiniMax Hailuo 3 rides the same Lip Sync lane but is no Seedance model: it is
|
|
20
|
+
* priced and sent on its own rule (`minimax-h3:8s`), never here.
|
|
21
|
+
*/
|
|
22
|
+
import { MODEL_CATALOG } from "./model-catalog.js"
|
|
23
|
+
import { SEEDANCE_LIP_SYNC_PROVIDERS, isMinimaxH3Provider, isSeedance2Provider } from "./model-constants.js"
|
|
24
|
+
|
|
25
|
+
/** The length, in seconds, a Seedance Lip Sync run renders and is priced at. */
|
|
26
|
+
export const SEEDANCE_LIP_SYNC_SECONDS = 8
|
|
27
|
+
|
|
28
|
+
/** The resolution a Seedance Lip Sync run uses when none is asked. */
|
|
29
|
+
const SEEDANCE_LIP_SYNC_DEFAULT_RESOLUTION = "720p"
|
|
30
|
+
|
|
31
|
+
/** Whether this Lip Sync model is a Seedance model priced by {@link seedanceLipSyncCreditId}. */
|
|
32
|
+
export function isSeedanceLipSyncProvider(provider: unknown): provider is string {
|
|
33
|
+
return typeof provider === "string" && SEEDANCE_LIP_SYNC_PROVIDERS.has(provider) && isSeedance2Provider(provider)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The resolution a Seedance Lip Sync run renders and is priced at (see the file comment). */
|
|
37
|
+
export function seedanceLipSyncResolution(provider: string, resolution?: unknown): string {
|
|
38
|
+
const supported = MODEL_CATALOG[provider]?.resolutions ?? []
|
|
39
|
+
const want = typeof resolution === "string" && resolution !== "" ? resolution : SEEDANCE_LIP_SYNC_DEFAULT_RESOLUTION
|
|
40
|
+
if (supported.includes(want)) return want
|
|
41
|
+
return supported[supported.length - 1] ?? SEEDANCE_LIP_SYNC_DEFAULT_RESOLUTION
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** The credit id a Seedance Lip Sync run is held and charged on: its plain 8-second row. */
|
|
45
|
+
export function seedanceLipSyncCreditId(provider: string, resolution?: unknown): string {
|
|
46
|
+
return `${provider}:${SEEDANCE_LIP_SYNC_SECONDS}s:${seedanceLipSyncResolution(provider, resolution)}`
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* MiniMax Hailuo 3 on Lip Sync: the same portrait-plus-voice-line run, held on
|
|
51
|
+
* its 8-second 2K row on every path (decided 2026-11-16). The Lip Sync
|
|
52
|
+
* resolution never names H3's own 768P tier, and KIE renders 2K when none is
|
|
53
|
+
* sent, so the row does not follow the resolution and nothing sent changes.
|
|
54
|
+
*/
|
|
55
|
+
export const MINIMAX_H3_LIP_SYNC_CREDIT_ID = `minimax-h3:${SEEDANCE_LIP_SYNC_SECONDS}s`
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The credit id a Lip Sync run on a multimodal video model (the Seedance 2
|
|
59
|
+
* family and MiniMax Hailuo 3: a portrait plus the voice line as reference
|
|
60
|
+
* audio) is held and charged on — the ONE rule the route, the workflow run,
|
|
61
|
+
* the film pipeline and both estimates read. Undefined for every other Lip
|
|
62
|
+
* Sync model.
|
|
63
|
+
*/
|
|
64
|
+
export function referenceAudioLipSyncCreditId(provider: unknown, resolution?: unknown): string | undefined {
|
|
65
|
+
if (isSeedanceLipSyncProvider(provider)) return seedanceLipSyncCreditId(provider, resolution)
|
|
66
|
+
if (typeof provider === "string" && isMinimaxH3Provider(provider)) return MINIMAX_H3_LIP_SYNC_CREDIT_ID
|
|
67
|
+
return undefined
|
|
68
|
+
}
|
|
@@ -231,6 +231,13 @@ export function videoCharacterVoiceCap(provider: string | undefined): number {
|
|
|
231
231
|
return provider ? (VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.voices ?? 0) : 0
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
/** Every provider that takes a pinned voice persona (a positive `voices` cap), in declaration order. */
|
|
235
|
+
function videoCharacterVoiceProviders(): string[] {
|
|
236
|
+
return Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER)
|
|
237
|
+
.filter(([, l]) => (l?.voices ?? 0) > 0)
|
|
238
|
+
.map(([id]) => id)
|
|
239
|
+
}
|
|
240
|
+
|
|
234
241
|
/**
|
|
235
242
|
* Identity of a voice persona — what makes two voices "the same voice". The
|
|
236
243
|
* persona is minted per (preset, description, example line) AND the character's
|
|
@@ -307,7 +314,7 @@ export function videoCharacterVoiceProblem(args: {
|
|
|
307
314
|
code: "character_voice_unsupported",
|
|
308
315
|
message:
|
|
309
316
|
`A character voice is not supported by ${args.provider ?? "the selected model"}. ` +
|
|
310
|
-
|
|
317
|
+
`Drop the voice, or pick a model that takes one: ${videoCharacterVoiceProviders().join(", ")}.`,
|
|
311
318
|
}
|
|
312
319
|
}
|
|
313
320
|
if (distinct > cap) {
|
|
@@ -325,7 +332,8 @@ export function videoCharacterVoiceProblem(args: {
|
|
|
325
332
|
*
|
|
326
333
|
* The shared budget: for a model that declares `characters`, its `images` cap
|
|
327
334
|
* IS the total input budget (images + 2×videos + character units ≤ images cap —
|
|
328
|
-
* 7 for Gemini Omni)
|
|
335
|
+
* 7 for Gemini Omni), unless it declares `charactersOutsideImageBudget`
|
|
336
|
+
* (Gemini Omni Flash 1.2: characters spend no unit). Callers pass the ASSEMBLED image count, after any
|
|
329
337
|
* `connectedReferences` expansion, so the budget is measured on what ships.
|
|
330
338
|
*/
|
|
331
339
|
export function videoCharacterRefProblem(args: {
|
|
@@ -387,13 +395,22 @@ export function videoCharacterRefProblem(args: {
|
|
|
387
395
|
// the upstream would take it beside `character_ids`. We reject the pair
|
|
388
396
|
// because the frame / identity roles are not yet bound in the prompt
|
|
389
397
|
// (and the frame would need to be budgeted against the shared input quota).
|
|
398
|
+
// A model whose characters sit outside its image budget (Gemini Omni Flash
|
|
399
|
+
// 1.2): the platform does not combine characters with a start or end frame
|
|
400
|
+
// on it (decided 2026-11-17, mirroring 1.1). Its upstream refuses characters
|
|
401
|
+
// beside a real first/last frame, but would take a frame sent as a reference
|
|
402
|
+
// image beside references — so the sentence names no budget and no upstream
|
|
403
|
+
// rule, only what the platform does.
|
|
404
|
+
const outsideBudget = limits?.charactersOutsideImageBudget === true
|
|
390
405
|
if (args.hasStartFrame) {
|
|
391
406
|
return {
|
|
392
407
|
code: "character_references_with_start_frame",
|
|
393
|
-
message:
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
408
|
+
message: outsideBudget
|
|
409
|
+
? `Nodaro does not combine characterReferences with a start frame (imageUrl) on ${provider}. ` +
|
|
410
|
+
"Drop the start frame (the character's portrait carries the face), or drop characterReferences."
|
|
411
|
+
: `${provider} does not yet support combining characterReferences with a start frame (imageUrl) — ` +
|
|
412
|
+
"the frame and the characters would compete for the same input slots without a defined role. " +
|
|
413
|
+
"Drop the start frame (the character's portrait carries the face), or drop characterReferences.",
|
|
397
414
|
}
|
|
398
415
|
}
|
|
399
416
|
// Gemini Omni has no end-frame input; without this the frame would be dropped
|
|
@@ -406,6 +423,9 @@ export function videoCharacterRefProblem(args: {
|
|
|
406
423
|
"Drop the end frame, or drop characterReferences.",
|
|
407
424
|
}
|
|
408
425
|
}
|
|
426
|
+
// Characters outside the image budget spend nothing from it: the image +
|
|
427
|
+
// video quota is the request builder's, as on a run with no characters.
|
|
428
|
+
if (outsideBudget) return videoCharacterVoiceProblem({ provider, characterReferences })
|
|
409
429
|
const budget = VIDEO_REF_LIMITS_BY_PROVIDER[provider as string]?.images ?? 7
|
|
410
430
|
const used = args.imageCount + args.videoCount * 2 + videoCharacterRefUnits(characterReferences)
|
|
411
431
|
if (used > budget) {
|