@nodaro/shared 3.53.0 → 3.54.1
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-NR5IFEYC.js → chunk-25KAGSPT.js} +3 -3
- package/dist/{chunk-NR5IFEYC.js.map → chunk-25KAGSPT.js.map} +1 -1
- package/dist/{chunk-FBLMWA2R.cjs → chunk-2OYV6K7D.cjs} +4 -4
- package/dist/{chunk-FBLMWA2R.cjs.map → chunk-2OYV6K7D.cjs.map} +1 -1
- package/dist/{chunk-HDXAM5JW.cjs → chunk-2R74OU76.cjs} +19 -20
- package/dist/chunk-2R74OU76.cjs.map +1 -0
- package/dist/{chunk-WGXTTQNT.cjs → chunk-3633VD2M.cjs} +8 -8
- package/dist/{chunk-WGXTTQNT.cjs.map → chunk-3633VD2M.cjs.map} +1 -1
- package/dist/{chunk-DLSJTVS5.js → chunk-3CHOZ573.js} +19 -20
- package/dist/chunk-3CHOZ573.js.map +1 -0
- package/dist/{chunk-L6IGNCIV.js → chunk-5DVDHL7Y.js} +5 -5
- package/dist/{chunk-L6IGNCIV.js.map → chunk-5DVDHL7Y.js.map} +1 -1
- package/dist/{chunk-GJTRQOH6.cjs → chunk-5R6LTKE5.cjs} +5 -5
- package/dist/{chunk-GJTRQOH6.cjs.map → chunk-5R6LTKE5.cjs.map} +1 -1
- package/dist/{chunk-JKVCAEIZ.cjs → chunk-6HUWQLF2.cjs} +6 -6
- package/dist/{chunk-JKVCAEIZ.cjs.map → chunk-6HUWQLF2.cjs.map} +1 -1
- package/dist/{chunk-YCKHGHXN.js → chunk-6XVHYD5R.js} +11 -8
- package/dist/chunk-6XVHYD5R.js.map +1 -0
- package/dist/{chunk-EC4ZSWEN.cjs → chunk-AGTCHDG5.cjs} +6 -6
- package/dist/{chunk-EC4ZSWEN.cjs.map → chunk-AGTCHDG5.cjs.map} +1 -1
- package/dist/{chunk-LVXGMXJJ.cjs → chunk-ATWLKUAI.cjs} +4 -4
- package/dist/{chunk-LVXGMXJJ.cjs.map → chunk-ATWLKUAI.cjs.map} +1 -1
- package/dist/{chunk-NUFQFQ7C.js → chunk-C5S75476.js} +5 -5
- package/dist/{chunk-NUFQFQ7C.js.map → chunk-C5S75476.js.map} +1 -1
- package/dist/{chunk-6UHXNHKT.cjs → chunk-C6IQCKJT.cjs} +4 -4
- package/dist/{chunk-6UHXNHKT.cjs.map → chunk-C6IQCKJT.cjs.map} +1 -1
- package/dist/{chunk-RGXOHQWY.js → chunk-CZCOL3M5.js} +9 -5
- package/dist/chunk-CZCOL3M5.js.map +1 -0
- package/dist/{chunk-IVXWKDQ3.js → chunk-DUL5ZLTJ.js} +3 -3
- package/dist/{chunk-IVXWKDQ3.js.map → chunk-DUL5ZLTJ.js.map} +1 -1
- package/dist/{chunk-PRW25YSJ.js → chunk-E4YES25K.js} +4 -4
- package/dist/{chunk-PRW25YSJ.js.map → chunk-E4YES25K.js.map} +1 -1
- package/dist/{chunk-7MSA476R.cjs → chunk-FIYVKW7F.cjs} +12 -12
- package/dist/{chunk-7MSA476R.cjs.map → chunk-FIYVKW7F.cjs.map} +1 -1
- package/dist/{chunk-CQJYKSXF.js → chunk-FVVD6XY2.js} +5 -3
- package/dist/chunk-FVVD6XY2.js.map +1 -0
- package/dist/{chunk-HG5VWCZV.cjs → chunk-G7IUQKRU.cjs} +47 -47
- package/dist/{chunk-HG5VWCZV.cjs.map → chunk-G7IUQKRU.cjs.map} +1 -1
- package/dist/chunk-HD45Y7QU.cjs +27 -0
- package/dist/{chunk-WLQGTQC6.cjs.map → chunk-HD45Y7QU.cjs.map} +1 -1
- package/dist/{chunk-3YRH7UC5.js → chunk-HEF4BIMA.js} +4 -4
- package/dist/{chunk-3YRH7UC5.js.map → chunk-HEF4BIMA.js.map} +1 -1
- package/dist/{chunk-QPSEC6UO.js → chunk-HG3KKCJJ.js} +3 -3
- package/dist/{chunk-QPSEC6UO.js.map → chunk-HG3KKCJJ.js.map} +1 -1
- package/dist/{chunk-YYERNMW4.cjs → chunk-IPCWYKX5.cjs} +45 -45
- package/dist/{chunk-YYERNMW4.cjs.map → chunk-IPCWYKX5.cjs.map} +1 -1
- package/dist/{chunk-IB5B3EBD.js → chunk-JCNTNAZP.js} +13 -7
- package/dist/chunk-JCNTNAZP.js.map +1 -0
- package/dist/{chunk-NC4IMS67.cjs → chunk-KM35K2M5.cjs} +21 -21
- package/dist/{chunk-NC4IMS67.cjs.map → chunk-KM35K2M5.cjs.map} +1 -1
- package/dist/{chunk-YOFBLLVD.js → chunk-KMSEU6FK.js} +3 -3
- package/dist/{chunk-YOFBLLVD.js.map → chunk-KMSEU6FK.js.map} +1 -1
- package/dist/{chunk-2LNQ2MDO.js → chunk-LYWJAXPT.js} +3 -3
- package/dist/{chunk-2LNQ2MDO.js.map → chunk-LYWJAXPT.js.map} +1 -1
- package/dist/{chunk-GZXQ4T2W.cjs → chunk-M3SXUUWC.cjs} +12 -7
- package/dist/chunk-M3SXUUWC.cjs.map +1 -0
- package/dist/{chunk-6F6GGX2W.cjs → chunk-M7LU4NTI.cjs} +3 -2
- package/dist/chunk-M7LU4NTI.cjs.map +1 -0
- package/dist/{chunk-ZGPLTM5Y.js → chunk-MCIBQ5BF.js} +9 -9
- package/dist/{chunk-ZGPLTM5Y.js.map → chunk-MCIBQ5BF.js.map} +1 -1
- package/dist/{chunk-YCUFXCWH.js → chunk-MGJR5OXO.js} +5 -5
- package/dist/{chunk-YCUFXCWH.js.map → chunk-MGJR5OXO.js.map} +1 -1
- package/dist/{chunk-5HNJLFCZ.cjs → chunk-MTUNORQB.cjs} +11 -11
- package/dist/{chunk-5HNJLFCZ.cjs.map → chunk-MTUNORQB.cjs.map} +1 -1
- package/dist/{chunk-3SU2DRME.js → chunk-N3WL6IOJ.js} +3 -3
- package/dist/{chunk-3SU2DRME.js.map → chunk-N3WL6IOJ.js.map} +1 -1
- package/dist/{chunk-KADUPASC.cjs → chunk-OVIIJVXH.cjs} +21 -21
- package/dist/{chunk-KADUPASC.cjs.map → chunk-OVIIJVXH.cjs.map} +1 -1
- package/dist/{chunk-5PCI6M44.cjs → chunk-PONP5J5E.cjs} +5 -3
- package/dist/chunk-PONP5J5E.cjs.map +1 -0
- package/dist/{chunk-NTSGMX23.cjs → chunk-QP5JLSCJ.cjs} +9 -5
- package/dist/chunk-QP5JLSCJ.cjs.map +1 -0
- package/dist/{chunk-GLED2FVJ.cjs → chunk-SEEQ3H22.cjs} +5 -5
- package/dist/{chunk-GLED2FVJ.cjs.map → chunk-SEEQ3H22.cjs.map} +1 -1
- package/dist/{chunk-3WYOLP35.cjs → chunk-SZUDEFX2.cjs} +41 -41
- package/dist/{chunk-3WYOLP35.cjs.map → chunk-SZUDEFX2.cjs.map} +1 -1
- package/dist/{chunk-C4R7BTBQ.js → chunk-TADEEG5E.js} +3 -2
- package/dist/chunk-TADEEG5E.js.map +1 -0
- package/dist/{chunk-A7RJOQXI.js → chunk-UWMXMLMV.js} +3 -3
- package/dist/{chunk-A7RJOQXI.js.map → chunk-UWMXMLMV.js.map} +1 -1
- package/dist/{chunk-IORF5UGR.cjs → chunk-WVACGZYV.cjs} +29 -29
- package/dist/{chunk-IORF5UGR.cjs.map → chunk-WVACGZYV.cjs.map} +1 -1
- package/dist/{chunk-HT6PACYO.js → chunk-YBZQXZ6A.js} +3 -3
- package/dist/{chunk-HT6PACYO.js.map → chunk-YBZQXZ6A.js.map} +1 -1
- package/dist/{chunk-ANMCMSGR.cjs → chunk-YTXP4VHD.cjs} +13 -7
- package/dist/chunk-YTXP4VHD.cjs.map +1 -0
- package/dist/{chunk-7NRDX3KL.js → chunk-ZAK276QF.js} +6 -6
- package/dist/{chunk-7NRDX3KL.js.map → chunk-ZAK276QF.js.map} +1 -1
- package/dist/{chunk-DS4QUPGZ.js → chunk-ZKHQSG76.js} +4 -4
- package/dist/{chunk-DS4QUPGZ.js.map → chunk-ZKHQSG76.js.map} +1 -1
- package/dist/{chunk-6XYLFTLI.js → chunk-ZWB3NG4M.js} +3 -3
- package/dist/{chunk-6XYLFTLI.js.map → chunk-ZWB3NG4M.js.map} +1 -1
- package/dist/entries/apps.cjs +44 -44
- package/dist/entries/apps.js +9 -9
- package/dist/entries/credits.cjs +150 -150
- package/dist/entries/credits.js +7 -7
- package/dist/entries/i18n.cjs +11 -11
- package/dist/entries/i18n.d.cts +5 -4
- package/dist/entries/i18n.d.ts +5 -4
- package/dist/entries/i18n.js +1 -1
- package/dist/entries/media.cjs +81 -73
- package/dist/entries/media.d.cts +51 -84
- package/dist/entries/media.d.ts +51 -84
- package/dist/entries/media.js +2 -2
- package/dist/entries/model-catalog.cjs +66 -66
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +277 -277
- package/dist/entries/models.js +5 -5
- package/dist/entries/nodes.cjs +208 -208
- package/dist/entries/nodes.js +10 -10
- package/dist/entries/pipeline.cjs +149 -149
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +141 -141
- package/dist/entries/video.d.cts +11 -10
- package/dist/entries/video.d.ts +11 -10
- package/dist/entries/video.js +5 -5
- package/dist/entries/workflow.cjs +99 -99
- package/dist/entries/workflow.js +2 -2
- package/dist/index.cjs +1268 -1260
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +23 -23
- package/package.json +1 -1
- package/src/__tests__/entry-matches-query.test.ts +34 -0
- package/src/__tests__/priced-clip-seconds.test.ts +193 -0
- package/src/__tests__/video-depth.test.ts +28 -16
- package/src/__tests__/video-face-mesh.test.ts +3 -2
- package/src/__tests__/video-link-needs.test.ts +23 -4
- package/src/__tests__/video-link.test.ts +1 -1
- package/src/__tests__/video-mask.test.ts +1 -1
- package/src/entries/media.ts +1 -0
- package/src/generated/unit-contracts.ts +1 -0
- package/src/i18n/index.ts +6 -4
- package/src/i18n/style.ar.ts +1 -1
- package/src/i18n/style.de.ts +1 -1
- package/src/i18n/style.es.ts +1 -1
- package/src/i18n/style.fr.ts +1 -1
- package/src/i18n/style.he.ts +1 -1
- package/src/i18n/style.hi.ts +1 -1
- package/src/i18n/style.ja.ts +1 -1
- package/src/i18n/style.ko.ts +1 -1
- package/src/i18n/style.pt-BR.ts +1 -1
- package/src/i18n/style.ru.ts +1 -1
- package/src/i18n/style.zh-CN.ts +1 -1
- package/src/mask-composite.ts +6 -5
- package/src/model-catalog.ts +17 -18
- package/src/priced-clip-seconds.ts +28 -0
- package/src/video-depth.ts +21 -19
- package/src/video-face-mesh.ts +5 -2
- package/src/video-link.ts +35 -15
- package/src/video-mask.ts +12 -7
- package/dist/chunk-5PCI6M44.cjs.map +0 -1
- package/dist/chunk-6F6GGX2W.cjs.map +0 -1
- package/dist/chunk-ANMCMSGR.cjs.map +0 -1
- package/dist/chunk-C4R7BTBQ.js.map +0 -1
- package/dist/chunk-CQJYKSXF.js.map +0 -1
- package/dist/chunk-DLSJTVS5.js.map +0 -1
- package/dist/chunk-GZXQ4T2W.cjs.map +0 -1
- package/dist/chunk-HDXAM5JW.cjs.map +0 -1
- package/dist/chunk-IB5B3EBD.js.map +0 -1
- package/dist/chunk-NTSGMX23.cjs.map +0 -1
- package/dist/chunk-RGXOHQWY.js.map +0 -1
- package/dist/chunk-WLQGTQC6.cjs +0 -27
- package/dist/chunk-YCKHGHXN.js.map +0 -1
|
@@ -24,11 +24,12 @@ describe("video face mesh pricing rows", () => {
|
|
|
24
24
|
it("a clip is priced at the smallest bucket that holds it", () => {
|
|
25
25
|
expect(videoFaceMeshCreditId(0.5)).toBe("video-face-mesh:5s")
|
|
26
26
|
expect(videoFaceMeshCreditId(5)).toBe("video-face-mesh:5s")
|
|
27
|
-
expect(videoFaceMeshCreditId(5.01)).toBe("video-face-mesh:
|
|
27
|
+
expect(videoFaceMeshCreditId(5.01)).toBe("video-face-mesh:5s")
|
|
28
28
|
expect(videoFaceMeshCreditId(15)).toBe("video-face-mesh:15s")
|
|
29
29
|
expect(videoFaceMeshCreditId(21)).toBe("video-face-mesh:30s")
|
|
30
30
|
expect(videoFaceMeshCreditId(60)).toBe("video-face-mesh:60s")
|
|
31
|
-
// A 30 s clip at 60 fps (1,801 frames) is priced at about 60.03 s.
|
|
31
|
+
// A 30 s clip at 60 fps (1,801 frames) is priced at about 60.03 s: within 0.05 s of the 60 s row.
|
|
32
|
+
expect(videoFaceMeshCreditId(60.03)).toBe("video-face-mesh:60s")
|
|
32
33
|
expect(videoFaceMeshCreditId(61)).toBe("video-face-mesh:120s")
|
|
33
34
|
expect(videoFaceMeshCreditId(121)).toBe("video-face-mesh:300s")
|
|
34
35
|
expect(videoFaceMeshCreditId(300)).toBe("video-face-mesh:300s")
|
|
@@ -24,10 +24,16 @@ describe("what a Video URL node must fetch for the nodes that read it", () => {
|
|
|
24
24
|
expect(videoLinkNeedOf(["transcribe", "video-to-video"])).toBe("file")
|
|
25
25
|
expect(videoLinkNeedOf(["transcribe"])).toBe("audio")
|
|
26
26
|
expect(videoLinkNeedOf(["suno-cover", "content-recipe"])).toBe("audio")
|
|
27
|
-
expect(videoLinkNeedOf(["
|
|
27
|
+
expect(videoLinkNeedOf(["content-recipe"])).toBe("none")
|
|
28
28
|
expect(videoLinkNeedOf([])).toBe("none")
|
|
29
29
|
})
|
|
30
30
|
|
|
31
|
+
it("Dubbing dubs the file wired into it: a link it reads is downloaded first", () => {
|
|
32
|
+
expect(videoLinkNeedOf(["dubbing"])).toBe("file")
|
|
33
|
+
expect(videoLinkNeedOf(["dubbing", "content-recipe"])).toBe("file")
|
|
34
|
+
expect(videoLinkNeedOf(["transcribe", "dubbing"])).toBe("file")
|
|
35
|
+
})
|
|
36
|
+
|
|
31
37
|
it("the card's and the server's constants are the same numbers the editor used", () => {
|
|
32
38
|
expect(AUTO_DOWNLOAD_MAX_SEC).toBe(240)
|
|
33
39
|
expect(YOUTUBE_MAX_HEIGHT).toBe(1080)
|
|
@@ -60,8 +66,21 @@ describe("videoLinkRunNeeds — one reading of the graph for the editor's gate,
|
|
|
60
66
|
})
|
|
61
67
|
|
|
62
68
|
it("a null scope is the whole graph (the app runner's view)", () => {
|
|
63
|
-
const nodes = [link("src"), node("tx", "transcribe"), node("
|
|
64
|
-
expect(videoLinkRunNeeds(null, nodes, [edge("src", "tx"), edge("src", "
|
|
65
|
-
expect(videoLinkRunNeeds(null, [link("src"), node("
|
|
69
|
+
const nodes = [link("src"), node("tx", "transcribe"), node("rec", "content-recipe")]
|
|
70
|
+
expect(videoLinkRunNeeds(null, nodes, [edge("src", "tx"), edge("src", "rec")]).get("src")).toBe("audio")
|
|
71
|
+
expect(videoLinkRunNeeds(null, [link("src"), node("rec", "content-recipe")], [edge("src", "rec")]).get("src")).toBe("none")
|
|
72
|
+
expect(videoLinkRunNeeds(null, [link("src"), node("dub", "dubbing")], [edge("src", "dub")]).get("src")).toBe("file")
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
it("a Dubbing node with its own Source link reads nothing wired into it: a link it alone reads needs nothing", () => {
|
|
76
|
+
const own = { sourceUrl: "https://example.com/talks/keynote" }
|
|
77
|
+
expect(videoLinkRunNeeds(null, [link("src"), node("dub", "dubbing", own)], [edge("src", "dub")]).get("src")).toBe("none")
|
|
78
|
+
// A blank Source link is no link: the wired video is dubbed.
|
|
79
|
+
expect(videoLinkRunNeeds(null, [link("src"), node("dub", "dubbing", { sourceUrl: " " })], [edge("src", "dub")]).get("src")).toBe("file")
|
|
80
|
+
// Another reader beside it still decides for itself.
|
|
81
|
+
const nodes = [link("src"), node("dub", "dubbing", own), node("va", "video-analysis")]
|
|
82
|
+
expect(videoLinkRunNeeds(null, nodes, [edge("src", "dub"), edge("src", "va")]).get("src")).toBe("file")
|
|
83
|
+
const tx = [link("src"), node("dub", "dubbing", own), node("tx", "transcribe")]
|
|
84
|
+
expect(videoLinkRunNeeds(null, tx, [edge("src", "dub"), edge("src", "tx")]).get("src")).toBe("audio")
|
|
66
85
|
})
|
|
67
86
|
})
|
|
@@ -69,7 +69,7 @@ describe("links that URL parsers read differently", () => {
|
|
|
69
69
|
|
|
70
70
|
describe("consumers that do not need the video file", () => {
|
|
71
71
|
it("names exactly the readers that take the audio track or the page link", () => {
|
|
72
|
-
expect([...VIDEO_LINK_TOLERANT_CONSUMER_TYPES].sort()).toEqual(["content-recipe", "
|
|
72
|
+
expect([...VIDEO_LINK_TOLERANT_CONSUMER_TYPES].sort()).toEqual(["content-recipe", "suno-cover", "transcribe"])
|
|
73
73
|
})
|
|
74
74
|
})
|
|
75
75
|
|
|
@@ -46,7 +46,7 @@ describe("Video Mask pricing", () => {
|
|
|
46
46
|
expect(videoMaskCreditId(0)).toBe("sam-3.1-video:300s")
|
|
47
47
|
expect(videoMaskCreditId(500)).toBe("sam-3.1-video:300s")
|
|
48
48
|
expect(videoMaskCreditId(5)).toBe("sam-3.1-video:5s")
|
|
49
|
-
expect(videoMaskCreditId(5.01)).toBe("sam-3.1-video:
|
|
49
|
+
expect(videoMaskCreditId(5.01)).toBe("sam-3.1-video:5s")
|
|
50
50
|
expect(videoMaskCreditId(61)).toBe("sam-3.1-video:90s")
|
|
51
51
|
})
|
|
52
52
|
|
package/src/entries/media.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
export * from "../freecut-protocol.js"
|
|
9
9
|
export { describeMaskRegion } from "../inpaint-region.js"
|
|
10
10
|
export type { MaskRegionDescriptor, PixelBox } from "../inpaint-region.js"
|
|
11
|
+
export * from "../priced-clip-seconds.js"
|
|
11
12
|
export * from "../video-depth.js"
|
|
12
13
|
export {
|
|
13
14
|
applySlots,
|
|
@@ -32,6 +32,7 @@ export const UNIT_JSON_PIPS: ReadonlyArray<readonly [type: string, pips: Readonl
|
|
|
32
32
|
["clip-pack", { "json": "edl" }], // unit:clip-pack
|
|
33
33
|
["speaker-layout", { "json": "edl" }], // unit:speaker-layout
|
|
34
34
|
["speaker-map", { "edl": "edl", "json": "other" }], // unit:speaker-map
|
|
35
|
+
["shot-cuts", { "firstFrames": "other", "json": "other", "lastFrames": "other" }], // unit:shot-cuts
|
|
35
36
|
]
|
|
36
37
|
|
|
37
38
|
// Input pips that are never a prompt lane (contract.nonPromptInputs) — fan-out-rows.ts composes these.
|
package/src/i18n/index.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
14
|
* For search filtering, use `entryMatchesQuery(entry, locale, query)` which
|
|
15
|
-
* filters across
|
|
15
|
+
* filters across the entry's id, the canonical English text AND the localized text.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { I18nCatalogId, LocaleCatalogMap, LocaleId, LocalizedEntry } from "./types.js"
|
|
@@ -147,9 +147,10 @@ export function resolveDescription(
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
|
-
* Search predicate: returns true if `query` matches
|
|
151
|
-
* English label/description or the localized label/description for
|
|
152
|
-
* current locale.
|
|
150
|
+
* Search predicate: returns true if `query` matches the entry's id, the
|
|
151
|
+
* canonical English label/description, or the localized label/description for
|
|
152
|
+
* the current locale. An id is a stable name no display text has to repeat, so
|
|
153
|
+
* an entry stays findable by it after its display name changes.
|
|
153
154
|
*
|
|
154
155
|
* Empty query always matches.
|
|
155
156
|
*/
|
|
@@ -163,6 +164,7 @@ export function entryMatchesQuery(
|
|
|
163
164
|
): boolean {
|
|
164
165
|
const q = query.trim().toLowerCase()
|
|
165
166
|
if (!q) return true
|
|
167
|
+
if (id.toLowerCase().includes(q)) return true
|
|
166
168
|
if (englishLabel.toLowerCase().includes(q)) return true
|
|
167
169
|
if (englishDescription.toLowerCase().includes(q)) return true
|
|
168
170
|
if (locale === "en") return false
|
package/src/i18n/style.ar.ts
CHANGED
|
@@ -37,7 +37,7 @@ const map: LocaleCatalogMap = {
|
|
|
37
37
|
"chalkboard": { label: "سبورة طباشير", description: "طباشير أبيض على أردواز" },
|
|
38
38
|
"paper-cutout": { label: "قصاصة ورقية", description: "ورق مقصوص متراكب + ظلال" },
|
|
39
39
|
"illuminated": { label: "مخطوطة منيرة", description: "ورق ذهبي + خط عربي" },
|
|
40
|
-
"pixar-3d": { label: "
|
|
40
|
+
"pixar-3d": { label: "فيلم رسوم متحركة ثلاثي الأبعاد", description: "CG شخصية Animation مصقول" },
|
|
41
41
|
"caricature": { label: "كاريكاتير", description: "بورتريه مبالغ فيه ومنمق" },
|
|
42
42
|
|
|
43
43
|
"fresco": { label: "فريسكو", description: "رسم جداري على جص بأسلوب أسقف عصر النهضة" },
|
package/src/i18n/style.de.ts
CHANGED
|
@@ -37,7 +37,7 @@ const map: LocaleCatalogMap = {
|
|
|
37
37
|
"chalkboard": { label: "Tafel", description: "Weiße Kreide auf Schiefer" },
|
|
38
38
|
"paper-cutout": { label: "Papierausschnitt", description: "Geschichtetes Schnittpapier + Schatten" },
|
|
39
39
|
"illuminated": { label: "Illuminierte Handschrift", description: "Blattgold + Kalligrafie" },
|
|
40
|
-
"pixar-3d": { description: "Polierte Charakteranimations-CG" },
|
|
40
|
+
"pixar-3d": { label: "3D-Animationsfilm", description: "Polierte Charakteranimations-CG" },
|
|
41
41
|
"caricature": { label: "Karikatur", description: "Übertriebenes stilisiertes Porträt" },
|
|
42
42
|
"fresco": { label: "Fresko", description: "Wandmalerei auf Putz im Stil einer Renaissance-Decke" },
|
|
43
43
|
"mosaic": { label: "Mosaik", description: "Aus kleinen Kacheln tesseliertes byzantinisches Kunstwerk" },
|
package/src/i18n/style.es.ts
CHANGED
|
@@ -37,7 +37,7 @@ const map: LocaleCatalogMap = {
|
|
|
37
37
|
"chalkboard": { label: "Pizarra", description: "Tiza blanca sobre pizarra" },
|
|
38
38
|
"paper-cutout": { label: "Recortes de Papel", description: "Papel cortado en capas + sombras" },
|
|
39
39
|
"illuminated": { label: "Manuscrito Iluminado", description: "Pan de oro + caligrafía" },
|
|
40
|
-
"pixar-3d": { label: "
|
|
40
|
+
"pixar-3d": { label: "Película de animación 3D", description: "CG de animación de personajes pulida" },
|
|
41
41
|
"caricature": { label: "Caricatura", description: "Retrato exagerado estilizado" },
|
|
42
42
|
"fresco": { label: "Fresco", description: "Pintura mural sobre yeso estilo techo renacentista" },
|
|
43
43
|
"mosaic": { label: "Mosaico", description: "Obra teselada de pequeñas teselas, bizantina" },
|
package/src/i18n/style.fr.ts
CHANGED
|
@@ -37,7 +37,7 @@ const map: LocaleCatalogMap = {
|
|
|
37
37
|
"chalkboard": { label: "Tableau noir", description: "Craie blanche sur ardoise" },
|
|
38
38
|
"paper-cutout": { label: "Découpage en papier", description: "Papier découpé en couches + ombres" },
|
|
39
39
|
"illuminated": { label: "Manuscrit enluminé", description: "Feuille d'or + calligraphie" },
|
|
40
|
-
"pixar-3d": { description: "CG d'animation de personnages soigné" },
|
|
40
|
+
"pixar-3d": { label: "Film d'animation 3D", description: "CG d'animation de personnages soigné" },
|
|
41
41
|
"caricature": { description: "Portrait stylisé exagéré" },
|
|
42
42
|
"fresco": { label: "Fresque", description: "Peinture murale sur plâtre style plafond Renaissance" },
|
|
43
43
|
"mosaic": { label: "Mosaïque", description: "Œuvre tessellée à petits carreaux, byzantine" },
|
package/src/i18n/style.he.ts
CHANGED
|
@@ -37,7 +37,7 @@ const map: LocaleCatalogMap = {
|
|
|
37
37
|
"chalkboard": { label: "לוח גיר", description: "גיר לבן על צפחה" },
|
|
38
38
|
"paper-cutout": { label: "חיתוך נייר", description: "נייר חתוך בשכבות + צללים" },
|
|
39
39
|
"illuminated": { label: "כתב יד מעוטר", description: "עלי זהב + קליגרפיה" },
|
|
40
|
-
"pixar-3d": { label: "
|
|
40
|
+
"pixar-3d": { label: "סרט אנימציה בתלת-ממד", description: "אנימציית דמות מלוטשת CG" },
|
|
41
41
|
"caricature": { label: "קריקטורה", description: "פורטרט מסוגנן ומוגזם" },
|
|
42
42
|
"fresco": { label: "פרסקו", description: "ציור קיר על טיח מתקופת הרנסנס" },
|
|
43
43
|
"mosaic": { label: "פסיפס", description: "אמנות אריחים קטנים בטכניקת פסיפס ביזנטי" },
|
package/src/i18n/style.hi.ts
CHANGED
|
@@ -37,7 +37,7 @@ const map: LocaleCatalogMap = {
|
|
|
37
37
|
"chalkboard": { label: "Chalkboard", description: "Slate पर सफ़ेद chalk" },
|
|
38
38
|
"paper-cutout": { label: "Paper Cutout", description: "Layered cut paper + shadows" },
|
|
39
39
|
"illuminated": { label: "Illuminated Manuscript", description: "Gold leaf + calligraphy" },
|
|
40
|
-
"pixar-3d": { label: "
|
|
40
|
+
"pixar-3d": { label: "3D एनिमेटेड फ़िल्म", description: "Polished character animation CG" },
|
|
41
41
|
"caricature": { label: "Caricature", description: "Exaggerated stylized portrait" },
|
|
42
42
|
"fresco": { label: "Fresco", description: "Plaster पर Renaissance छत-शैली की दीवार चित्रकारी" },
|
|
43
43
|
"mosaic": { label: "Mosaic", description: "छोटे-tile tessellated कलाकृति, Byzantine" },
|
package/src/i18n/style.ja.ts
CHANGED
|
@@ -37,7 +37,7 @@ const map: LocaleCatalogMap = {
|
|
|
37
37
|
"chalkboard": { label: "黒板", description: "黒板に白いチョークで描いた絵" },
|
|
38
38
|
"paper-cutout": { label: "ペーパーカット", description: "層になった切り紙とドロップシャドウ" },
|
|
39
39
|
"illuminated": { label: "彩色写本", description: "金箔とカリグラフィー" },
|
|
40
|
-
"pixar-3d": { label: "
|
|
40
|
+
"pixar-3d": { label: "3Dアニメーション映画", description: "磨かれたキャラクター・アニメーションCG" },
|
|
41
41
|
"caricature": { label: "カリカチュア", description: "誇張してデフォルメした似顔絵" },
|
|
42
42
|
"fresco": { label: "フレスコ画", description: "漆喰の上に描くルネサンス様式の天井画風" },
|
|
43
43
|
"mosaic": { label: "モザイク", description: "小さなタイルを敷き詰めたビザンチン風モザイク" },
|
package/src/i18n/style.ko.ts
CHANGED
|
@@ -37,7 +37,7 @@ const map: LocaleCatalogMap = {
|
|
|
37
37
|
"chalkboard": { label: "칠판", description: "칠판 위에 흰 분필로 그린 그림" },
|
|
38
38
|
"paper-cutout": { label: "종이 컷아웃", description: "겹겹이 오려 붙인 종이와 그림자" },
|
|
39
39
|
"illuminated": { label: "채식 필사본", description: "금박과 캘리그래피" },
|
|
40
|
-
"pixar-3d": { description: "세련된 캐릭터 애니메이션 CG" },
|
|
40
|
+
"pixar-3d": { label: "3D 애니메이션 영화", description: "세련된 캐릭터 애니메이션 CG" },
|
|
41
41
|
"caricature": { label: "캐리커처", description: "과장되고 양식화된 인물화" },
|
|
42
42
|
"fresco": { label: "프레스코", description: "회반죽 위에 그린 르네상스 벽화" },
|
|
43
43
|
"mosaic": { label: "모자이크", description: "작은 타일을 이어 붙인 비잔틴풍 모자이크" },
|
package/src/i18n/style.pt-BR.ts
CHANGED
|
@@ -37,7 +37,7 @@ const map: LocaleCatalogMap = {
|
|
|
37
37
|
"chalkboard": { label: "Quadro de giz", description: "Giz branco em ardósia" },
|
|
38
38
|
"paper-cutout": { label: "Recorte de papel", description: "Papel recortado em camadas + sombras" },
|
|
39
39
|
"illuminated": { label: "Manuscrito iluminado", description: "Folha de ouro + caligrafia" },
|
|
40
|
-
"pixar-3d": { description: "CG polido de animação de personagens" },
|
|
40
|
+
"pixar-3d": { label: "Filme de animação 3D", description: "CG polido de animação de personagens" },
|
|
41
41
|
"caricature": { label: "Caricatura", description: "Retrato estilizado e exagerado" },
|
|
42
42
|
|
|
43
43
|
// Additional styles
|
package/src/i18n/style.ru.ts
CHANGED
|
@@ -37,7 +37,7 @@ const map: LocaleCatalogMap = {
|
|
|
37
37
|
"chalkboard": { label: "Меловая доска", description: "Белый мел на сланце" },
|
|
38
38
|
"paper-cutout": { label: "Бумажная вырезка", description: "Слои вырезанной бумаги и тени" },
|
|
39
39
|
"illuminated": { label: "Иллюминированная рукопись", description: "Сусальное золото и каллиграфия" },
|
|
40
|
-
"pixar-3d": { description: "Отполированная анимация персонажей CG" },
|
|
40
|
+
"pixar-3d": { label: "Анимационный 3D-фильм", description: "Отполированная анимация персонажей CG" },
|
|
41
41
|
"caricature": { label: "Карикатура", description: "Преувеличенный стилизованный портрет" },
|
|
42
42
|
"fresco": { label: "Фреска", description: "Настенная роспись по штукатурке в духе ренессансного потолка" },
|
|
43
43
|
"mosaic": { label: "Мозаика", description: "Мозаика из мелкой плитки, византийская" },
|
package/src/i18n/style.zh-CN.ts
CHANGED
|
@@ -37,7 +37,7 @@ const map: LocaleCatalogMap = {
|
|
|
37
37
|
"chalkboard": { label: "黑板画", description: "石板上的白色粉笔画" },
|
|
38
38
|
"paper-cutout": { label: "纸艺剪贴", description: "层叠剪纸加投影" },
|
|
39
39
|
"illuminated": { label: "彩饰手稿", description: "金箔加书法的中世纪手稿" },
|
|
40
|
-
"pixar-3d": { label: "
|
|
40
|
+
"pixar-3d": { label: "3D 动画电影", description: "精致的角色动画 CG" },
|
|
41
41
|
"caricature": { label: "漫画肖像", description: "夸张风格化的人物肖像" },
|
|
42
42
|
"fresco": { label: "湿壁画", description: "文艺复兴风格的灰泥天顶画" },
|
|
43
43
|
"mosaic": { label: "马赛克", description: "拜占庭风格的小块镶嵌艺术" },
|
package/src/mask-composite.ts
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
*
|
|
28
28
|
* Wire contract only — no I/O.
|
|
29
29
|
*/
|
|
30
|
+
import { pricedClipSeconds } from "./priced-clip-seconds.js"
|
|
30
31
|
|
|
31
32
|
/** How the background is fitted to the foreground's frame. */
|
|
32
33
|
export const MASK_COMPOSITE_BACKGROUND_FITS = ["cover", "contain", "stretch"] as const
|
|
@@ -68,17 +69,17 @@ export const MASK_COMPOSITE_UNIT_SEC = 5
|
|
|
68
69
|
|
|
69
70
|
/**
|
|
70
71
|
* Pricing units for a result `durationSec` long: one per started 5 seconds,
|
|
71
|
-
* at least one
|
|
72
|
-
*
|
|
73
|
-
*
|
|
72
|
+
* at least one, after `pricedClipSeconds` (up to 0.05 s past a whole second is
|
|
73
|
+
* ignored, so a 10.01 s result is 2 units, not 3). An unknown length counts the
|
|
74
|
+
* longest result a run accepts (an upper bound — the pre-run quote for a clip
|
|
75
|
+
* whose length is not known yet; every run measures its foreground).
|
|
74
76
|
*/
|
|
75
77
|
export function maskCompositeUnits(durationSec: number | null | undefined): number {
|
|
76
78
|
const sec =
|
|
77
79
|
typeof durationSec === "number" && Number.isFinite(durationSec) && durationSec > 0
|
|
78
80
|
? Math.min(durationSec, MASK_COMPOSITE_BOUNDS.MAX_DURATION_SEC)
|
|
79
81
|
: MASK_COMPOSITE_BOUNDS.MAX_DURATION_SEC
|
|
80
|
-
|
|
81
|
-
return Math.max(1, Math.ceil(sec / MASK_COMPOSITE_UNIT_SEC - 1e-6))
|
|
82
|
+
return Math.ceil(pricedClipSeconds(sec) / MASK_COMPOSITE_UNIT_SEC)
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
export const MASK_COMPOSITE_DEFAULTS = {
|
package/src/model-catalog.ts
CHANGED
|
@@ -838,8 +838,8 @@ const IMAGE_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
838
838
|
resolutions: ["1K", "2K", "4K"],
|
|
839
839
|
pricing: [
|
|
840
840
|
{ identifier: "gpt-image-2", credits: 15, note: "1K default" },
|
|
841
|
-
{ identifier: "gpt-image-2:2K", credits:
|
|
842
|
-
{ identifier: "gpt-image-2:4K", credits:
|
|
841
|
+
{ identifier: "gpt-image-2:2K", credits: 25, note: "2K" },
|
|
842
|
+
{ identifier: "gpt-image-2:4K", credits: 40, note: "4K" },
|
|
843
843
|
],
|
|
844
844
|
safetyFilter: { stochastic: true, fallback: "nano-banana-pro" },
|
|
845
845
|
featured: true,
|
|
@@ -860,8 +860,8 @@ const IMAGE_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
860
860
|
resolutions: ["1K", "2K", "4K"],
|
|
861
861
|
pricing: [
|
|
862
862
|
{ identifier: "gpt-image-2-i2i", credits: 15, note: "1K default" },
|
|
863
|
-
{ identifier: "gpt-image-2-i2i:2K", credits:
|
|
864
|
-
{ identifier: "gpt-image-2-i2i:4K", credits:
|
|
863
|
+
{ identifier: "gpt-image-2-i2i:2K", credits: 25, note: "2K" },
|
|
864
|
+
{ identifier: "gpt-image-2-i2i:4K", credits: 40, note: "4K" },
|
|
865
865
|
],
|
|
866
866
|
},
|
|
867
867
|
|
|
@@ -2029,13 +2029,13 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
2029
2029
|
{ identifier: "seedance-2-5", credits: 1260, note: "default 8s 720p — see :Ns:res variants for exact" },
|
|
2030
2030
|
{ identifier: "seedance-2-5:8s:480p", credits: 560, note: "8s 480p" },
|
|
2031
2031
|
{ identifier: "seedance-2-5:8s:720p", credits: 1260, note: "8s 720p" },
|
|
2032
|
-
{ identifier: "seedance-2-5:8s:1080p", credits:
|
|
2032
|
+
{ identifier: "seedance-2-5:8s:1080p", credits: 3160, note: "8s 1080p" },
|
|
2033
2033
|
{ identifier: "seedance-2-5:8s:480p-ref", credits: 340, note: "8s 480p with reference video" },
|
|
2034
2034
|
{ identifier: "seedance-2-5:8s:720p-ref", credits: 760, note: "8s 720p with reference video" },
|
|
2035
|
-
{ identifier: "seedance-2-5:8s:1080p-ref", credits:
|
|
2035
|
+
{ identifier: "seedance-2-5:8s:1080p-ref", credits: 1900, note: "8s 1080p with reference video" },
|
|
2036
2036
|
{ identifier: "seedance-2-5:30s:480p", credits: 2100, note: "30s 480p (max)" },
|
|
2037
2037
|
{ identifier: "seedance-2-5:30s:720p", credits: 4730, note: "30s 720p (max)" },
|
|
2038
|
-
{ identifier: "seedance-2-5:30s:1080p", credits:
|
|
2038
|
+
{ identifier: "seedance-2-5:30s:1080p", credits: 11850, note: "30s 1080p (max)" },
|
|
2039
2039
|
],
|
|
2040
2040
|
},
|
|
2041
2041
|
|
|
@@ -2817,10 +2817,10 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
2817
2817
|
],
|
|
2818
2818
|
},
|
|
2819
2819
|
// ── Video Depth ── (video-depth node; priced by the input clip's length via
|
|
2820
|
-
// videoDepthCreditId in video-depth.ts — `<provider>:<n>s`,
|
|
2821
|
-
//
|
|
2822
|
-
//
|
|
2823
|
-
//
|
|
2820
|
+
// videoDepthCreditId in video-depth.ts — `<provider>:<n>s`, one row per whole
|
|
2821
|
+
// second of the clip (`pricedClipSeconds`), representative rows below: `:1s` …
|
|
2822
|
+
// `:300s` on Video Depth Anything, `:1s` … `:80s` on Depth Anything per frame.
|
|
2823
|
+
// Bare row = the provider's longest clip: 300 s and 80 s.)
|
|
2824
2824
|
"video-depth-anything": {
|
|
2825
2825
|
id: "video-depth-anything",
|
|
2826
2826
|
kind: "video",
|
|
@@ -2833,7 +2833,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
2833
2833
|
useCases: ["depth", "video-to-video", "compositing"],
|
|
2834
2834
|
pricing: [
|
|
2835
2835
|
{ identifier: "video-depth-anything", credits: 6000, note: "5-min ceiling (no duration given)" },
|
|
2836
|
-
{ identifier: "video-depth-anything:1s", credits: 20, note: "1s (min) — priced per second of the clip at this row's credits, the length rounded up" },
|
|
2836
|
+
{ identifier: "video-depth-anything:1s", credits: 20, note: "1s (min) — priced per second of the clip at this row's credits, the length rounded up after ignoring up to 0.05 s past a whole second" },
|
|
2837
2837
|
{ identifier: "video-depth-anything:15s", credits: 300, note: "15s" },
|
|
2838
2838
|
{ identifier: "video-depth-anything:60s", credits: 1200, note: "1 min" },
|
|
2839
2839
|
{ identifier: "video-depth-anything:300s", credits: 6000, note: "5-min ceiling (max)" },
|
|
@@ -2850,12 +2850,11 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
2850
2850
|
description: "Depth Anything v1 run on each frame. Grayscale or inferno colormap; may flicker between frames. Up to 80 s.",
|
|
2851
2851
|
useCases: ["depth", "video-to-video"],
|
|
2852
2852
|
pricing: [
|
|
2853
|
-
{ identifier: "depth-anything-frames", credits:
|
|
2854
|
-
{ identifier: "depth-anything-frames:
|
|
2855
|
-
{ identifier: "depth-anything-frames:
|
|
2856
|
-
{ identifier: "depth-anything-frames:60s", credits: 120 },
|
|
2857
|
-
{ identifier: "depth-anything-frames:
|
|
2858
|
-
{ identifier: "depth-anything-frames:300s", credits: 600, note: "5-min ceiling" },
|
|
2853
|
+
{ identifier: "depth-anything-frames", credits: 160, note: "80s ceiling (no duration given)" },
|
|
2854
|
+
{ identifier: "depth-anything-frames:1s", credits: 2, note: "1s (min) — priced per second of the clip at this row's credits, the length rounded up after ignoring up to 0.05 s past a whole second" },
|
|
2855
|
+
{ identifier: "depth-anything-frames:15s", credits: 30, note: "15s" },
|
|
2856
|
+
{ identifier: "depth-anything-frames:60s", credits: 120, note: "1 min" },
|
|
2857
|
+
{ identifier: "depth-anything-frames:80s", credits: 160, note: "80s ceiling (max)" },
|
|
2859
2858
|
],
|
|
2860
2859
|
},
|
|
2861
2860
|
// ── Gemini video analysis ── (Gemini-only; billed per duration bucket — the
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The whole seconds a clip is PRICED at by Video Depth (both providers), Video
|
|
3
|
+
* Mask, Mask Composite and the face mesh: its length rounded up, after ignoring
|
|
4
|
+
* up to {@link CLIP_PRICE_GRACE_SEC} past a whole second.
|
|
5
|
+
*
|
|
6
|
+
* A whole-second cut of a 29.97 or 23.976 fps clip can come out a little long:
|
|
7
|
+
* 12 s is 360 frames, a 12.012 s file. A quote reads the cut, a run measures the
|
|
8
|
+
* file, and both land on the same row through this one rule, wherever those steps
|
|
9
|
+
* are reserved, charged or quoted.
|
|
10
|
+
*
|
|
11
|
+
* It decides the price only. Each step's limits (the 300 s cap, the frame cap)
|
|
12
|
+
* read the clip's real length. Other models round as they always have.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** How far past a whole second a clip is still priced as that second. */
|
|
16
|
+
export const CLIP_PRICE_GRACE_SEC = 0.05
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Float noise: a length that is arithmetic can land a hair past the edge, and
|
|
20
|
+
* must not round up for it. 1.35 s at 90 fps, priced at the 30 fps basis, is
|
|
21
|
+
* 4.050000000000001: 4, not 5.
|
|
22
|
+
*/
|
|
23
|
+
const FLOAT_NOISE_SEC = 1e-9
|
|
24
|
+
|
|
25
|
+
/** At least one second. The caller has checked that `sec` is a real length. */
|
|
26
|
+
export function pricedClipSeconds(sec: number): number {
|
|
27
|
+
return Math.max(1, Math.ceil(sec - CLIP_PRICE_GRACE_SEC - FLOAT_NOISE_SEC))
|
|
28
|
+
}
|
package/src/video-depth.ts
CHANGED
|
@@ -9,13 +9,15 @@
|
|
|
9
9
|
* produces from the inferno output (`videoDepthNeedsGrayscalePass`).
|
|
10
10
|
*
|
|
11
11
|
* Price rows are `model_pricing` rows (`<provider>:<n>s`); the credit amounts
|
|
12
|
-
* live there, never here.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* video-depth-anything: 0.4 s → `:1s`, 9 s → `:9s`, 9.2 s → `:10s`, 15.
|
|
16
|
-
* depth-anything-frames:
|
|
12
|
+
* live there, never here. Both providers have one row per whole second of the
|
|
13
|
+
* clip, up to the longest clip each accepts. Worked examples (repeated in
|
|
14
|
+
* docs/nodes/processing-video/video-depth.md):
|
|
15
|
+
* video-depth-anything: 0.4 s → `:1s`, 9 s → `:9s`, 9.2 s → `:10s`, 15.015 s → `:15s`, 15.06 s → `:16s`.
|
|
16
|
+
* depth-anything-frames: 0.4 s → `:1s`, 4 s → `:4s`, 4.1 s → `:5s`, 15.015 s → `:15s`, 15.06 s → `:16s`, 80 s → `:80s`.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
import { pricedClipSeconds } from "./priced-clip-seconds.js"
|
|
20
|
+
|
|
19
21
|
export const VIDEO_DEPTH_PROVIDERS = ["video-depth-anything", "depth-anything-frames"] as const
|
|
20
22
|
export type VideoDepthProvider = (typeof VIDEO_DEPTH_PROVIDERS)[number]
|
|
21
23
|
|
|
@@ -127,7 +129,13 @@ export function checkVideoDepthLength(
|
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
131
|
|
|
130
|
-
/**
|
|
132
|
+
/**
|
|
133
|
+
* The length buckets, in seconds, both providers were priced in before their
|
|
134
|
+
* per-second rows. A row is no longer picked from these: a clip's whole seconds
|
|
135
|
+
* name its row, so a `:15s` is the 15-second row and a `:120s` on Depth Anything
|
|
136
|
+
* per frame is past its limit. Each per-second row took its admin switches from
|
|
137
|
+
* the bucket that priced it (migrations 590 and 595).
|
|
138
|
+
*/
|
|
131
139
|
export const VIDEO_DEPTH_BUCKETS = [15, 30, 60, 120, 300] as const
|
|
132
140
|
|
|
133
141
|
/** The longest clip `provider` accepts (`checkVideoDepthLength`); the fal limit for anything else. */
|
|
@@ -140,23 +148,17 @@ function videoDepthMaxSeconds(provider: string): number {
|
|
|
140
148
|
/**
|
|
141
149
|
* The price row for a clip of `durationSec`.
|
|
142
150
|
*
|
|
143
|
-
*
|
|
144
|
-
* (`
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* boundaries inclusive).
|
|
151
|
+
* One row per whole second of the clip on both lanes: the clip's length rounded
|
|
152
|
+
* UP (`pricedClipSeconds`: up to 0.05 s past a whole second is ignored first), so
|
|
153
|
+
* a clip under one second is priced as one. `video-depth-anything:1s` … `:300s`
|
|
154
|
+
* (decided 2026-11-03), `depth-anything-frames:1s` … `:80s` (decided 2026-11-04).
|
|
148
155
|
*
|
|
149
156
|
* Unknown, non-positive or longer than the provider accepts → the provider's
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* run on it can be charged, never a row a run could not reach.
|
|
157
|
+
* longest clip (fal `:300s`, Replicate `:80s`), its highest REACHABLE row — the
|
|
158
|
+
* most a run on it can be charged, never a row a run could not reach.
|
|
153
159
|
*/
|
|
154
160
|
export function videoDepthCreditId(provider: string, durationSec: number | null | undefined): string {
|
|
155
161
|
const maxSec = videoDepthMaxSeconds(provider)
|
|
156
162
|
const known = typeof durationSec === "number" && Number.isFinite(durationSec) && durationSec > 0 && durationSec <= maxSec
|
|
157
|
-
|
|
158
|
-
const top = VIDEO_DEPTH_BUCKETS[VIDEO_DEPTH_BUCKETS.length - 1]
|
|
159
|
-
const reachableCeiling = VIDEO_DEPTH_BUCKETS.find((b) => b >= maxSec) ?? top
|
|
160
|
-
const bucket = known ? (VIDEO_DEPTH_BUCKETS.find((b) => durationSec <= b) ?? top) : reachableCeiling
|
|
161
|
-
return `${provider}:${bucket}s`
|
|
163
|
+
return `${provider}:${known ? pricedClipSeconds(durationSec) : maxSec}s`
|
|
162
164
|
}
|
package/src/video-face-mesh.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Priced by the clip's length at the 30 fps basis Video Mask uses
|
|
11
11
|
* (`videoMaskBilledSeconds`), one row per length bucket.
|
|
12
12
|
*/
|
|
13
|
+
import { pricedClipSeconds } from "./priced-clip-seconds.js"
|
|
13
14
|
import { VIDEO_MASK_LIMITS, type VideoMaskZone } from "./video-mask.js"
|
|
14
15
|
import type { VideoDepthColormap } from "./video-depth.js"
|
|
15
16
|
|
|
@@ -63,14 +64,16 @@ export function videoFaceMeshCreditIds(): string[] {
|
|
|
63
64
|
|
|
64
65
|
/**
|
|
65
66
|
* The price row for a clip priced at `billedSec` seconds: the smallest bucket
|
|
66
|
-
* that holds it
|
|
67
|
+
* that holds it, after `pricedClipSeconds` (up to 0.05 s past a bucket's length
|
|
68
|
+
* stays in that bucket). An unknown or non-positive length, or one past the cap,
|
|
67
69
|
* prices the LONGEST row (the route measures every clip and refuses one past
|
|
68
70
|
* the cap, so this is only ever a ceiling).
|
|
69
71
|
*/
|
|
70
72
|
export function videoFaceMeshCreditId(billedSec: number | null | undefined): string {
|
|
71
73
|
const ids = videoFaceMeshCreditIds()
|
|
72
74
|
if (typeof billedSec !== "number" || !Number.isFinite(billedSec) || billedSec <= 0) return ids[ids.length - 1]!
|
|
73
|
-
const
|
|
75
|
+
const priced = pricedClipSeconds(billedSec)
|
|
76
|
+
const i = VIDEO_FACE_MESH_BUCKETS_SEC.findIndex((b) => priced <= b)
|
|
74
77
|
return ids[i === -1 ? ids.length - 1 : i]!
|
|
75
78
|
}
|
|
76
79
|
|
package/src/video-link.ts
CHANGED
|
@@ -98,27 +98,27 @@ export function detectVideoLinkPlatform(url: string): VideoLinkPlatform {
|
|
|
98
98
|
/**
|
|
99
99
|
* Node types that can use a Video URL node WITHOUT its downloaded file, because
|
|
100
100
|
* they never read the video: `suno-cover` and `transcribe` take the node's
|
|
101
|
-
* separately-fetched audio track (`downloadedAudioUrl`), `
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
101
|
+
* separately-fetched audio track (`downloadedAudioUrl`), and `content-recipe`
|
|
102
|
+
* cites the post's page link on its `link` input (`videoLinkPageUrl`, both
|
|
103
|
+
* resolvers) — a Video URL can reach it on no other input. A run whose only
|
|
104
|
+
* consumers of a link are these must not be made to download — or to choose a
|
|
105
|
+
* part of — a video nobody will look at. Structural vocabulary: it mirrors
|
|
106
|
+
* those server-side readers; add a type here only together with its reader.
|
|
107
|
+
* Dubbing is not one: it dubs the file wired into it, and a page link wired in
|
|
108
|
+
* place of the file is not something its service can read as one.
|
|
108
109
|
*/
|
|
109
110
|
export const VIDEO_LINK_TOLERANT_CONSUMER_TYPES: ReadonlySet<string> = new Set([
|
|
110
111
|
"suno-cover",
|
|
111
112
|
"transcribe",
|
|
112
|
-
"dubbing",
|
|
113
113
|
"content-recipe",
|
|
114
114
|
])
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
117
|
* The tolerant consumers that DO read something fetched from the link — the
|
|
118
118
|
* separately-fetched audio track (`downloadedAudioUrl`): Transcribe and Suno
|
|
119
|
-
* Cover. The rest of the tolerant set (
|
|
120
|
-
*
|
|
121
|
-
*
|
|
119
|
+
* Cover. The rest of the tolerant set (Content Recipe) reads only the page
|
|
120
|
+
* link and needs nothing fetched. A subset of the tolerant set by construction
|
|
121
|
+
* (guard test).
|
|
122
122
|
*/
|
|
123
123
|
export const VIDEO_LINK_AUDIO_CONSUMER_TYPES: ReadonlySet<string> = new Set(["suno-cover", "transcribe"])
|
|
124
124
|
|
|
@@ -141,6 +141,23 @@ export function videoLinkNeedOf(consumerTypes: Iterable<string>): VideoLinkNeed
|
|
|
141
141
|
return audio ? "audio" : "none"
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Node types that set aside every wired media input while a field of their own
|
|
146
|
+
* holds a link, and that field: a Dubbing node with a Source link dubs that
|
|
147
|
+
* link (the dubbing service fetches it) and reads nothing wired into it. It
|
|
148
|
+
* mirrors both engines' source precedence for the type (the payload builder
|
|
149
|
+
* and the editor's runner).
|
|
150
|
+
*/
|
|
151
|
+
const WIRE_SETTING_ASIDE_FIELDS: ReadonlyMap<string, string> = new Map([["dubbing", "sourceUrl"]])
|
|
152
|
+
|
|
153
|
+
/** True when this node, as it stands, reads nothing wired into it (its own link field is filled). */
|
|
154
|
+
function setsAsideWiredMedia(node: VideoLinkGraphNode | undefined): boolean {
|
|
155
|
+
const field = node?.type === undefined ? undefined : WIRE_SETTING_ASIDE_FIELDS.get(node.type)
|
|
156
|
+
if (!field) return false
|
|
157
|
+
const value = (node?.data as Record<string, unknown> | undefined)?.[field]
|
|
158
|
+
return typeof value === "string" && value.trim() !== ""
|
|
159
|
+
}
|
|
160
|
+
|
|
144
161
|
/** The node shape the graph readers need — open on purpose, both engines' nodes fit. */
|
|
145
162
|
export interface VideoLinkGraphNode {
|
|
146
163
|
readonly id: string
|
|
@@ -195,10 +212,13 @@ export function videoLinkRunNeeds(
|
|
|
195
212
|
const consumers = new Map<string, string[]>()
|
|
196
213
|
for (const edge of edges) {
|
|
197
214
|
if (byId.get(edge.source)?.type !== "youtube-video" || !inRun.has(edge.target)) continue
|
|
198
|
-
const
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
|
|
215
|
+
const target = byId.get(edge.target)
|
|
216
|
+
const list = consumers.get(edge.source) ?? []
|
|
217
|
+
consumers.set(edge.source, list)
|
|
218
|
+
// A reader that sets the wire aside (a Dubbing node with its own Source
|
|
219
|
+
// link) reads nothing from the link: it asks nothing to be fetched, and a
|
|
220
|
+
// link read by it alone needs nothing (the entry stays, with no reader).
|
|
221
|
+
if (!setsAsideWiredMedia(target)) list.push(target?.type ?? "")
|
|
202
222
|
}
|
|
203
223
|
const needs = new Map<string, VideoLinkNeed>()
|
|
204
224
|
for (const [id, types] of consumers) needs.set(id, videoLinkNeedOf(types))
|