@nodaro/shared 3.67.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-23IKLMRL.cjs → chunk-3OHRFSQL.cjs} +53 -51
- package/dist/{chunk-23IKLMRL.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-JTYCJ5OL.cjs → chunk-54E2JO4E.cjs} +100 -33
- 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-6FQBKI2A.cjs → chunk-6JSYNKFL.cjs} +4 -4
- package/dist/{chunk-6FQBKI2A.cjs.map → chunk-6JSYNKFL.cjs.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-RVQW623D.js → chunk-BDW25A7Y.js} +72 -18
- 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-CLAKSLXF.js → chunk-E3PU7YC6.js} +3 -3
- package/dist/{chunk-CLAKSLXF.js.map → chunk-E3PU7YC6.js.map} +1 -1
- 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-ALRXY4QH.cjs → chunk-N7ZJD4CK.cjs} +6 -2
- package/dist/chunk-N7ZJD4CK.cjs.map +1 -0
- package/dist/{chunk-O2QOBA6Q.js → chunk-NPGP6FMU.js} +43 -3
- package/dist/chunk-NPGP6FMU.js.map +1 -0
- 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-NWNRATS3.js +13 -0
- package/dist/chunk-NWNRATS3.js.map +1 -0
- 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-GTBW2KAY.js → chunk-PHQVAPSD.js} +8 -6
- package/dist/{chunk-GTBW2KAY.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-ZQ2BHOFH.cjs → chunk-Q2LEJXLZ.cjs} +6 -6
- package/dist/{chunk-ZQ2BHOFH.cjs.map → chunk-Q2LEJXLZ.cjs.map} +1 -1
- 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-O6TBB4IF.cjs → chunk-TZWXZDSX.cjs} +48 -2
- package/dist/chunk-TZWXZDSX.cjs.map +1 -0
- 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-CFTXW3ZL.js → chunk-UVUHVY7F.js} +3 -3
- package/dist/{chunk-CFTXW3ZL.js.map → chunk-UVUHVY7F.js.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 +295 -219
- package/dist/entries/credits.d.cts +233 -70
- package/dist/entries/credits.d.ts +233 -70
- package/dist/entries/credits.js +11 -11
- 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/media.cjs +111 -107
- package/dist/entries/media.d.cts +17 -2
- package/dist/entries/media.d.ts +17 -2
- package/dist/entries/media.js +3 -3
- package/dist/entries/model-catalog.cjs +133 -133
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +433 -397
- package/dist/entries/models.d.cts +2 -2
- package/dist/entries/models.d.ts +2 -2
- package/dist/entries/models.js +8 -8
- 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/runtime-config.cjs +53 -29
- package/dist/entries/runtime-config.d.cts +53 -1
- package/dist/entries/runtime-config.d.ts +53 -1
- 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 +12 -5
- package/dist/entries/types.d.ts +12 -5
- 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 +1882 -1726
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +25 -25
- 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__/add-captions-nemotron-pricing.test.ts +13 -1
- package/src/__tests__/extend-providers.test.ts +43 -6
- package/src/__tests__/fixtures/measured-input-quote-parity.json +2352 -1
- package/src/__tests__/fixtures/planned-length-quote-parity.json +100 -10
- package/src/__tests__/fixtures/probed-node-quote-parity.json +132 -0
- package/src/__tests__/fixtures/video-utility-quote-parity.json +945 -38
- 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__/nemotron-transcribe-pricing.test.ts +32 -0
- package/src/__tests__/runtime-config-lists.test.ts +92 -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/catalog-projection.ts +12 -5
- package/src/credit-estimators/add-captions-nemotron.ts +11 -1
- package/src/credit-estimators/index.ts +6 -1
- package/src/credit-estimators/nemotron-transcribe.ts +35 -3
- package/src/credit-estimators/pitch-tempo.ts +14 -0
- package/src/credit-estimators/video-sfx.ts +15 -0
- package/src/credit-estimators/video-utils.ts +48 -12
- package/src/credit-identifiers.ts +51 -32
- package/src/entries/credits.ts +18 -0
- package/src/entries/llm-models.ts +4 -0
- package/src/entries/models.ts +11 -0
- package/src/entries/runtime-config.ts +10 -1
- package/src/gemini-omni-extend-quote.ts +76 -0
- package/src/lip-sync-pricing.ts +16 -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/priced-clip-seconds.ts +19 -1
- package/src/runtime-config/lists.ts +87 -0
- package/src/runtime-config/worlds.ts +10 -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-5NVGKXJV.cjs.map +0 -1
- package/dist/chunk-ALRXY4QH.cjs.map +0 -1
- package/dist/chunk-E62W5I6A.cjs.map +0 -1
- package/dist/chunk-HTDKEYMY.cjs.map +0 -1
- package/dist/chunk-JTYCJ5OL.cjs.map +0 -1
- package/dist/chunk-MVXZP6VB.js.map +0 -1
- package/dist/chunk-O2QOBA6Q.js.map +0 -1
- package/dist/chunk-O6TBB4IF.cjs.map +0 -1
- package/dist/chunk-PAUWEWTY.js.map +0 -1
- package/dist/chunk-PJAJCFLP.cjs.map +0 -1
- package/dist/chunk-RVQW623D.js.map +0 -1
- package/dist/chunk-SCDE676D.js.map +0 -1
- package/dist/chunk-SMOO5FAH.js +0 -10
- package/dist/chunk-SMOO5FAH.js.map +0 -1
- package/dist/chunk-V6OXSXIX.js.map +0 -1
- package/dist/chunk-VBP4DH37.js.map +0 -1
|
@@ -25,6 +25,7 @@ describe("character reference capability (data-driven)", () => {
|
|
|
25
25
|
it("both Gemini Omni SKUs declare a 3-character cap, Kling 4.0 and Kling 4.0 Flash a 7-subject cap; nothing else does", () => {
|
|
26
26
|
expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-video"]?.characters).toBe(3)
|
|
27
27
|
expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-flash"]?.characters).toBe(3)
|
|
28
|
+
expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-flash-1-2"]?.characters).toBe(2)
|
|
28
29
|
expect(VIDEO_REF_LIMITS_BY_PROVIDER["kling-4"]?.characters).toBe(7)
|
|
29
30
|
expect(VIDEO_REF_LIMITS_BY_PROVIDER["kling-4-flash"]?.characters).toBe(7)
|
|
30
31
|
const others = Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER)
|
|
@@ -114,6 +115,53 @@ describe("videoCharacterRefProblem", () => {
|
|
|
114
115
|
expect(over?.message).toContain("7")
|
|
115
116
|
})
|
|
116
117
|
|
|
118
|
+
describe("Gemini Omni Flash 1.2 (characters outside the image budget, decided 2026-11-17)", () => {
|
|
119
|
+
const omni12 = { ...base, provider: "gemini-omni-flash-1-2" }
|
|
120
|
+
|
|
121
|
+
it("is the only model whose characters sit outside its budget, and it takes no voices", () => {
|
|
122
|
+
const outside = Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER).filter(([, l]) => l?.charactersOutsideImageBudget).map(([id]) => id)
|
|
123
|
+
expect(outside).toEqual(["gemini-omni-flash-1-2"])
|
|
124
|
+
expect(videoCharacterRefCap("gemini-omni-flash-1-2")).toBe(2)
|
|
125
|
+
expect(videoCharacterVoiceCap("gemini-omni-flash-1-2")).toBe(0)
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
it("takes 1 or 2 characters beside a full image list and a source video — they count toward no quota", () => {
|
|
129
|
+
expect(videoCharacterRefProblem({ ...omni12, characterReferences: [portrait()] })).toBeNull()
|
|
130
|
+
expect(videoCharacterRefProblem({ ...omni12, imageCount: 6, characterReferences: [portrait(), portrait()] })).toBeNull()
|
|
131
|
+
const withBody = portrait({ bodyImageUrl: "https://cdn.example/b.png" })
|
|
132
|
+
expect(videoCharacterRefProblem({ ...omni12, imageCount: 5, videoCount: 1, characterReferences: [withBody, withBody] })).toBeNull()
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
it("a third character is over its limit, as on 1.1", () => {
|
|
136
|
+
const p = videoCharacterRefProblem({ ...omni12, characterReferences: [portrait(), portrait(), portrait()] })
|
|
137
|
+
expect(p?.code).toBe("character_references_over_limit")
|
|
138
|
+
expect(p?.message).toContain("at most 2")
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
it("a start or end frame beside characters is refused with the same codes as 1.1, worded as what the platform does, not a budget", () => {
|
|
142
|
+
const start = videoCharacterRefProblem({ ...omni12, hasStartFrame: true, characterReferences: [portrait()] })
|
|
143
|
+
expect(start?.code).toBe("character_references_with_start_frame")
|
|
144
|
+
expect(start?.message).not.toContain("compete for the same input slots")
|
|
145
|
+
expect(start?.message).toContain("imageUrl")
|
|
146
|
+
const end = videoCharacterRefProblem({ ...omni12, hasEndFrame: true, characterReferences: [portrait()] })
|
|
147
|
+
expect(end?.code).toBe("character_references_with_end_frame")
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
it("a pinned voice is refused, naming the models that take one", () => {
|
|
151
|
+
const p = videoCharacterRefProblem({ ...omni12, characterReferences: [portrait({ voice: { preset: "kore" } })] })
|
|
152
|
+
expect(p?.code).toBe("character_voice_unsupported")
|
|
153
|
+
expect(p?.message).toContain("gemini-omni-video, gemini-omni-flash.")
|
|
154
|
+
expect(p?.message).toMatch(/takes one: gemini-omni-video, gemini-omni-flash\.$/)
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
it("1.1 keeps its 7-unit budget and its own start-frame sentence", () => {
|
|
158
|
+
const p = videoCharacterRefProblem({ ...base, provider: "gemini-omni-flash", imageCount: 5, characterReferences: [portrait(), portrait(), portrait()] })
|
|
159
|
+
expect(p?.code).toBe("character_references_quota")
|
|
160
|
+
const start = videoCharacterRefProblem({ ...base, provider: "gemini-omni-flash", hasStartFrame: true, characterReferences: [portrait()] })
|
|
161
|
+
expect(start?.message).toContain("compete for the same input slots")
|
|
162
|
+
})
|
|
163
|
+
})
|
|
164
|
+
|
|
117
165
|
it("a body image costs a second unit in the quota", () => {
|
|
118
166
|
const withBody = portrait({ bodyImageUrl: "https://cdn.example/b.png" })
|
|
119
167
|
// 2 body-sets (4) + 3 images = 7 → ok; + 1 more image = 8 → rejected
|
|
@@ -50,6 +50,13 @@ export interface ProjectedCatalogOption {
|
|
|
50
50
|
* look previews, which only Nodaro Cloud serves. Absent when the option has
|
|
51
51
|
* no picture. Content-hashed where self-hosted: a changed picture gets a new
|
|
52
52
|
* URL, so it can be cached indefinitely.
|
|
53
|
+
*
|
|
54
|
+
* On a deployment that shows its own pictures (`catalogs.images: "own"`) it
|
|
55
|
+
* is the deployment's picture: an absolute URL on its media host, or — on
|
|
56
|
+
* the REST replies — a path on the deployment's own site (`/brand/…`), which
|
|
57
|
+
* resolves against the address the API was called at (a page on that site
|
|
58
|
+
* uses it as it is; a client elsewhere resolves it against its API base).
|
|
59
|
+
* The MCP tools give that path absolute.
|
|
53
60
|
*/
|
|
54
61
|
imageUrl?: string
|
|
55
62
|
/**
|
|
@@ -61,11 +68,11 @@ export interface ProjectedCatalogOption {
|
|
|
61
68
|
*/
|
|
62
69
|
imageSrcSet?: string
|
|
63
70
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
71
|
+
* The option's enlarged picture: the larger version to show where a picker
|
|
72
|
+
* shows the option big (hover, zoom, a detail view). Present only on a
|
|
73
|
+
* deployment that shows its own pictures (`catalogs.images: "own"`) and gave
|
|
74
|
+
* one for this option, on the REST replies; on its media host or a path on
|
|
75
|
+
* its site, like `imageUrl`. Absent otherwise — draw `imageUrl` there instead.
|
|
69
76
|
*/
|
|
70
77
|
imageLargeUrl?: string
|
|
71
78
|
}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import {
|
|
23
23
|
NEMOTRON_TRANSCRIBE_PRICING,
|
|
24
|
+
nemotronHeldMinutes,
|
|
24
25
|
nemotronTranscribeBaseCredits,
|
|
25
26
|
nemotronTranscribeStartedMinutes,
|
|
26
27
|
} from "./nemotron-transcribe.js"
|
|
@@ -37,11 +38,20 @@ export function addCaptionsNemotronMinutesId(minutes: number): string {
|
|
|
37
38
|
return `${ADD_CAPTIONS_NEMOTRON_ID_PREFIX}:${n}m`
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
/** The id a Nemotron caption run on a video of `durationSec` seconds
|
|
41
|
+
/** The id of a Nemotron caption run on a video of `durationSec` seconds' started minutes (the price of that length; a quote names it). */
|
|
41
42
|
export function addCaptionsNemotronCreditId(durationSec: number | null | undefined): string {
|
|
42
43
|
return addCaptionsNemotronMinutesId(nemotronTranscribeStartedMinutes(durationSec))
|
|
43
44
|
}
|
|
44
45
|
|
|
46
|
+
/**
|
|
47
|
+
* The id a Nemotron caption run on a video it measured at `measuredSec`
|
|
48
|
+
* seconds HOLDS: the started minutes less the one second its charge forgives
|
|
49
|
+
* (`nemotronHeldMinutes`, the Transcribe node's own rule).
|
|
50
|
+
*/
|
|
51
|
+
export function addCaptionsNemotronHeldCreditId(measuredSec: number): string {
|
|
52
|
+
return addCaptionsNemotronMinutesId(nemotronHeldMinutes(measuredSec))
|
|
53
|
+
}
|
|
54
|
+
|
|
45
55
|
/**
|
|
46
56
|
* The id a QUOTE names for a video of `durationSec` seconds — every estimate
|
|
47
57
|
* before a run. A known length is the id its run holds; an UNKNOWN length is
|
|
@@ -14,7 +14,7 @@ export {
|
|
|
14
14
|
imageOverlayCredits,
|
|
15
15
|
} from "./image-overlay.js"
|
|
16
16
|
|
|
17
|
-
export { VIDEO_SFX_PRICING, videoSfxCreditId, videoSfxQuoteCreditId } from "./video-sfx.js"
|
|
17
|
+
export { VIDEO_SFX_PRICING, videoSfxCreditId, videoSfxHeldCreditId, videoSfxQuoteCreditId } from "./video-sfx.js"
|
|
18
18
|
|
|
19
19
|
export {
|
|
20
20
|
TEXT_TO_AUDIO_PRICING,
|
|
@@ -80,6 +80,7 @@ export {
|
|
|
80
80
|
PITCH_TEMPO_LIMITS,
|
|
81
81
|
pitchTempoStartedMinutes,
|
|
82
82
|
pitchTempoCreditId,
|
|
83
|
+
pitchTempoHeldCreditId,
|
|
83
84
|
pitchTempoQuoteCreditId,
|
|
84
85
|
parsePitchTempoCreditId,
|
|
85
86
|
pitchTempoBaseCredits,
|
|
@@ -89,8 +90,11 @@ export {
|
|
|
89
90
|
export {
|
|
90
91
|
NEMOTRON_TRANSCRIBE_ID,
|
|
91
92
|
NEMOTRON_TRANSCRIBE_PRICING,
|
|
93
|
+
NEMOTRON_UPWARD_GRACE_SEC,
|
|
92
94
|
nemotronTranscribeStartedMinutes,
|
|
95
|
+
nemotronHeldMinutes,
|
|
93
96
|
nemotronTranscribeCreditId,
|
|
97
|
+
nemotronTranscribeHeldCreditId,
|
|
94
98
|
nemotronTranscribeQuoteCreditId,
|
|
95
99
|
parseNemotronTranscribeCreditId,
|
|
96
100
|
nemotronTranscribeBaseCredits,
|
|
@@ -101,6 +105,7 @@ export {
|
|
|
101
105
|
ADD_CAPTIONS_NEMOTRON_ID_PREFIX,
|
|
102
106
|
addCaptionsNemotronMinutesId,
|
|
103
107
|
addCaptionsNemotronCreditId,
|
|
108
|
+
addCaptionsNemotronHeldCreditId,
|
|
104
109
|
addCaptionsNemotronQuoteCreditId,
|
|
105
110
|
parseAddCaptionsNemotronCreditId,
|
|
106
111
|
addCaptionsNemotronBaseCredits,
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* The base price is 0.75 credits a minute, which no whole-credit row can hold
|
|
6
6
|
* (`model_pricing.credit_cost` is an integer), so the rate row prices FOUR
|
|
7
7
|
* minutes — the same trick as Nodaro Video Upscale's four-second rows. A run
|
|
8
|
-
* reserves `nemotron-3-5-transcribe:<N>m` (N = started minutes, 1..60
|
|
8
|
+
* reserves `nemotron-3-5-transcribe:<N>m` (N = started minutes, 1..60; a
|
|
9
|
+
* measured file's less the one second its charge forgives), which
|
|
9
10
|
* billing prices as that row × N ÷ 4, rounded up once for the whole run, then
|
|
10
11
|
* marked up once — never a row of its own, so a retune of the rate row moves
|
|
11
12
|
* the route, the workflow run, the node's Run button and every estimate
|
|
@@ -16,7 +17,9 @@
|
|
|
16
17
|
* `lib/nemotron-transcribe-settle.ts`).
|
|
17
18
|
*
|
|
18
19
|
* Worked base prices at the row's launch value of 3 (per 4 minutes):
|
|
19
|
-
* 0:45 → 1, 1:00 → 1, 1:
|
|
20
|
+
* 0:45 → 1, 1:00 → 1, 1:05 → 2, 10:00 → 8, 60:00 → 45
|
|
21
|
+
* (a length's started minutes; a measured file up to 1 s past a minute is
|
|
22
|
+
* held and charged the minute below, {@link nemotronHeldMinutes}).
|
|
20
23
|
* The listed (marked-up) price follows from those.
|
|
21
24
|
*/
|
|
22
25
|
|
|
@@ -50,11 +53,40 @@ export function nemotronTranscribeStartedMinutes(durationSec: number | null | un
|
|
|
50
53
|
return Math.min(NEMOTRON_TRANSCRIBE_PRICING.MAX_MINUTES, Math.max(1, Math.ceil(durationSec / 60)))
|
|
51
54
|
}
|
|
52
55
|
|
|
53
|
-
/** `nemotron-3-5-transcribe:<N>m` — the id
|
|
56
|
+
/** `nemotron-3-5-transcribe:<N>m` — the id of `durationSec` seconds' started minutes (the price of that length; a quote names it). */
|
|
54
57
|
export function nemotronTranscribeCreditId(durationSec: number | null | undefined): string {
|
|
55
58
|
return `${NEMOTRON_TRANSCRIBE_ID}:${nemotronTranscribeStartedMinutes(durationSec)}m`
|
|
56
59
|
}
|
|
57
60
|
|
|
61
|
+
/**
|
|
62
|
+
* How far past a whole minute a file may run and still be held and charged the
|
|
63
|
+
* minute below it: one second (decided 2026-11-12 for the charge, which reads
|
|
64
|
+
* KIE's decoded length; the hold reads it too, {@link nemotronHeldMinutes}).
|
|
65
|
+
* Decoders and containers disagree by a few hundredths at a file's end — a
|
|
66
|
+
* 60-second cut re-encoded with its sound measures 60.0004–60.011 s.
|
|
67
|
+
*/
|
|
68
|
+
export const NEMOTRON_UPWARD_GRACE_SEC = 1
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The started minutes a run HOLDS for a file it measured at `measuredSec`
|
|
72
|
+
* before it runs: those of the length less {@link NEMOTRON_UPWARD_GRACE_SEC},
|
|
73
|
+
* at least 1, at most 60 — the minutes its charge settles at when KIE decodes
|
|
74
|
+
* the file within the grace of them (backend `nemotronChargeId`, which forgives
|
|
75
|
+
* only a length past the HELD minutes). So a quote of a length the graph knows
|
|
76
|
+
* is never below the hold of a file that measures up to the grace past it, and
|
|
77
|
+
* a file a hair past a minute is held and charged as that minute. The one rule
|
|
78
|
+
* both holds read: the Transcribe node's (`nemotronTranscribeHeldCreditId`) and
|
|
79
|
+
* Add Captions' on Nemotron (`addCaptionsNemotronHeldCreditId`).
|
|
80
|
+
*/
|
|
81
|
+
export function nemotronHeldMinutes(measuredSec: number): number {
|
|
82
|
+
return nemotronTranscribeStartedMinutes(measuredSec - NEMOTRON_UPWARD_GRACE_SEC)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** `nemotron-3-5-transcribe:<N>m` — the id a run on a file it measured at `measuredSec` seconds holds ({@link nemotronHeldMinutes}). */
|
|
86
|
+
export function nemotronTranscribeHeldCreditId(measuredSec: number): string {
|
|
87
|
+
return `${NEMOTRON_TRANSCRIBE_ID}:${nemotronHeldMinutes(measuredSec)}m`
|
|
88
|
+
}
|
|
89
|
+
|
|
58
90
|
/**
|
|
59
91
|
* The id a QUOTE names for a file of `durationSec` seconds — every estimate
|
|
60
92
|
* before a run. A known length is the id its run reserves. An UNKNOWN length is
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* 0:45 → 20, 1:00 → 20, 1:01 → 40, 3:10 → 80, 30:00 → 600.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { gracedMeasuredSec } from "../priced-clip-seconds.js"
|
|
18
|
+
|
|
17
19
|
export const PITCH_TEMPO_PRICING = {
|
|
18
20
|
/** The rate row: credits per started minute. Never reserved by itself. */
|
|
19
21
|
RATE_CREDIT_ID: "pitch-tempo",
|
|
@@ -49,6 +51,18 @@ export function pitchTempoCreditId(durationSec: number | null | undefined): stri
|
|
|
49
51
|
return `pitch-tempo:${pitchTempoStartedMinutes(durationSec)}m`
|
|
50
52
|
}
|
|
51
53
|
|
|
54
|
+
/**
|
|
55
|
+
* `pitch-tempo:<N>m` — the id a run HOLDS and is CHARGED for an input it
|
|
56
|
+
* measured at `measuredSec` seconds: the started minutes of the length less
|
|
57
|
+
* `CLIP_PRICE_GRACE_SEC` (0.05 s, decided 2026-11-14), so a file a hair past a
|
|
58
|
+
* minute is charged the minute its length is quoted at
|
|
59
|
+
* ({@link pitchTempoQuoteCreditId} reads the length exactly).
|
|
60
|
+
*/
|
|
61
|
+
export function pitchTempoHeldCreditId(measuredSec: number): string {
|
|
62
|
+
// Less a float-noise hair too (`gracedMeasuredSec`): 60.05 s less 0.05 s is 60.00000000000001, not past a minute.
|
|
63
|
+
return pitchTempoCreditId(Math.max(Number.MIN_VALUE, gracedMeasuredSec(measuredSec)))
|
|
64
|
+
}
|
|
65
|
+
|
|
52
66
|
/**
|
|
53
67
|
* The id a QUOTE names for an input of `durationSec` seconds — every estimate
|
|
54
68
|
* before a run. A known length is the id its run reserves
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* 5 s → `:8s`, 12 s → `:15s`, 31 s → `:60s`, 180 s → `:300s`.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import { gracedMeasuredSec } from "../priced-clip-seconds.js"
|
|
14
|
+
|
|
13
15
|
export const VIDEO_SFX_PRICING = {
|
|
14
16
|
/** The longest input video a run accepts, in seconds. */
|
|
15
17
|
MAX_DURATION_SEC: 300,
|
|
@@ -40,6 +42,19 @@ export function videoSfxCreditId(durationSec: number | null | undefined): string
|
|
|
40
42
|
return bucket.creditId
|
|
41
43
|
}
|
|
42
44
|
|
|
45
|
+
/**
|
|
46
|
+
* The price row a run HOLDS and is CHARGED for an input video it measured at
|
|
47
|
+
* `measuredSec` seconds: the row of the length less `CLIP_PRICE_GRACE_SEC`
|
|
48
|
+
* (0.05 s, decided 2026-11-14), so a container a hair past a row's length (a
|
|
49
|
+
* re-encoded 30 s cut measures 30.016 s) is charged that row, the one its
|
|
50
|
+
* length is quoted at ({@link videoSfxQuoteCreditId}, which reads the length
|
|
51
|
+
* exactly). Past the grace, the next row.
|
|
52
|
+
*/
|
|
53
|
+
export function videoSfxHeldCreditId(measuredSec: number): string {
|
|
54
|
+
// Less a float-noise hair too (`gracedMeasuredSec`): 15.05 s less 0.05 s is 15.000000000000002, not past 15 s.
|
|
55
|
+
return videoSfxCreditId(Math.max(Number.MIN_VALUE, gracedMeasuredSec(measuredSec)))
|
|
56
|
+
}
|
|
57
|
+
|
|
43
58
|
/**
|
|
44
59
|
* The price row a QUOTE names for an input video of `durationSec` seconds —
|
|
45
60
|
* every estimate before a run (the node's Run button, the workflow estimate,
|
|
@@ -58,8 +58,30 @@ export interface CombineVideosEstimatorInput {
|
|
|
58
58
|
transitionDuration?: number
|
|
59
59
|
trimStartFrames?: number
|
|
60
60
|
trimEndFrames?: number
|
|
61
|
+
/**
|
|
62
|
+
* The frame rate the clips' frame trims are cut at (the rate the join
|
|
63
|
+
* conforms its clips to), when known. Absent, 24 fps, the estimate's
|
|
64
|
+
* long-standing assumption. The trims come off at the joins only: the start
|
|
65
|
+
* of every clip but the first, the end of every clip but the last.
|
|
66
|
+
*/
|
|
67
|
+
trimFramesPerSecond?: number
|
|
68
|
+
/**
|
|
69
|
+
* Per-join transitions (Combine Videos' `transitions`): `index` k is the
|
|
70
|
+
* join between clip k and clip k + 1. A join with an entry blends for its
|
|
71
|
+
* own `duration` (a `"cut"`, or a duration of 0, overlaps nothing); every
|
|
72
|
+
* other join keeps `transition` / `transitionDuration`. An index outside the
|
|
73
|
+
* joins is ignored, and a later entry for the same join wins, as the join
|
|
74
|
+
* renders them.
|
|
75
|
+
*/
|
|
76
|
+
transitions?: ReadonlyArray<{ readonly index?: number; readonly transition?: string; readonly duration?: number }>
|
|
61
77
|
}
|
|
62
78
|
|
|
79
|
+
/** The most a join may overlap, as a share of the shortest clip it joins (the render's own clamp). */
|
|
80
|
+
const COMBINE_MAX_OVERLAP_SHARE = 0.9
|
|
81
|
+
|
|
82
|
+
/** A length in seconds when it is a positive one, else 0 (a transition with no length overlaps nothing). */
|
|
83
|
+
const positiveSeconds = (v: unknown): number => (typeof v === "number" && Number.isFinite(v) && v > 0 ? v : 0)
|
|
84
|
+
|
|
63
85
|
export function estimateLoopVideoCredits(
|
|
64
86
|
data: LoopVideoEstimatorInput,
|
|
65
87
|
upstreamDuration?: number,
|
|
@@ -130,19 +152,33 @@ export function estimateCombineVideosCredits(
|
|
|
130
152
|
const fallback = VIDEO_UTIL_PRICING.FALLBACK_DURATION_SECONDS
|
|
131
153
|
const n = upstreamDurations.length
|
|
132
154
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
155
|
+
const trimFps =
|
|
156
|
+
data.trimFramesPerSecond !== undefined && Number.isFinite(data.trimFramesPerSecond) && data.trimFramesPerSecond > 0
|
|
157
|
+
? data.trimFramesPerSecond
|
|
158
|
+
: VIDEO_UTIL_PRICING.FRAMES_PER_CREDIT
|
|
159
|
+
const startSec = (data.trimStartFrames ?? 0) / trimFps
|
|
160
|
+
const endSec = (data.trimEndFrames ?? 0) / trimFps
|
|
161
|
+
// Each clip as the join cuts it: the trims come off only where two clips
|
|
162
|
+
// meet — the start of every clip but the first, the end of every clip but
|
|
163
|
+
// the last. The film's own first and last frames are kept.
|
|
164
|
+
const clips = upstreamDurations.map((d, i) => {
|
|
165
|
+
const sec = typeof d === "number" && Number.isFinite(d) && d >= 0 ? d : fallback
|
|
166
|
+
return sec - (i > 0 ? startSec : 0) - (i < n - 1 ? endSec : 0)
|
|
167
|
+
})
|
|
168
|
+
let total = clips.reduce((sum, sec) => sum + sec, 0)
|
|
169
|
+
|
|
170
|
+
// Each join's overlap, as the join renders it: its own transition where one
|
|
171
|
+
// is set, else the global one; at most 90 % of the shortest clip.
|
|
172
|
+
const globalOverlap = data.transition && data.transition !== "cut" ? Math.max(0, data.transitionDuration ?? 0.5) : 0
|
|
173
|
+
const overrides = new Map<number, number>()
|
|
174
|
+
for (const entry of data.transitions ?? []) {
|
|
175
|
+
const index = entry?.index
|
|
176
|
+
if (typeof index !== "number" || !Number.isInteger(index) || index < 0 || index >= n - 1) continue
|
|
177
|
+
const overlap = positiveSeconds(entry.duration)
|
|
178
|
+
overrides.set(index, entry.transition === "cut" ? 0 : overlap)
|
|
136
179
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
total -= (data.transitionDuration ?? 0.5) * (n - 1)
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const trimSecPerClip =
|
|
143
|
-
((data.trimStartFrames ?? 0) + (data.trimEndFrames ?? 0)) /
|
|
144
|
-
VIDEO_UTIL_PRICING.FRAMES_PER_CREDIT
|
|
145
|
-
total -= trimSecPerClip * n
|
|
180
|
+
const maxOverlap = Math.max(0, Math.min(...clips) * COMBINE_MAX_OVERLAP_SHARE)
|
|
181
|
+
for (let k = 0; k < n - 1; k++) total -= Math.min(overrides.get(k) ?? globalOverlap, maxOverlap)
|
|
146
182
|
|
|
147
183
|
const base = Math.ceil(Math.max(0, total) / 5)
|
|
148
184
|
const inputAdder = Math.max(0, n - 2)
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
PIXVERSE_V6_EXTEND_PROVIDER,
|
|
47
47
|
isGrokExtendProvider,
|
|
48
48
|
isGrokExtendSourceModel,
|
|
49
|
+
GROK_EXTEND_SOURCE_NODE_TYPES,
|
|
49
50
|
GROK_EXTEND_PROVIDER,
|
|
50
51
|
type CatalogExtendProvider,
|
|
51
52
|
type SeedanceExtendProvider,
|
|
@@ -53,14 +54,16 @@ import {
|
|
|
53
54
|
} from "./model-constants.js"
|
|
54
55
|
import {
|
|
55
56
|
SEEDANCE_EXTEND_CONTEXT_MAX_SEC,
|
|
56
|
-
|
|
57
|
+
SEEDANCE_EXTEND_RATE_CREDIT_IDS_BY_PROVIDER,
|
|
57
58
|
SEEDANCE_EXTEND_SENT_PRICED_PROVIDER,
|
|
58
59
|
isSeedanceExtendPricedBySecondsSent,
|
|
60
|
+
type SentPricedSeedanceExtendProvider,
|
|
59
61
|
seedanceExtendAddedSec,
|
|
60
|
-
|
|
62
|
+
seedanceExtendSourceRefused,
|
|
61
63
|
seedanceExtendSentSec,
|
|
62
64
|
seedanceExtendUnits,
|
|
63
65
|
} from "./seedance-extend-rate.js"
|
|
66
|
+
import { geminiOmniExtendQuoteCreditId } from "./gemini-omni-extend-quote.js"
|
|
64
67
|
import { unitQuoteCreditId } from "./credit-estimators/unit-quote.js"
|
|
65
68
|
import { isFlux2Model, FLUX2_RES_MP, type Flux2Model } from "./flux2-pricing.js"
|
|
66
69
|
import {
|
|
@@ -817,20 +820,25 @@ export function tailExtendResolution(provider: TailExtendProvider, resolution?:
|
|
|
817
820
|
}
|
|
818
821
|
|
|
819
822
|
/**
|
|
820
|
-
* The rate row a
|
|
821
|
-
* of:
|
|
822
|
-
* ({@link tailExtendResolution}:
|
|
823
|
+
* The rate row a sent-priced Extend Video run at `resolution` is charged a
|
|
824
|
+
* multiple of: `provider`'s row (Seedance 2.5 Extend when none is named) of the
|
|
825
|
+
* resolution the run is priced and rendered at ({@link tailExtendResolution}:
|
|
826
|
+
* one the model offers, else 720p).
|
|
823
827
|
*/
|
|
824
|
-
export function seedanceExtendRateCreditId(
|
|
825
|
-
|
|
826
|
-
|
|
828
|
+
export function seedanceExtendRateCreditId(
|
|
829
|
+
resolution: unknown,
|
|
830
|
+
provider: SentPricedSeedanceExtendProvider = SEEDANCE_EXTEND_SENT_PRICED_PROVIDER,
|
|
831
|
+
): string {
|
|
832
|
+
const rows = SEEDANCE_EXTEND_RATE_CREDIT_IDS_BY_PROVIDER[provider]
|
|
833
|
+
return rows[tailExtendResolution(provider, resolution)] ?? rows[TAIL_EXTEND_DEFAULT_RESOLUTION]!
|
|
827
834
|
}
|
|
828
835
|
|
|
829
836
|
/**
|
|
830
|
-
* The ONE id a Seedance 2.5 Extend
|
|
831
|
-
*
|
|
832
|
-
* run, which the
|
|
833
|
-
* `POST /v1/credits/model-costs`)
|
|
837
|
+
* The ONE id a sent-priced Extend Video run (Seedance 2.5 Extend, Seedance 2.5
|
|
838
|
+
* Flash Extend) on a known source is charged: the whole-run quote
|
|
839
|
+
* (`<rate row>:<units>u`, {@link unitQuoteCreditId}) of that run, which the
|
|
840
|
+
* price lookups (`GET /v1/credits/model-cost`, `POST /v1/credits/model-costs`)
|
|
841
|
+
* answer with exactly what the run is charged.
|
|
834
842
|
*
|
|
835
843
|
* The units are (seconds sent + seconds added) ÷ 2, by the rule the server
|
|
836
844
|
* charges a run by (seedance-extend-rate.ts): the seconds sent are the
|
|
@@ -845,9 +853,10 @@ export function seedanceExtendRateCreditId(resolution: unknown): string {
|
|
|
845
853
|
* the most a run of that length costs.
|
|
846
854
|
* @param duration the seconds added (the request's `duration`).
|
|
847
855
|
* @param resolution the request's resolution (one the model does not offer is 720p).
|
|
856
|
+
* @param provider the extend provider (Seedance 2.5 Extend when none is named).
|
|
848
857
|
* @returns the id, or `undefined` for a source the extend refuses: a measured
|
|
849
858
|
* picture shorter than the shortest source it takes
|
|
850
|
-
* (`
|
|
859
|
+
* (`SEEDANCE_EXTEND_MIN_SOURCE_SEC`: 1.8 s, 2 s on Flash; compared as measured, as the
|
|
851
860
|
* route and the worker compare it), whatever the seconds added. No run on
|
|
852
861
|
* such a source is made or charged, so there is no price to name.
|
|
853
862
|
*/
|
|
@@ -855,19 +864,25 @@ export function seedanceExtendSourceCreditId(
|
|
|
855
864
|
sourcePictureSec: number | null | undefined,
|
|
856
865
|
duration?: number | string,
|
|
857
866
|
resolution?: unknown,
|
|
867
|
+
provider: SentPricedSeedanceExtendProvider = SEEDANCE_EXTEND_SENT_PRICED_PROVIDER,
|
|
858
868
|
): string | undefined {
|
|
859
|
-
if (
|
|
860
|
-
return seedanceExtendWholeRunCreditId(seedanceExtendSentSec(sourcePictureSec), duration, resolution)
|
|
869
|
+
if (seedanceExtendSourceRefused(provider, sourcePictureSec)) return undefined
|
|
870
|
+
return seedanceExtendWholeRunCreditId(provider, seedanceExtendSentSec(sourcePictureSec), duration, resolution)
|
|
861
871
|
}
|
|
862
872
|
|
|
863
|
-
/** The whole-run quote of a
|
|
864
|
-
function seedanceExtendWholeRunCreditId(
|
|
865
|
-
|
|
866
|
-
|
|
873
|
+
/** The whole-run quote of a sent-priced extend run that sends `sentSec` and adds `duration` at `resolution`. */
|
|
874
|
+
function seedanceExtendWholeRunCreditId(
|
|
875
|
+
provider: SentPricedSeedanceExtendProvider,
|
|
876
|
+
sentSec: number,
|
|
877
|
+
duration: number | string | undefined,
|
|
878
|
+
resolution: unknown,
|
|
879
|
+
): string {
|
|
880
|
+
const units = seedanceExtendUnits(sentSec, seedanceExtendAddedSec(provider, duration))
|
|
881
|
+
return unitQuoteCreditId(seedanceExtendRateCreditId(resolution, provider), units)
|
|
867
882
|
}
|
|
868
883
|
|
|
869
884
|
/**
|
|
870
|
-
* The most a
|
|
885
|
+
* The most a sent-priced Extend Video run that adds `duration` seconds at
|
|
871
886
|
* `resolution` can cost, as ONE id: the whole-run quote
|
|
872
887
|
* (`<rate row>:<units>u`, {@link unitQuoteCreditId}) of a run that sends the
|
|
873
888
|
* whole {@link SEEDANCE_EXTEND_CONTEXT_MAX_SEC}-second window — the units are
|
|
@@ -875,13 +890,17 @@ function seedanceExtendWholeRunCreditId(sentSec: number, duration: number | stri
|
|
|
875
890
|
* never below what a run of that length is charged; the price lookups answer
|
|
876
891
|
* it at the rate row's current price. A client that knows the source names
|
|
877
892
|
* its run exactly with {@link seedanceExtendSourceCreditId}; this is that id
|
|
878
|
-
* for a source not known.
|
|
893
|
+
* for a source not known. `provider`: Seedance 2.5 Extend when none is named.
|
|
879
894
|
*
|
|
880
895
|
* The seconds added snap into the catalog window exactly as
|
|
881
896
|
* {@link tailExtendCreditId} reads them for every tail-recipe provider.
|
|
882
897
|
*/
|
|
883
|
-
export function seedanceExtendFullWindowCreditId(
|
|
884
|
-
|
|
898
|
+
export function seedanceExtendFullWindowCreditId(
|
|
899
|
+
duration?: number | string,
|
|
900
|
+
resolution?: unknown,
|
|
901
|
+
provider: SentPricedSeedanceExtendProvider = SEEDANCE_EXTEND_SENT_PRICED_PROVIDER,
|
|
902
|
+
): string {
|
|
903
|
+
return seedanceExtendWholeRunCreditId(provider, seedanceExtendSentSec(undefined), duration, resolution)
|
|
885
904
|
}
|
|
886
905
|
|
|
887
906
|
/**
|
|
@@ -896,11 +915,11 @@ export function seedanceExtendFullWindowCreditId(duration?: number | string, res
|
|
|
896
915
|
* - Seedance 2.0 Extend (4–15 s) and Kling 4 Extend (3–30 s): their own rows,
|
|
897
916
|
* one per second of the window and resolution, `<provider>:<N>s:<res>`
|
|
898
917
|
* (480p / 720p / 1080p; Kling 4 720p / 1080p) — the price a run is charged.
|
|
899
|
-
* - Seedance 2.5 Extend (4–30 s)
|
|
900
|
-
*
|
|
901
|
-
* that length costs, the whole
|
|
902
|
-
* ({@link seedanceExtendFullWindowCreditId},
|
|
903
|
-
*
|
|
918
|
+
* - Seedance 2.5 Extend and Seedance 2.5 Flash Extend (4–30 s) are charged
|
|
919
|
+
* per second they send and add, and how much is sent depends on the
|
|
920
|
+
* source: this names the most a run of that length costs, the whole
|
|
921
|
+
* 10-second window sent ({@link seedanceExtendFullWindowCreditId},
|
|
922
|
+
* `<provider>:<res>:per-2s:<units>u`). A client that knows the
|
|
904
923
|
* source names the run's own id with {@link seedanceExtendSourceCreditId}.
|
|
905
924
|
*
|
|
906
925
|
* A retired id (`seedance-2-extend`) is not a {@link TailExtendProvider}:
|
|
@@ -912,7 +931,10 @@ export function tailExtendCreditId(
|
|
|
912
931
|
duration?: number | string,
|
|
913
932
|
resolution?: string,
|
|
914
933
|
): string {
|
|
915
|
-
if (isSeedanceExtendPricedBySecondsSent(provider)) return seedanceExtendFullWindowCreditId(duration, resolution)
|
|
934
|
+
if (isSeedanceExtendPricedBySecondsSent(provider)) return seedanceExtendFullWindowCreditId(duration, resolution, provider)
|
|
935
|
+
// Gemini Omni Flash 1.2 Extend: the whole-run quote of a run that sends the
|
|
936
|
+
// whole 10 s window (`geminiOmniExtendQuoteCreditId`, no source known).
|
|
937
|
+
if (provider === "gemini-omni-flash-1-2-extend") return geminiOmniExtendQuoteCreditId({ duration, resolution })
|
|
916
938
|
return `${provider}:${pricedOutputDurationSec(provider, duration)}s:${tailExtendResolution(provider, resolution)}`
|
|
917
939
|
}
|
|
918
940
|
|
|
@@ -1006,9 +1028,6 @@ export function grokExtendCreditId(duration?: unknown, sourceResolution?: unknow
|
|
|
1006
1028
|
return `${GROK_EXTEND_PROVIDER}:${grokExtendSeconds(duration)}s:${resolution}`
|
|
1007
1029
|
}
|
|
1008
1030
|
|
|
1009
|
-
/** The video node types whose run Grok Extend can extend, set to a Grok Imagine model. */
|
|
1010
|
-
const GROK_EXTEND_SOURCE_NODE_TYPES: ReadonlySet<string> = new Set(["generate-video", "text-to-video", "image-to-video"])
|
|
1011
|
-
|
|
1012
1031
|
/**
|
|
1013
1032
|
* The resolution a Grok Extend is quoted at from the clip a Grok Imagine node
|
|
1014
1033
|
* already made — the clip the run extends: the take its task (`kieTaskId`, the
|
package/src/entries/credits.ts
CHANGED
|
@@ -58,6 +58,9 @@ export {
|
|
|
58
58
|
export type { NormalizedImageGen, PricedVideoSelection, GrokExtendSourceResolution } from "../credit-identifiers.js"
|
|
59
59
|
export {
|
|
60
60
|
SEEDANCE_EXTEND_SENT_PRICED_PROVIDER,
|
|
61
|
+
SEEDANCE_EXTEND_SENT_PRICED_PROVIDERS,
|
|
62
|
+
SEEDANCE_EXTEND_RATE_CREDIT_IDS_BY_PROVIDER,
|
|
63
|
+
SEEDANCE_EXTEND_MIN_SOURCE_SEC,
|
|
61
64
|
SEEDANCE_EXTEND_CONTEXT_MAX_SEC,
|
|
62
65
|
SEEDANCE_EXTEND_RATE_SECONDS,
|
|
63
66
|
SEEDANCE_EXTEND_RATE_CREDIT_IDS,
|
|
@@ -65,11 +68,17 @@ export {
|
|
|
65
68
|
isSeedanceExtendRateCreditId,
|
|
66
69
|
seedanceExtendAddedSec,
|
|
67
70
|
seedanceExtendRefusesSource,
|
|
71
|
+
seedanceExtendSourceRefused,
|
|
68
72
|
seedanceExtendSourceSec,
|
|
69
73
|
seedanceExtendSentSec,
|
|
70
74
|
seedanceExtendUnits,
|
|
71
75
|
type SentPricedSeedanceExtendProvider,
|
|
72
76
|
} from "../seedance-extend-rate.js"
|
|
77
|
+
export {
|
|
78
|
+
geminiOmniExtendQuoteCreditId,
|
|
79
|
+
parseGeminiOmniExtendQuoteCreditId,
|
|
80
|
+
type GeminiOmniExtendQuoteCreditIdParts,
|
|
81
|
+
} from "../gemini-omni-extend-quote.js"
|
|
73
82
|
export * from "../credit-estimators/index.js"
|
|
74
83
|
export {
|
|
75
84
|
resolveTopazUpscale,
|
|
@@ -103,11 +112,20 @@ export {
|
|
|
103
112
|
OMNIHUMAN_2_0_PER_SECOND_CREDIT_ID,
|
|
104
113
|
lipSyncAudioRateOf,
|
|
105
114
|
lipSyncBilledSeconds,
|
|
115
|
+
lipSyncHeldSeconds,
|
|
106
116
|
lipSyncEstimateSeconds,
|
|
107
117
|
lipSyncFifteenSecondCreditId,
|
|
108
118
|
LIP_SYNC_UNMEASURED_ESTIMATE_SECONDS,
|
|
109
119
|
} from "../lip-sync-pricing.js"
|
|
110
120
|
export type { LipSyncDurationBucket, LipSyncAudioRate } from "../lip-sync-pricing.js"
|
|
121
|
+
export {
|
|
122
|
+
SEEDANCE_LIP_SYNC_SECONDS,
|
|
123
|
+
isSeedanceLipSyncProvider,
|
|
124
|
+
seedanceLipSyncResolution,
|
|
125
|
+
seedanceLipSyncCreditId,
|
|
126
|
+
MINIMAX_H3_LIP_SYNC_CREDIT_ID,
|
|
127
|
+
referenceAudioLipSyncCreditId,
|
|
128
|
+
} from "../seedance-lip-sync.js"
|
|
111
129
|
export {
|
|
112
130
|
AI_AVATAR_MAX_DURATION_SEC,
|
|
113
131
|
AI_AVATAR_MAX_AUDIO_SEC,
|
package/src/entries/models.ts
CHANGED
|
@@ -101,6 +101,7 @@ export {
|
|
|
101
101
|
isGrokExtendProvider,
|
|
102
102
|
GROK_EXTEND_SOURCE_MODELS,
|
|
103
103
|
isGrokExtendSourceModel,
|
|
104
|
+
GROK_EXTEND_SOURCE_NODE_TYPES,
|
|
104
105
|
LIP_SYNC_PROVIDERS,
|
|
105
106
|
RETIRED_LIP_SYNC_PROVIDERS,
|
|
106
107
|
retiredLipSyncProviderName,
|
|
@@ -160,6 +161,9 @@ export {
|
|
|
160
161
|
SEEDANCE_2_PROVIDERS,
|
|
161
162
|
SEEDANCE_2_REF_LIMITS,
|
|
162
163
|
SEEDANCE_2_5_REF_LIMITS,
|
|
164
|
+
SEEDANCE_2_5_FLASH_REF_LIMITS,
|
|
165
|
+
videoReferencesOverLimitProblem,
|
|
166
|
+
trimVideoReferencesToLimits,
|
|
163
167
|
SEEDANCE_2_EXTEND_STITCH,
|
|
164
168
|
SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC,
|
|
165
169
|
SEEDANCE_2_CONTINUATION_REF_SEC,
|
|
@@ -167,6 +171,8 @@ export {
|
|
|
167
171
|
FRAME_MODE_ADAPTIVE_ONLY_ASPECT,
|
|
168
172
|
VIDEO_REF_LIMITS_BY_PROVIDER,
|
|
169
173
|
VIDEO_REF_VIDEO_DURATION_LIMITS,
|
|
174
|
+
VIDEO_REF_VIDEO_PICTURE_LIMITS,
|
|
175
|
+
refVideoAspectProblem,
|
|
170
176
|
checkRefVideoDurations,
|
|
171
177
|
VIDEO_CHARACTER_CLIP_DURATION_LIMITS,
|
|
172
178
|
checkCharacterClipDurations,
|
|
@@ -191,6 +197,9 @@ export {
|
|
|
191
197
|
videoProviderRefModeFrameSeats,
|
|
192
198
|
VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL,
|
|
193
199
|
isSeedance2Provider,
|
|
200
|
+
isEditVideoProProvider,
|
|
201
|
+
editVideoProProviderRefusal,
|
|
202
|
+
EDIT_VIDEO_PRO_HELD_BACK_PROVIDERS,
|
|
194
203
|
MINIMAX_H3_PROVIDERS,
|
|
195
204
|
isMinimaxH3Provider,
|
|
196
205
|
MINIMAX_H3_DEFAULT_RESOLUTION,
|
|
@@ -280,6 +289,7 @@ export {
|
|
|
280
289
|
} from "../model-constants.js"
|
|
281
290
|
export type { VideoStartFrameOnlyProblem } from "../model-constants.js"
|
|
282
291
|
export type { ImageRunKind } from "../model-constants.js"
|
|
292
|
+
export type { VideoReferenceCounts } from "../model-constants.js"
|
|
283
293
|
export {
|
|
284
294
|
CAST_SWAP_POST_PROMPT_MAX,
|
|
285
295
|
TREND_PROMPT_LIMITS,
|
|
@@ -367,6 +377,7 @@ export type {
|
|
|
367
377
|
GvpAnchorChoice,
|
|
368
378
|
GvpAnchorWireMode,
|
|
369
379
|
RefVideoDurationLimit,
|
|
380
|
+
RefVideoPictureLimit,
|
|
370
381
|
RefAudioRule,
|
|
371
382
|
RefAudioProbe,
|
|
372
383
|
RefAudioCheck,
|