@nodaro/shared 3.62.0 → 3.63.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-6CSXMWL4.cjs → chunk-2PU3AGGS.cjs} +27 -4
- package/dist/chunk-2PU3AGGS.cjs.map +1 -0
- package/dist/{chunk-CC4V2B7S.js → chunk-34QLPTSA.js} +3 -3
- package/dist/{chunk-CC4V2B7S.js.map → chunk-34QLPTSA.js.map} +1 -1
- package/dist/{chunk-G4U3HW6W.js → chunk-3K24DWOH.js} +3 -3
- package/dist/{chunk-G4U3HW6W.js.map → chunk-3K24DWOH.js.map} +1 -1
- package/dist/{chunk-GSFB537T.js → chunk-4DVWXEB6.js} +23 -4
- package/dist/chunk-4DVWXEB6.js.map +1 -0
- package/dist/{chunk-ZES6EZC4.js → chunk-4MMZD63H.js} +3 -3
- package/dist/{chunk-ZES6EZC4.js.map → chunk-4MMZD63H.js.map} +1 -1
- package/dist/{chunk-N7OUQK7E.cjs → chunk-63H4C56Q.cjs} +8 -8
- package/dist/{chunk-N7OUQK7E.cjs.map → chunk-63H4C56Q.cjs.map} +1 -1
- package/dist/{chunk-2D5LQFV4.cjs → chunk-6BZC2ZHC.cjs} +9 -9
- package/dist/{chunk-2D5LQFV4.cjs.map → chunk-6BZC2ZHC.cjs.map} +1 -1
- package/dist/{chunk-3OYO3XCC.js → chunk-6M563QE6.js} +71 -9
- package/dist/chunk-6M563QE6.js.map +1 -0
- package/dist/{chunk-IDTKF5EX.cjs → chunk-6TGB7ECA.cjs} +7 -7
- package/dist/{chunk-IDTKF5EX.cjs.map → chunk-6TGB7ECA.cjs.map} +1 -1
- package/dist/{chunk-2HZGDZZN.cjs → chunk-6XUG4L7X.cjs} +6 -6
- package/dist/{chunk-2HZGDZZN.cjs.map → chunk-6XUG4L7X.cjs.map} +1 -1
- package/dist/{chunk-CIPPPT7E.cjs → chunk-77WU3V3J.cjs} +6 -6
- package/dist/{chunk-CIPPPT7E.cjs.map → chunk-77WU3V3J.cjs.map} +1 -1
- package/dist/{chunk-C7POAYFE.js → chunk-AE3AAJ4O.js} +3 -3
- package/dist/{chunk-C7POAYFE.js.map → chunk-AE3AAJ4O.js.map} +1 -1
- package/dist/{chunk-NGKKNSK6.js → chunk-BMJVKYVB.js} +36 -15
- package/dist/chunk-BMJVKYVB.js.map +1 -0
- package/dist/{chunk-YCXRSWCQ.js → chunk-CZ5IQB3L.js} +3 -3
- package/dist/{chunk-YCXRSWCQ.js.map → chunk-CZ5IQB3L.js.map} +1 -1
- package/dist/{chunk-E2HZTGYX.js → chunk-EPXGG27L.js} +7 -7
- package/dist/chunk-EPXGG27L.js.map +1 -0
- package/dist/{chunk-3M4BNKFJ.cjs → chunk-F6WGGYQW.cjs} +167 -3
- package/dist/chunk-F6WGGYQW.cjs.map +1 -0
- package/dist/{chunk-7FCTCWHD.js → chunk-FXGNRYQQ.js} +3 -3
- package/dist/{chunk-7FCTCWHD.js.map → chunk-FXGNRYQQ.js.map} +1 -1
- package/dist/{chunk-QWYFHQYK.cjs → chunk-GMBDLNLD.cjs} +86 -62
- package/dist/chunk-GMBDLNLD.cjs.map +1 -0
- package/dist/{chunk-KJSRPHJ2.cjs → chunk-GSKLPI3J.cjs} +100 -46
- package/dist/chunk-GSKLPI3J.cjs.map +1 -0
- package/dist/{chunk-S5TMRJMX.js → chunk-HBXF6RUU.js} +4 -4
- package/dist/{chunk-S5TMRJMX.js.map → chunk-HBXF6RUU.js.map} +1 -1
- package/dist/{chunk-S24ZBUB4.js → chunk-HWQ2SYNA.js} +6 -32
- package/dist/chunk-HWQ2SYNA.js.map +1 -0
- package/dist/{chunk-JJNNM23P.js → chunk-IY3Y462W.js} +3 -3
- package/dist/{chunk-JJNNM23P.js.map → chunk-IY3Y462W.js.map} +1 -1
- package/dist/{chunk-JZGZ26YB.js → chunk-KCZHQH2O.js} +4 -4
- package/dist/{chunk-JZGZ26YB.js.map → chunk-KCZHQH2O.js.map} +1 -1
- package/dist/{chunk-FVII3KHN.js → chunk-KMGCHV6O.js} +163 -4
- package/dist/chunk-KMGCHV6O.js.map +1 -0
- package/dist/{chunk-4ZEFP2FQ.cjs → chunk-L2TVY6XN.cjs} +4 -4
- package/dist/{chunk-4ZEFP2FQ.cjs.map → chunk-L2TVY6XN.cjs.map} +1 -1
- package/dist/{chunk-TRVWMKNE.cjs → chunk-LH72PQO2.cjs} +204 -52
- package/dist/chunk-LH72PQO2.cjs.map +1 -0
- package/dist/{chunk-HRY7KGAE.cjs → chunk-LMAQUR55.cjs} +6 -6
- package/dist/{chunk-HRY7KGAE.cjs.map → chunk-LMAQUR55.cjs.map} +1 -1
- package/dist/{chunk-MYJQELFN.cjs → chunk-M5OCFGHF.cjs} +254 -7
- package/dist/chunk-M5OCFGHF.cjs.map +1 -0
- package/dist/{chunk-I2RQB7VG.js → chunk-MD4XHED4.js} +3 -3
- package/dist/{chunk-I2RQB7VG.js.map → chunk-MD4XHED4.js.map} +1 -1
- package/dist/{chunk-6G7NN4S4.js → chunk-NIAFR5EE.js} +2 -2
- package/dist/chunk-NIAFR5EE.js.map +1 -0
- package/dist/{chunk-CF4S4N5X.js → chunk-O2QOBA6Q.js} +2 -2
- package/dist/{chunk-CF4S4N5X.js.map → chunk-O2QOBA6Q.js.map} +1 -1
- package/dist/{chunk-4GGLKRYI.cjs → chunk-O6TBB4IF.cjs} +2 -2
- package/dist/{chunk-4GGLKRYI.cjs.map → chunk-O6TBB4IF.cjs.map} +1 -1
- package/dist/{chunk-UDDVDQMF.js → chunk-OV3JTKBY.js} +166 -25
- package/dist/chunk-OV3JTKBY.js.map +1 -0
- package/dist/{chunk-5YYN5X57.js → chunk-PSKZKLDG.js} +252 -8
- package/dist/chunk-PSKZKLDG.js.map +1 -0
- package/dist/{chunk-IWWVPR3W.cjs → chunk-TM5JYSJF.cjs} +95 -19
- package/dist/chunk-TM5JYSJF.cjs.map +1 -0
- package/dist/{chunk-G3KVK7OU.cjs → chunk-V5EEQR2U.cjs} +21 -21
- package/dist/{chunk-G3KVK7OU.cjs.map → chunk-V5EEQR2U.cjs.map} +1 -1
- package/dist/{chunk-AOJ6B7K4.cjs → chunk-WZVIBAKN.cjs} +12 -12
- package/dist/chunk-WZVIBAKN.cjs.map +1 -0
- package/dist/{chunk-5M43XMRB.cjs → chunk-X5BAFW3Q.cjs} +8 -8
- package/dist/{chunk-5M43XMRB.cjs.map → chunk-X5BAFW3Q.cjs.map} +1 -1
- package/dist/{chunk-SYWR5G3T.js → chunk-XBTYGQ6Z.js} +51 -7
- package/dist/chunk-XBTYGQ6Z.js.map +1 -0
- package/dist/{chunk-AFYTX4AI.cjs → chunk-XGGZWA4A.cjs} +107 -50
- package/dist/chunk-XGGZWA4A.cjs.map +1 -0
- package/dist/{chunk-VACPZPUA.cjs → chunk-XGVJGNZW.cjs} +5 -5
- package/dist/{chunk-VACPZPUA.cjs.map → chunk-XGVJGNZW.cjs.map} +1 -1
- package/dist/{chunk-2W745U4A.cjs → chunk-Y35JQPT6.cjs} +42 -70
- package/dist/chunk-Y35JQPT6.cjs.map +1 -0
- package/dist/{chunk-KYMHFVAZ.cjs → chunk-Y4GCJJPF.cjs} +2 -2
- package/dist/chunk-Y4GCJJPF.cjs.map +1 -0
- package/dist/{chunk-PTD6EDUU.js → chunk-YUER7TJG.js} +3 -3
- package/dist/{chunk-PTD6EDUU.js.map → chunk-YUER7TJG.js.map} +1 -1
- package/dist/{chunk-Y6X7UJSD.js → chunk-YX6TFX7H.js} +66 -14
- package/dist/chunk-YX6TFX7H.js.map +1 -0
- package/dist/{chunk-TWF2OSH4.cjs → chunk-ZPE2ZTJ4.cjs} +4 -4
- package/dist/{chunk-TWF2OSH4.cjs.map → chunk-ZPE2ZTJ4.cjs.map} +1 -1
- package/dist/entries/apps.cjs +42 -42
- package/dist/entries/apps.js +7 -7
- package/dist/entries/credits.cjs +237 -169
- package/dist/entries/credits.d.cts +163 -16
- package/dist/entries/credits.d.ts +163 -16
- package/dist/entries/credits.js +10 -10
- package/dist/entries/llm-models.cjs +77 -57
- package/dist/entries/llm-models.d.cts +85 -6
- package/dist/entries/llm-models.d.ts +85 -6
- package/dist/entries/llm-models.js +2 -2
- package/dist/entries/media.cjs +63 -63
- package/dist/entries/media.d.cts +8 -0
- package/dist/entries/media.d.ts +8 -0
- package/dist/entries/media.js +1 -1
- package/dist/entries/model-catalog.cjs +121 -105
- package/dist/entries/model-catalog.d.cts +48 -18
- package/dist/entries/model-catalog.d.ts +48 -18
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +418 -322
- package/dist/entries/models.d.cts +71 -5
- package/dist/entries/models.d.ts +71 -5
- package/dist/entries/models.js +5 -5
- package/dist/entries/nodes.cjs +216 -208
- package/dist/entries/nodes.d.cts +22 -6
- package/dist/entries/nodes.d.ts +22 -6
- package/dist/entries/nodes.js +8 -8
- package/dist/entries/pipeline.cjs +152 -152
- package/dist/entries/pipeline.d.cts +3 -3
- package/dist/entries/pipeline.d.ts +3 -3
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/runtime-config.cjs +29 -29
- package/dist/entries/runtime-config.d.cts +10 -7
- package/dist/entries/runtime-config.d.ts +10 -7
- package/dist/entries/runtime-config.js +1 -1
- package/dist/entries/social.cjs +177 -177
- package/dist/entries/social.js +2 -2
- package/dist/entries/types.d.cts +8 -0
- package/dist/entries/types.d.ts +8 -0
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +154 -150
- package/dist/entries/video.d.cts +11 -2
- package/dist/entries/video.d.ts +11 -2
- package/dist/entries/video.js +6 -6
- package/dist/entries/workflow.d.cts +1 -1
- package/dist/entries/workflow.d.ts +1 -1
- package/dist/index.cjs +1727 -1515
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +23 -23
- package/dist/{model-catalog-CCEcv08q.d.cts → model-catalog-C_Eo35tL.d.cts} +30 -0
- package/dist/{model-catalog-CCEcv08q.d.ts → model-catalog-C_Eo35tL.d.ts} +30 -0
- package/dist/{model-constants-Cf3zaITt.d.cts → model-constants-Bg4ccSQb.d.ts} +138 -25
- package/dist/{model-constants-B88p6XR0.d.ts → model-constants-DWcxOmaY.d.cts} +138 -25
- package/package.json +1 -1
- package/src/__tests__/credit-identifiers.test.ts +29 -0
- package/src/__tests__/extend-providers.test.ts +106 -26
- package/src/__tests__/gvp-supported-providers.test.ts +27 -2
- package/src/__tests__/lip-sync-audio-rate.test.ts +74 -0
- package/src/__tests__/lip-sync-levers.test.ts +31 -0
- package/src/__tests__/llm-models.test.ts +132 -3
- package/src/__tests__/llm-price-key.test.ts +152 -1
- package/src/__tests__/nemotron-transcribe-pricing.test.ts +61 -0
- package/src/__tests__/normalize-node-params.test.ts +25 -0
- package/src/__tests__/pixverse-v6-max-catalog.test.ts +271 -0
- package/src/__tests__/prompt-length-limits.test.ts +4 -0
- package/src/__tests__/seedance-task-type.test.ts +13 -3
- package/src/__tests__/transcribe-capabilities.test.ts +39 -2
- package/src/__tests__/transcribe-preflight.test.ts +50 -1
- package/src/__tests__/video-audio-capability.test.ts +35 -6
- package/src/__tests__/video-resolution-billed-as-named.test.ts +30 -0
- package/src/__tests__/video-upscale-params.test.ts +62 -0
- package/src/catalog-projection.ts +8 -0
- package/src/credit-estimators/index.ts +10 -0
- package/src/credit-estimators/nemotron-transcribe.ts +87 -0
- package/src/credit-identifiers.ts +109 -35
- package/src/entries/credits.ts +12 -1
- package/src/entries/llm-models.ts +6 -0
- package/src/entries/model-catalog.ts +9 -0
- package/src/entries/models.ts +35 -0
- package/src/entries/nodes.ts +2 -0
- package/src/entries/video.ts +1 -1
- package/src/freecut-protocol.ts +8 -0
- package/src/lip-sync-levers.ts +56 -0
- package/src/lip-sync-pricing.ts +91 -1
- package/src/llm-models.ts +249 -4
- package/src/model-catalog.ts +250 -4
- package/src/model-constants.ts +277 -30
- package/src/model-tree.ts +2 -1
- package/src/nodaro-video-upscale.ts +48 -0
- package/src/node-default-mappings.ts +3 -0
- package/src/normalize-node-params.ts +49 -1
- package/src/runtime-config/contract.ts +10 -7
- package/src/seedance-draft.ts +2 -1
- package/src/transcribe-preflight.ts +58 -7
- package/src/video-duration.ts +9 -0
- package/src/video-ui-defaults.ts +5 -3
- package/src/video-upscale-params.ts +67 -0
- package/dist/chunk-2W745U4A.cjs.map +0 -1
- package/dist/chunk-3M4BNKFJ.cjs.map +0 -1
- package/dist/chunk-3OYO3XCC.js.map +0 -1
- package/dist/chunk-5YYN5X57.js.map +0 -1
- package/dist/chunk-6CSXMWL4.cjs.map +0 -1
- package/dist/chunk-6G7NN4S4.js.map +0 -1
- package/dist/chunk-AFYTX4AI.cjs.map +0 -1
- package/dist/chunk-AOJ6B7K4.cjs.map +0 -1
- package/dist/chunk-E2HZTGYX.js.map +0 -1
- package/dist/chunk-FVII3KHN.js.map +0 -1
- package/dist/chunk-GSFB537T.js.map +0 -1
- package/dist/chunk-IWWVPR3W.cjs.map +0 -1
- package/dist/chunk-KJSRPHJ2.cjs.map +0 -1
- package/dist/chunk-KYMHFVAZ.cjs.map +0 -1
- package/dist/chunk-MYJQELFN.cjs.map +0 -1
- package/dist/chunk-NGKKNSK6.js.map +0 -1
- package/dist/chunk-QWYFHQYK.cjs.map +0 -1
- package/dist/chunk-S24ZBUB4.js.map +0 -1
- package/dist/chunk-SYWR5G3T.js.map +0 -1
- package/dist/chunk-TRVWMKNE.cjs.map +0 -1
- package/dist/chunk-UDDVDQMF.js.map +0 -1
- package/dist/chunk-Y6X7UJSD.js.map +0 -1
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest"
|
|
2
|
+
import { MODEL_CATALOG, MODEL_MAKERS, defaultResolutionFor, modelMakerOf, normalizeVideoRequestParams } from "../model-catalog.js"
|
|
3
|
+
import {
|
|
4
|
+
IMAGE_TO_VIDEO_PROVIDERS,
|
|
5
|
+
TEXT_TO_VIDEO_PROVIDERS,
|
|
6
|
+
VIDEO_GEN_PROVIDERS,
|
|
7
|
+
PIXVERSE_V6_MAX_PROVIDER,
|
|
8
|
+
PIXVERSE_V6_MAX_DEFAULT_QUALITY,
|
|
9
|
+
isPixverseV6MaxProvider,
|
|
10
|
+
normalizePixverseV6MaxQuality,
|
|
11
|
+
AUDIO_ADDON_PROVIDERS,
|
|
12
|
+
DURATION_PRICED_PROVIDERS,
|
|
13
|
+
RESOLUTION_DURATION_PRICING,
|
|
14
|
+
PRICING_DEFAULT_RESOLUTION,
|
|
15
|
+
VIDEO_DURATION_TIERS,
|
|
16
|
+
VIDEO_REF_LIMITS_BY_PROVIDER,
|
|
17
|
+
VIDEO_VARIABLE_PRICING,
|
|
18
|
+
applyVideoAudioToggle,
|
|
19
|
+
getVideoAudioCapability,
|
|
20
|
+
videoAudioIntent,
|
|
21
|
+
videoAudioPricedOn,
|
|
22
|
+
GVP_SUPPORTED_PROVIDERS,
|
|
23
|
+
GVP_EXTEND_PROVIDERS,
|
|
24
|
+
GVP_END_FRAME_PROVIDERS,
|
|
25
|
+
resolveGvpAnchorWire,
|
|
26
|
+
videoModelCanSpeakDialogue,
|
|
27
|
+
getMaxVideoPromptChars,
|
|
28
|
+
pricedOutputDurationSec,
|
|
29
|
+
videoProviderRequiresImage,
|
|
30
|
+
videoProviderFoldsLoneEndFrame,
|
|
31
|
+
isGvpSupportedProvider,
|
|
32
|
+
} from "../model-constants.js"
|
|
33
|
+
import { buildVideoCreditModelIdentifier, pricedVideoSelection, videoGenerationCreditId } from "../credit-identifiers.js"
|
|
34
|
+
import { uiAspectRatioFill, uiDurationFill, uiResolutionFill } from "../video-ui-defaults.js"
|
|
35
|
+
import { mapQuality } from "../node-default-mappings.js"
|
|
36
|
+
|
|
37
|
+
const ID = "pixverse-v6-max"
|
|
38
|
+
const DURATIONS = Array.from({ length: 15 }, (_, i) => i + 1)
|
|
39
|
+
const QUALITIES = ["360p", "540p", "720p", "1080p"] as const
|
|
40
|
+
|
|
41
|
+
describe("pixverse-v6-max catalog", () => {
|
|
42
|
+
it("one id over both endpoints: text-to-video and image-to-video, 1-15s, 360p-1080p, native audio", () => {
|
|
43
|
+
const m = MODEL_CATALOG[ID]!
|
|
44
|
+
expect(isPixverseV6MaxProvider(ID)).toBe(true)
|
|
45
|
+
expect(PIXVERSE_V6_MAX_PROVIDER).toBe(ID)
|
|
46
|
+
expect([...m.modes].sort()).toEqual(["i2v", "t2v"])
|
|
47
|
+
// No end frame, no reference images / videos / audio, no character subjects.
|
|
48
|
+
expect([...(m.features ?? [])]).toEqual(["audio"])
|
|
49
|
+
expect(m.durations).toEqual(DURATIONS)
|
|
50
|
+
expect(m.defaultDuration).toBe(5)
|
|
51
|
+
expect(m.resolutions).toEqual([...QUALITIES])
|
|
52
|
+
expect(m.defaultResolution).toBe("720p")
|
|
53
|
+
expect(m.unlistedResolutionRendersAs).toBe("720p")
|
|
54
|
+
// Both schemas take a seed (0-2147483647).
|
|
55
|
+
expect(m.noSeed).toBeUndefined()
|
|
56
|
+
// The text-to-video enum, in KIE's order; the image-to-video body takes none.
|
|
57
|
+
expect(m.aspectRatios).toEqual(["16:9", "4:3", "1:1", "3:4", "9:16", "2:3", "3:2", "21:9"])
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
it("is made by PixVerse, a maker of its own", () => {
|
|
61
|
+
expect(MODEL_MAKERS.pixverse).toEqual({ name: "PixVerse" })
|
|
62
|
+
expect(modelMakerOf(MODEL_CATALOG[ID]!)).toEqual({ id: "pixverse", name: "PixVerse" })
|
|
63
|
+
expect(MODEL_CATALOG[ID]!.family).toBe("PixVerse")
|
|
64
|
+
expect(MODEL_CATALOG[ID]!.series).toBe("PixVerse")
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it("is offered in both video lanes, runs without an image, and takes no references", () => {
|
|
68
|
+
expect(IMAGE_TO_VIDEO_PROVIDERS as readonly string[]).toContain(ID)
|
|
69
|
+
expect(TEXT_TO_VIDEO_PROVIDERS as readonly string[]).toContain(ID)
|
|
70
|
+
expect(VIDEO_GEN_PROVIDERS as readonly string[]).toContain(ID)
|
|
71
|
+
expect(videoProviderRequiresImage(ID)).toBe(false)
|
|
72
|
+
expect(VIDEO_REF_LIMITS_BY_PROVIDER[ID]).toBeUndefined()
|
|
73
|
+
expect(videoProviderFoldsLoneEndFrame(ID)).toBe(false)
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
it("joins Generate Video Pro through its explicit opt-in, keyframes only, with no end anchor", () => {
|
|
77
|
+
expect(MODEL_CATALOG[ID]!.gvpWithoutReferences).toBe(true)
|
|
78
|
+
expect(isGvpSupportedProvider(ID)).toBe(true)
|
|
79
|
+
expect(GVP_SUPPORTED_PROVIDERS as readonly string[]).toContain(ID)
|
|
80
|
+
expect(GVP_EXTEND_PROVIDERS as readonly string[]).not.toContain(ID)
|
|
81
|
+
expect(GVP_END_FRAME_PROVIDERS as readonly string[]).not.toContain(ID)
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
it("a stored reference anchor choice runs as Auto in Generate Video Pro", () => {
|
|
85
|
+
expect(resolveGvpAnchorWire("reference", ID)).toBeUndefined()
|
|
86
|
+
expect(resolveGvpAnchorWire("start-end", ID)).toBe("upfront")
|
|
87
|
+
expect(resolveGvpAnchorWire("start-only", ID)).toBe("progressive")
|
|
88
|
+
// Every other model: "reference" still means none.
|
|
89
|
+
expect(resolveGvpAnchorWire("reference", "seedance-2")).toBe("none")
|
|
90
|
+
expect(resolveGvpAnchorWire("reference")).toBe("none")
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
it("caps the prompt at the schema's 5000 characters", () => {
|
|
94
|
+
expect(getMaxVideoPromptChars(ID)).toBe(5000)
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
describe("the native audio lever", () => {
|
|
99
|
+
it("is cost-affecting, on by default and classified ambient (no live dialogue probe yet)", () => {
|
|
100
|
+
const cap = getVideoAudioCapability(ID)
|
|
101
|
+
expect(cap).toEqual({ mode: "ambient", field: "generateAudioSwitch", affectsCost: true, defaultOn: true, readsGenerateAudio: true })
|
|
102
|
+
expect(AUDIO_ADDON_PROVIDERS.has(ID)).toBe(true)
|
|
103
|
+
expect(videoModelCanSpeakDialogue(ID)).toBe(false)
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
it("writes generate_audio_switch from `sound`, else `generateAudio` — the reading its price follows", () => {
|
|
107
|
+
for (const sound of [true, false]) {
|
|
108
|
+
const input: Record<string, unknown> = {}
|
|
109
|
+
applyVideoAudioToggle(input, ID, { sound })
|
|
110
|
+
expect(input).toEqual({ generate_audio_switch: sound })
|
|
111
|
+
}
|
|
112
|
+
// The Generate Video Pro engine sends `generateAudio` alone.
|
|
113
|
+
for (const generateAudio of [true, false]) {
|
|
114
|
+
const input: Record<string, unknown> = {}
|
|
115
|
+
applyVideoAudioToggle(input, ID, { generateAudio })
|
|
116
|
+
expect(input).toEqual({ generate_audio_switch: generateAudio })
|
|
117
|
+
expect(videoAudioIntent(ID, { generateAudio })).toBe(generateAudio)
|
|
118
|
+
}
|
|
119
|
+
// `sound` wins when both are sent.
|
|
120
|
+
const both: Record<string, unknown> = {}
|
|
121
|
+
applyVideoAudioToggle(both, ID, { sound: false, generateAudio: true })
|
|
122
|
+
expect(both).toEqual({ generate_audio_switch: false })
|
|
123
|
+
// The price reads the same: on with no intent, else the intent.
|
|
124
|
+
expect(videoAudioPricedOn(ID, {})).toBe(true)
|
|
125
|
+
expect(videoAudioPricedOn(ID, { generateAudio: false })).toBe(false)
|
|
126
|
+
expect(videoAudioPricedOn(ID, { sound: true, generateAudio: false })).toBe(true)
|
|
127
|
+
// No intent leaves the caller's own base value in place.
|
|
128
|
+
const base: Record<string, unknown> = { generate_audio_switch: true }
|
|
129
|
+
applyVideoAudioToggle(base, ID, undefined)
|
|
130
|
+
expect(base).toEqual({ generate_audio_switch: true })
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
describe("one quality normalizer for the wire and the bill", () => {
|
|
135
|
+
it("folds case and collapses anything else to 720p", () => {
|
|
136
|
+
expect(PIXVERSE_V6_MAX_DEFAULT_QUALITY).toBe("720p")
|
|
137
|
+
expect(normalizePixverseV6MaxQuality("1080P")).toBe("1080p")
|
|
138
|
+
expect(normalizePixverseV6MaxQuality(" 540p ")).toBe("540p")
|
|
139
|
+
expect(normalizePixverseV6MaxQuality("360p")).toBe("360p")
|
|
140
|
+
for (const off of [undefined, "", "480p", "4k", "2k", "nonsense"]) {
|
|
141
|
+
expect(normalizePixverseV6MaxQuality(off), String(off)).toBe("720p")
|
|
142
|
+
}
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
it("the catalog's collapse target is the normalizer's", () => {
|
|
146
|
+
for (const off of ["480p", "4k", "nonsense"]) {
|
|
147
|
+
expect(normalizeVideoRequestParams(ID, { resolution: off }).resolution, off).toBe(MODEL_CATALOG[ID]!.unlistedResolutionRendersAs)
|
|
148
|
+
}
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
it("the credit identifier bills what the runner renders, for every spelling", () => {
|
|
152
|
+
const cases: Array<[string | undefined, string]> = [
|
|
153
|
+
["1080P", "1080p"], ["540P", "540p"], ["360p", "360p"], ["720p", "720p"],
|
|
154
|
+
[undefined, "720p"], ["480p", "720p"], ["4k", "720p"], ["nonsense", "720p"],
|
|
155
|
+
]
|
|
156
|
+
for (const [asked, billed] of cases) {
|
|
157
|
+
expect(normalizePixverseV6MaxQuality(asked)).toBe(billed)
|
|
158
|
+
expect(buildVideoCreditModelIdentifier(ID, 5, false, "image-to-video", undefined, asked)).toBe(`${ID}:5s:${billed}`)
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
describe("the credit identifier", () => {
|
|
164
|
+
it("is one row per second × quality, with `:audio` last when audio is on — and on when unset", () => {
|
|
165
|
+
for (const d of DURATIONS) {
|
|
166
|
+
for (const q of QUALITIES) {
|
|
167
|
+
for (const mode of ["image-to-video", "text-to-video"] as const) {
|
|
168
|
+
expect(buildVideoCreditModelIdentifier(ID, d, false, mode, undefined, q)).toBe(`${ID}:${d}s:${q}`)
|
|
169
|
+
expect(buildVideoCreditModelIdentifier(ID, d, true, mode, undefined, q)).toBe(`${ID}:${d}s:${q}:audio`)
|
|
170
|
+
expect(buildVideoCreditModelIdentifier(ID, d, undefined, mode, undefined, q)).toBe(`${ID}:${d}s:${q}:audio`)
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
it("an unset request is the 5s 720p render with audio, and past 15s holds the top rung", () => {
|
|
177
|
+
expect(buildVideoCreditModelIdentifier(ID)).toBe(`${ID}:5s:720p:audio`)
|
|
178
|
+
expect(buildVideoCreditModelIdentifier(ID, 30, false, "text-to-video", undefined, "1080p")).toBe(`${ID}:15s:1080p`)
|
|
179
|
+
expect(pricedOutputDurationSec(ID, undefined)).toBe(5)
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
it("reads the request's audio fields as the runner does: `sound`, else `generateAudio`, else on", () => {
|
|
183
|
+
expect(buildVideoCreditModelIdentifier(ID, 5, { generateAudio: false }, "image-to-video", undefined, "720p")).toBe(`${ID}:5s:720p`)
|
|
184
|
+
expect(buildVideoCreditModelIdentifier(ID, 5, { generateAudio: true }, "image-to-video", undefined, "720p")).toBe(`${ID}:5s:720p:audio`)
|
|
185
|
+
expect(buildVideoCreditModelIdentifier(ID, 5, { sound: true, generateAudio: false }, "image-to-video", undefined, "720p")).toBe(`${ID}:5s:720p:audio`)
|
|
186
|
+
expect(buildVideoCreditModelIdentifier(ID, 5, {}, "image-to-video", undefined, "720p")).toBe(`${ID}:5s:720p:audio`)
|
|
187
|
+
expect(videoGenerationCreditId({ provider: ID, generateAudio: false })).toBe(`${ID}:5s:720p`)
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
it("Kling keeps reading `sound` alone: `generateAudio` moves none of its rows", () => {
|
|
191
|
+
for (const generateAudio of [true, false, undefined]) {
|
|
192
|
+
expect(buildVideoCreditModelIdentifier("kling-3.0", 10, { generateAudio }, "image-to-video")).toBe("kling-3.0:10s:audio")
|
|
193
|
+
expect(buildVideoCreditModelIdentifier("kling", 5, { generateAudio }, "image-to-video")).toBe("kling:5s")
|
|
194
|
+
expect(buildVideoCreditModelIdentifier("kling-3.0", 10, { sound: false, generateAudio }, "image-to-video")).toBe("kling-3.0:10s")
|
|
195
|
+
}
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
// A request that carries `generateAudio` alone — what a Generate Video Pro
|
|
199
|
+
// segment's provider is handed (the render-rules `gvpSegmentAudio` mapping).
|
|
200
|
+
it("a request carrying `generateAudio` alone is billed at the audio each model renders from it", () => {
|
|
201
|
+
expect(buildVideoCreditModelIdentifier(ID, 6, { generateAudio: true }, "image-to-video", undefined, "720p")).toBe(`${ID}:6s:720p:audio`)
|
|
202
|
+
expect(buildVideoCreditModelIdentifier(ID, 6, { generateAudio: false }, "image-to-video", undefined, "720p")).toBe(`${ID}:6s:720p`)
|
|
203
|
+
expect(buildVideoCreditModelIdentifier(ID, 6, { generateAudio: undefined }, "image-to-video", undefined, "720p")).toBe(`${ID}:6s:720p:audio`)
|
|
204
|
+
for (const generateAudio of [true, false, undefined]) {
|
|
205
|
+
// Kling 3.0 reads only `sound`: its default, on. Kling 2.6: off.
|
|
206
|
+
expect(buildVideoCreditModelIdentifier("kling-3.0", 10, { generateAudio }, "image-to-video")).toBe("kling-3.0:10s:audio")
|
|
207
|
+
expect(buildVideoCreditModelIdentifier("kling", 5, { generateAudio }, "image-to-video")).toBe("kling:5s")
|
|
208
|
+
}
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
it("a model whose price does not depend on audio keeps its rows whatever the request's audio", () => {
|
|
212
|
+
for (const other of ["seedance-2", "seedance-2-mini", "minimax-h3", "kling-4", "vidu-q4", "wan-3"]) {
|
|
213
|
+
const silent = buildVideoCreditModelIdentifier(other, 8, false, "image-to-video", undefined, "720p")
|
|
214
|
+
for (const generateAudio of [true, false, undefined]) {
|
|
215
|
+
expect(buildVideoCreditModelIdentifier(other, 8, { generateAudio }, "image-to-video", undefined, "720p"), other).toBe(silent)
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
})
|
|
219
|
+
|
|
220
|
+
it("moving `:audio` after the other dimensions leaves Kling's rows where they were", () => {
|
|
221
|
+
expect(buildVideoCreditModelIdentifier("kling-3.0", 10, true, "image-to-video")).toBe("kling-3.0:10s:audio")
|
|
222
|
+
expect(buildVideoCreditModelIdentifier("kling-3.0", 5, undefined, "image-to-video")).toBe("kling-3.0:5s:audio")
|
|
223
|
+
expect(buildVideoCreditModelIdentifier("kling-3.0", 15, false, "image-to-video")).toBe("kling-3.0:15s")
|
|
224
|
+
expect(buildVideoCreditModelIdentifier("kling", 5, true, "image-to-video")).toBe("kling:5s:audio")
|
|
225
|
+
expect(buildVideoCreditModelIdentifier("kling", 10, undefined, "image-to-video")).toBe("kling:10s")
|
|
226
|
+
})
|
|
227
|
+
|
|
228
|
+
it("is declared on every pricing table the builder reads", () => {
|
|
229
|
+
expect(DURATION_PRICED_PROVIDERS.has(ID)).toBe(true)
|
|
230
|
+
expect(RESOLUTION_DURATION_PRICING[ID]).toEqual([...QUALITIES])
|
|
231
|
+
expect(PRICING_DEFAULT_RESOLUTION[ID]).toBe("720p")
|
|
232
|
+
expect(VIDEO_DURATION_TIERS[ID]!.map((t) => t.suffix)).toEqual(DURATIONS.map((d) => `${d}s`))
|
|
233
|
+
expect(VIDEO_VARIABLE_PRICING[ID]).toBe("duration+resolution+audio")
|
|
234
|
+
})
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
describe("defaults every surface reads", () => {
|
|
238
|
+
it("an unset resolution and duration are 720p and 5s, never the 360p / 1s first entries", () => {
|
|
239
|
+
expect(pricedVideoSelection({ provider: ID })).toEqual({ resolution: "720p", duration: 5, adjustments: [] })
|
|
240
|
+
expect(pricedVideoSelection({ provider: ID, resolution: "360p", duration: 3 })).toEqual({ resolution: "360p", duration: 3, adjustments: [] })
|
|
241
|
+
expect(uiResolutionFill(ID)).toBe("720p")
|
|
242
|
+
expect(uiDurationFill(ID)).toBe(5)
|
|
243
|
+
expect(defaultResolutionFor(ID)).toBe("720p")
|
|
244
|
+
// No aspect fill: the text-to-video runner sends 16:9 (the first listed),
|
|
245
|
+
// and an image-to-video run follows the image.
|
|
246
|
+
expect(uiAspectRatioFill(ID)).toBeUndefined()
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
it("the quality rungs land on 540p / 720p / 1080p", () => {
|
|
250
|
+
expect(mapQuality(ID, "low")).toEqual({ field: "resolution", value: "540p" })
|
|
251
|
+
expect(mapQuality(ID, "mid")).toEqual({ field: "resolution", value: "720p" })
|
|
252
|
+
expect(mapQuality(ID, "high")).toEqual({ field: "resolution", value: "1080p" })
|
|
253
|
+
})
|
|
254
|
+
})
|
|
255
|
+
|
|
256
|
+
describe("the catalog's price rows follow the ladder", () => {
|
|
257
|
+
it("each row is ceil(rate × seconds / 10) × 10 at its quality and audio rate", () => {
|
|
258
|
+
// Base credits a second (KIE credits a second × 2.5, all whole numbers).
|
|
259
|
+
const rate: Record<string, readonly [number, number]> = {
|
|
260
|
+
"360p": [12, 18], "540p": [18, 22], "720p": [22, 30], "1080p": [44, 56],
|
|
261
|
+
}
|
|
262
|
+
const ladder = (q: string, s: number, audio: boolean) => Math.ceil((rate[q]![audio ? 1 : 0] * s) / 10) * 10
|
|
263
|
+
for (const row of MODEL_CATALOG[ID]!.pricing) {
|
|
264
|
+
const m = /^pixverse-v6-max(?::(\d+)s:(\d+p)(:audio)?)?$/.exec(row.identifier)
|
|
265
|
+
expect(m, row.identifier).not.toBeNull()
|
|
266
|
+
// The bare id is the default render: 5s 720p with audio.
|
|
267
|
+
const [s, q, audio] = m![1] ? [Number(m![1]), m![2]!, m![3] !== undefined] : [5, "720p", true]
|
|
268
|
+
expect(row.credits, row.identifier).toBe(ladder(q, s, audio))
|
|
269
|
+
}
|
|
270
|
+
})
|
|
271
|
+
})
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
VIDEO_GEN_PROVIDERS,
|
|
26
26
|
VIDEO_TO_VIDEO_PROVIDERS,
|
|
27
27
|
EXTEND_VIDEO_PROVIDERS,
|
|
28
|
+
LIP_SYNC_PROVIDERS,
|
|
28
29
|
} from "../model-constants.js"
|
|
29
30
|
|
|
30
31
|
describe("per-model prompt length limits", () => {
|
|
@@ -177,6 +178,9 @@ describe("per-model prompt length limits", () => {
|
|
|
177
178
|
...VIDEO_GEN_PROVIDERS,
|
|
178
179
|
...VIDEO_TO_VIDEO_PROVIDERS,
|
|
179
180
|
...EXTEND_VIDEO_PROVIDERS,
|
|
181
|
+
// A lip-sync model is a video model too: OmniHuman 2.0's prompt is cut to
|
|
182
|
+
// its own 300-character limit (KIE schema) through this same table.
|
|
183
|
+
...LIP_SYNC_PROVIDERS,
|
|
180
184
|
])
|
|
181
185
|
|
|
182
186
|
it("every image-cap key is a real image provider id", () => {
|
|
@@ -11,7 +11,6 @@ import { isVideoAutoAspectToken, videoAutoAspectRunsAt } from "../model-catalog.
|
|
|
11
11
|
|
|
12
12
|
const base: Omit<SeedanceTaskTypeFacts, "requested"> = {
|
|
13
13
|
provider: "seedance-2-5",
|
|
14
|
-
draft: false,
|
|
15
14
|
referenceImageCount: 0,
|
|
16
15
|
referenceAudioCount: 0,
|
|
17
16
|
referenceVideoSec: [6],
|
|
@@ -58,8 +57,19 @@ describe("resolveSeedanceTaskType", () => {
|
|
|
58
57
|
expectUnchanged({ ...base, provider: "kling-4", requested: "edit" })
|
|
59
58
|
})
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
// A draft declares, and is forced, exactly as the same request without Draft:
|
|
61
|
+
// the whole result, for each type, at a fixed and at an automatic length.
|
|
62
|
+
it.each([
|
|
63
|
+
["edit", 5], ["edit", -1], ["extend", 5], ["extend", -1], ["reference", 5], ["reference", -1],
|
|
64
|
+
] as const)("a draft declares %s at %s s exactly as a run without Draft", (requested, duration) => {
|
|
65
|
+
const run = resolveSeedanceTaskType({ ...base, requested, duration })
|
|
66
|
+
expect(run.taskType).toBe(requested)
|
|
67
|
+
expect(resolveSeedanceTaskType({ ...base, requested, duration, draft: true })).toStrictEqual(run)
|
|
68
|
+
expect(resolveSeedanceTaskType({ ...base, requested, duration, draft: false })).toStrictEqual(run)
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
it("a draft with an edit it cannot honour declares nothing, as a run without Draft", () => {
|
|
72
|
+
expectUnchanged({ ...base, draft: true, requested: "edit", referenceVideoSec: [3] })
|
|
63
73
|
})
|
|
64
74
|
|
|
65
75
|
it("no reference media at all: unchanged", () => {
|
|
@@ -3,8 +3,12 @@ import {
|
|
|
3
3
|
TRANSCRIBE_PROVIDERS,
|
|
4
4
|
TRANSCRIBE_LANES,
|
|
5
5
|
TRANSCRIBE_PROVIDER_CAPABILITIES,
|
|
6
|
+
CAPTION_TRANSCRIBE_LANES,
|
|
7
|
+
TRANSCRIBE_TARGET_LANGUAGES,
|
|
6
8
|
transcribeProvidersWithWordTimestamps,
|
|
7
9
|
transcribeLaneSupportsWordTimestamps,
|
|
10
|
+
transcribeProvidersWithTranslation,
|
|
11
|
+
transcribeLaneSupportsTranslation,
|
|
8
12
|
DEFAULT_TRANSCRIBE_PROVIDER,
|
|
9
13
|
DEFAULT_TRANSCRIBE_NODE_PROVIDER,
|
|
10
14
|
} from "../model-constants.js"
|
|
@@ -32,16 +36,49 @@ describe("transcribe lane capabilities", () => {
|
|
|
32
36
|
expect(extra, `capability rows for unknown lanes: ${extra.join(", ")}`).toEqual([])
|
|
33
37
|
})
|
|
34
38
|
|
|
35
|
-
it("openai/whisper cannot do word timestamps; the other
|
|
39
|
+
it("openai/whisper cannot do word timestamps; the other three can", () => {
|
|
36
40
|
// Not a taste call: openai/whisper on Replicate has no `word_timestamps`
|
|
37
41
|
// input in any published version, so the key is silently dropped.
|
|
38
42
|
expect(TRANSCRIBE_PROVIDER_CAPABILITIES.whisper.wordTimestamps).toBe(false)
|
|
39
43
|
expect(TRANSCRIBE_PROVIDER_CAPABILITIES["incredibly-fast-whisper"].wordTimestamps).toBe(true)
|
|
40
44
|
expect(TRANSCRIBE_PROVIDER_CAPABILITIES["elevenlabs-stt"].wordTimestamps).toBe(true)
|
|
45
|
+
expect(TRANSCRIBE_PROVIDER_CAPABILITIES["nemotron-3-5-transcribe"].wordTimestamps).toBe(true)
|
|
41
46
|
})
|
|
42
47
|
|
|
43
48
|
it("transcribeProvidersWithWordTimestamps derives from the capability map", () => {
|
|
44
|
-
expect(transcribeProvidersWithWordTimestamps()).toEqual(["incredibly-fast-whisper", "elevenlabs-stt"])
|
|
49
|
+
expect(transcribeProvidersWithWordTimestamps()).toEqual(["incredibly-fast-whisper", "elevenlabs-stt", "nemotron-3-5-transcribe"])
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it("only Nemotron 3.5 Transcribe translates", () => {
|
|
53
|
+
expect(transcribeProvidersWithTranslation()).toEqual(["nemotron-3-5-transcribe"])
|
|
54
|
+
expect(transcribeLaneSupportsTranslation("nemotron-3-5-transcribe")).toBe(true)
|
|
55
|
+
expect(transcribeLaneSupportsTranslation("elevenlabs-stt")).toBe(false)
|
|
56
|
+
expect(transcribeLaneSupportsTranslation("deepgram")).toBe(false)
|
|
57
|
+
expect(transcribeLaneSupportsTranslation(undefined)).toBe(false)
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
it("the target languages are KIE's 32 (English first)", () => {
|
|
61
|
+
expect(TRANSCRIBE_TARGET_LANGUAGES[0]).toBe("en")
|
|
62
|
+
expect(TRANSCRIBE_TARGET_LANGUAGES).toHaveLength(32)
|
|
63
|
+
expect(new Set(TRANSCRIBE_TARGET_LANGUAGES).size).toBe(32)
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
it("the new engine joins at the END, so the first word-capable provider stays ElevenLabs STT", () => {
|
|
67
|
+
// Several call sites take "the first enabled word-capable provider" from
|
|
68
|
+
// TRANSCRIBE_PROVIDERS (add-captions' cloud relay among them).
|
|
69
|
+
expect(TRANSCRIBE_PROVIDERS[0]).toBe("elevenlabs-stt")
|
|
70
|
+
expect(TRANSCRIBE_PROVIDERS.find((p) => TRANSCRIBE_PROVIDER_CAPABILITIES[p].wordTimestamps)).toBe("elevenlabs-stt")
|
|
71
|
+
expect(TRANSCRIBE_PROVIDERS[TRANSCRIBE_PROVIDERS.length - 1]).toBe("nemotron-3-5-transcribe")
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
it("Add Captions keeps its three lanes: no length-priced engine runs inside its flat price", () => {
|
|
75
|
+
expect([...CAPTION_TRANSCRIBE_LANES].sort()).toEqual(["elevenlabs-stt", "incredibly-fast-whisper", "whisper"])
|
|
76
|
+
for (const lane of CAPTION_TRANSCRIBE_LANES) expect(TRANSCRIBE_LANES).toContain(lane)
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
it("the defaults do not move", () => {
|
|
80
|
+
expect(DEFAULT_TRANSCRIBE_PROVIDER).toBe("whisper")
|
|
81
|
+
expect(DEFAULT_TRANSCRIBE_NODE_PROVIDER).toBe("elevenlabs-stt")
|
|
45
82
|
})
|
|
46
83
|
|
|
47
84
|
it("the default lane is itself a lane", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest"
|
|
2
|
-
import { findWordlessTranscriptFeeds, transcribeWordTimestampsRefusal } from "../transcribe-preflight.js"
|
|
2
|
+
import { findWordlessTranscriptFeeds, transcribeTargetLanguageOf, transcribeTranslationRefusal, transcribeWordTimestampsRefusal } from "../transcribe-preflight.js"
|
|
3
3
|
|
|
4
4
|
const n = (id: string, type: string, data: Record<string, unknown> = {}) => ({ id, type, data })
|
|
5
5
|
const e = (source: string, sourceHandle: string, target: string, targetHandle: string) => ({ source, sourceHandle, target, targetHandle })
|
|
@@ -63,3 +63,52 @@ describe("findWordlessTranscriptFeeds", () => {
|
|
|
63
63
|
)).toEqual([])
|
|
64
64
|
})
|
|
65
65
|
})
|
|
66
|
+
|
|
67
|
+
// Nemotron 3.5 Transcribe (2026-11-12): word-capable, and the one engine that
|
|
68
|
+
// translates — never together with word timings (KIE refuses the pair).
|
|
69
|
+
describe("Nemotron 3.5 Transcribe: word timings and translation", () => {
|
|
70
|
+
it("is word-capable, unless it translates", () => {
|
|
71
|
+
expect(transcribeWordTimestampsRefusal("nemotron-3-5-transcribe")).toBeNull()
|
|
72
|
+
expect(transcribeWordTimestampsRefusal("nemotron-3-5-transcribe", "en")).toContain("translation")
|
|
73
|
+
expect(transcribeWordTimestampsRefusal("nemotron-3-5-transcribe", "")).toBeNull()
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
it("refuses a translation on any other engine, naming the one that translates", () => {
|
|
77
|
+
for (const lane of ["elevenlabs-stt", "whisper", "incredibly-fast-whisper"]) {
|
|
78
|
+
const msg = transcribeTranslationRefusal(lane, "en")!
|
|
79
|
+
expect(msg).toContain(`"${lane}"`)
|
|
80
|
+
expect(msg).toContain("nemotron-3-5-transcribe")
|
|
81
|
+
}
|
|
82
|
+
// An absent provider is the NODE default (elevenlabs-stt), which does not translate.
|
|
83
|
+
expect(transcribeTranslationRefusal(undefined, "en")).toContain('"elevenlabs-stt"')
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
it("refuses a language KIE does not translate into, and word timings beside a translation", () => {
|
|
87
|
+
expect(transcribeTranslationRefusal("nemotron-3-5-transcribe", "vi")).toContain('"vi"')
|
|
88
|
+
expect(transcribeTranslationRefusal("nemotron-3-5-transcribe", "en", true)).toContain("word timings")
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
it("passes a valid translation, and no translation at all on any engine", () => {
|
|
92
|
+
expect(transcribeTranslationRefusal("nemotron-3-5-transcribe", "he")).toBeNull()
|
|
93
|
+
expect(transcribeTranslationRefusal("nemotron-3-5-transcribe", "en", false)).toBeNull()
|
|
94
|
+
expect(transcribeTranslationRefusal("whisper", undefined, true)).toBeNull()
|
|
95
|
+
expect(transcribeTranslationRefusal("elevenlabs-stt", "")).toBeNull()
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
it("reads a target language as data carries it", () => {
|
|
99
|
+
expect(transcribeTargetLanguageOf(" en ")).toBe("en")
|
|
100
|
+
expect(transcribeTargetLanguageOf("")).toBeUndefined()
|
|
101
|
+
expect(transcribeTargetLanguageOf(undefined)).toBeUndefined()
|
|
102
|
+
expect(transcribeTargetLanguageOf(3)).toBeUndefined()
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
it("a translating node feeding captions is wordless; a transcribing one is not", () => {
|
|
106
|
+
const nodes = (data: Record<string, unknown>) => [n("t", "transcribe", { provider: "nemotron-3-5-transcribe", ...data }), n("c", "add-captions")]
|
|
107
|
+
const edges = [e("t", "json", "c", "transcript")]
|
|
108
|
+
expect(findWordlessTranscriptFeeds(nodes({}), edges)).toEqual([])
|
|
109
|
+
const hits = findWordlessTranscriptFeeds(nodes({ targetLanguage: "en" }), edges)
|
|
110
|
+
expect(hits).toHaveLength(1)
|
|
111
|
+
expect(hits[0]).toMatchObject({ transcribeNodeId: "t", consumerNodeId: "c", provider: "nemotron-3-5-transcribe" })
|
|
112
|
+
expect(hits[0]!.message).toContain("translation")
|
|
113
|
+
})
|
|
114
|
+
})
|
|
@@ -159,18 +159,34 @@ describe("seedance-2-mini is a full Seedance 2 family member", () => {
|
|
|
159
159
|
})
|
|
160
160
|
|
|
161
161
|
describe("VIDEO_AUDIO_CAPABILITY internal consistency", () => {
|
|
162
|
-
it("every AUDIO_ADDON provider is cost-affecting on the canonical `sound`
|
|
162
|
+
it("every AUDIO_ADDON provider is cost-affecting on the canonical `sound` intent", () => {
|
|
163
163
|
// The billing-critical invariant: the `:audio` surcharge keys off `sound`,
|
|
164
|
-
// so every surcharged model must declare audio, be marked cost-affecting
|
|
165
|
-
//
|
|
166
|
-
//
|
|
167
|
-
//
|
|
164
|
+
// so every surcharged model must declare audio, be marked cost-affecting
|
|
165
|
+
// (applyVideoAudioToggle then reads ONLY `sound` for it and refuses the
|
|
166
|
+
// generateAudio alias), and have a switch to write it to — Kling's wire
|
|
167
|
+
// key is `sound`, PixVerse V6 Max's `generate_audio_switch`. A
|
|
168
|
+
// billed/generated divergence is then structurally impossible.
|
|
168
169
|
for (const m of AUDIO_ADDON_PROVIDERS) {
|
|
169
170
|
const cap = getVideoAudioCapability(m)
|
|
170
171
|
expect(cap.mode, m).not.toBe("none")
|
|
171
|
-
expect(cap.field, m).
|
|
172
|
+
expect(cap.field, m).toBeDefined()
|
|
173
|
+
expect(cap.alwaysOn, m).toBeUndefined()
|
|
172
174
|
expect(cap.affectsCost, m).toBe(true)
|
|
175
|
+
for (const sound of [true, false]) {
|
|
176
|
+
const viaSound: Record<string, unknown> = {}
|
|
177
|
+
applyVideoAudioToggle(viaSound, m, { sound })
|
|
178
|
+
expect(Object.values(viaSound), m).toEqual([sound])
|
|
179
|
+
}
|
|
180
|
+
// The alias turns the switch only on a model that declares it reads it
|
|
181
|
+
// (PixVerse V6 Max) — its price reads the same field (videoAudioIntent).
|
|
182
|
+
const viaAlias: Record<string, unknown> = {}
|
|
183
|
+
applyVideoAudioToggle(viaAlias, m, { generateAudio: true })
|
|
184
|
+
expect(viaAlias, m).toEqual(getVideoAudioCapability(m).readsGenerateAudio ? { generate_audio_switch: true } : {})
|
|
173
185
|
}
|
|
186
|
+
expect(getVideoAudioCapability("kling").field).toBe("sound")
|
|
187
|
+
expect(getVideoAudioCapability("kling-3.0").field).toBe("sound")
|
|
188
|
+
expect(getVideoAudioCapability("kling").readsGenerateAudio).toBeUndefined()
|
|
189
|
+
expect(getVideoAudioCapability("kling-3.0").readsGenerateAudio).toBeUndefined()
|
|
174
190
|
})
|
|
175
191
|
|
|
176
192
|
it("every VEO provider is native_speech", () => {
|
|
@@ -298,3 +314,16 @@ describe("applyVideoAudioToggle — neutral audio intent → per-model KIE field
|
|
|
298
314
|
expect(input.generate_audio).toBe(true)
|
|
299
315
|
})
|
|
300
316
|
})
|
|
317
|
+
|
|
318
|
+
describe("readsGenerateAudio", () => {
|
|
319
|
+
it("is declared only by a cost-affecting model with a switch (today PixVerse V6 Max alone)", () => {
|
|
320
|
+
const declaring = Object.entries(VIDEO_AUDIO_CAPABILITY).filter(([, cap]) => cap.readsGenerateAudio).map(([m]) => m)
|
|
321
|
+
expect(declaring).toEqual(["pixverse-v6-max"])
|
|
322
|
+
for (const m of declaring) {
|
|
323
|
+
const cap = getVideoAudioCapability(m)
|
|
324
|
+
expect(cap.affectsCost, m).toBe(true)
|
|
325
|
+
expect(cap.field, m).toBeDefined()
|
|
326
|
+
expect(AUDIO_ADDON_PROVIDERS.has(m), m).toBe(true)
|
|
327
|
+
}
|
|
328
|
+
})
|
|
329
|
+
})
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A video model whose runner normalizes its resolution lever (Wan 3.0, Vidu Q4,
|
|
3
|
+
* Kling 4.0, PixVerse V6 Max, …) bills — through the very normalizer the runner
|
|
4
|
+
* sends — each of its catalog tiers on the 480p / 720p / 1080p / 4k ladder as
|
|
5
|
+
* that tier. Generate Video Pro offers exactly those tiers (`@nodaro/render-rules`
|
|
6
|
+
* `gvpOfferedResolutions`), so this is what makes each of them render as named.
|
|
7
|
+
*/
|
|
8
|
+
import { describe, it, expect } from "vitest"
|
|
9
|
+
import { MODEL_CATALOG } from "../model-catalog.js"
|
|
10
|
+
import { GVP_SUPPORTED_PROVIDERS, RESOLUTION_DURATION_PRICING } from "../model-constants.js"
|
|
11
|
+
import { buildVideoCreditModelIdentifier } from "../credit-identifiers.js"
|
|
12
|
+
|
|
13
|
+
const LADDER = ["480p", "720p", "1080p", "4k"]
|
|
14
|
+
|
|
15
|
+
describe("a Generate Video Pro model bills each ladder tier of its catalog as named", () => {
|
|
16
|
+
it("holds for every pro model priced by (seconds × resolution)", () => {
|
|
17
|
+
const checked: string[] = []
|
|
18
|
+
for (const p of GVP_SUPPORTED_PROVIDERS) {
|
|
19
|
+
const tiers = RESOLUTION_DURATION_PRICING[p]
|
|
20
|
+
if (!tiers) continue
|
|
21
|
+
for (const r of (MODEL_CATALOG[p]?.resolutions ?? []) as readonly string[]) {
|
|
22
|
+
if (!LADDER.includes(r) || !tiers.includes(r)) continue
|
|
23
|
+
expect(buildVideoCreditModelIdentifier(p, 8, false, "image-to-video", undefined, r, false), `${p} ${r}`).toMatch(new RegExp(`:${r}(?::|-|$)`))
|
|
24
|
+
checked.push(p)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// The families whose runner normalizes are all among them.
|
|
28
|
+
for (const p of ["wan-3", "vidu-q4", "kling-4", "kling-4-flash", "pixverse-v6-max"]) expect(checked, p).toContain(p)
|
|
29
|
+
})
|
|
30
|
+
})
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest"
|
|
2
|
+
import { MODEL_CATALOG } from "../model-catalog.js"
|
|
3
|
+
import { normalizeVideoUpscaleResolution, videoUpscaleModelOf, videoUpscaleResolutionsFor, VIDEO_UPSCALE_RESOLUTIONS } from "../video-upscale-params.js"
|
|
4
|
+
import { normalizeNodeModelParams } from "../normalize-node-params.js"
|
|
5
|
+
import { VIDEO_UPSCALE_PROVIDERS } from "../model-constants.js"
|
|
6
|
+
import { NODARO_VIDEO_UPSCALE_DEFAULT_TIER, NODARO_VIDEO_UPSCALE_TIERS } from "../nodaro-video-upscale.js"
|
|
7
|
+
import { TOPAZ_VIDEO_RESOLUTIONS } from "../topaz-video.js"
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The Video Upscale node's target resolution: held to what its provider takes
|
|
11
|
+
* only for a provider whose catalog entry declares its resolutions — Nodaro
|
|
12
|
+
* Video Upscale's 1080p / 2K / 4K. Topaz keeps its own list (720p / 1080p /
|
|
13
|
+
* 4K, `TOPAZ_VIDEO_RESOLUTIONS`) and every other provider's node is left
|
|
14
|
+
* exactly as it came: its run reads the field by its own rules.
|
|
15
|
+
*/
|
|
16
|
+
describe("Video Upscale target resolution per provider", () => {
|
|
17
|
+
it("only Nodaro Video Upscale's catalog entry declares resolutions; the route's enum covers every provider's", () => {
|
|
18
|
+
expect(videoUpscaleResolutionsFor("nodaro-video-upscale")).toEqual([...NODARO_VIDEO_UPSCALE_TIERS])
|
|
19
|
+
for (const p of ["topaz", undefined, "veo-1080p", "veo-4k", "seedance-2-5-hd"]) {
|
|
20
|
+
expect(videoUpscaleResolutionsFor(p), String(p)).toEqual([])
|
|
21
|
+
}
|
|
22
|
+
expect(MODEL_CATALOG["topaz-video"]).not.toHaveProperty("resolutions")
|
|
23
|
+
expect(MODEL_CATALOG["topaz-video"]).not.toHaveProperty("defaultResolution")
|
|
24
|
+
for (const p of VIDEO_UPSCALE_PROVIDERS) expect(MODEL_CATALOG[videoUpscaleModelOf(p)], p).toBeDefined()
|
|
25
|
+
for (const r of [...TOPAZ_VIDEO_RESOLUTIONS, ...NODARO_VIDEO_UPSCALE_TIERS]) expect(VIDEO_UPSCALE_RESOLUTIONS).toContain(r)
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it("coerces a value Nodaro Video Upscale does not take to its default, and canonicalises its spelling", () => {
|
|
29
|
+
expect(MODEL_CATALOG["nodaro-video-upscale"]!.defaultResolution).toBe(NODARO_VIDEO_UPSCALE_DEFAULT_TIER)
|
|
30
|
+
expect(normalizeVideoUpscaleResolution("nodaro-video-upscale", "720p").targetResolution).toBe("1080p")
|
|
31
|
+
expect(normalizeVideoUpscaleResolution("nodaro-video-upscale", "720p").adjustment?.reason).toMatch(/Nodaro Video Upscale/)
|
|
32
|
+
expect(normalizeVideoUpscaleResolution("nodaro-video-upscale", "2K")).toEqual({ targetResolution: "2k" })
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it("leaves every other provider's value, and an unset value, as it came", () => {
|
|
36
|
+
expect(normalizeVideoUpscaleResolution("topaz", "2k")).toEqual({ targetResolution: "2k" })
|
|
37
|
+
expect(normalizeVideoUpscaleResolution("topaz", "4K")).toEqual({ targetResolution: "4K" })
|
|
38
|
+
expect(normalizeVideoUpscaleResolution(undefined, "2k")).toEqual({ targetResolution: "2k" })
|
|
39
|
+
expect(normalizeVideoUpscaleResolution("veo-4k", "1080p")).toEqual({ targetResolution: "1080p" })
|
|
40
|
+
expect(normalizeVideoUpscaleResolution("nodaro-video-upscale", undefined)).toEqual({ targetResolution: undefined })
|
|
41
|
+
expect(normalizeVideoUpscaleResolution("nodaro-video-upscale", "")).toEqual({ targetResolution: undefined })
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it("a node written straight into workflow JSON: only Nodaro Video Upscale's is healed; Topaz's, VEO's and an unnamed provider's come back as the same node", () => {
|
|
45
|
+
const nodes = [
|
|
46
|
+
// Topaz's spellings and another provider's target: left for its run, which drops what it does not take.
|
|
47
|
+
{ id: "a", type: "video-upscale", data: { provider: "topaz", targetResolution: "4K" } },
|
|
48
|
+
// The old factor path stays: the run reads the factor when the target is not Topaz's.
|
|
49
|
+
{ id: "b", type: "video-upscale", data: { provider: "topaz", targetResolution: "2k", upscaleFactor: "2" } },
|
|
50
|
+
// No provider named: Topaz, left alone.
|
|
51
|
+
{ id: "c", type: "video-upscale", data: { targetResolution: "720P" } },
|
|
52
|
+
{ id: "d", type: "video-upscale", data: { provider: "veo-4k", targetResolution: "2k" } },
|
|
53
|
+
{ id: "e", type: "video-upscale", data: { provider: "nodaro-video-upscale", targetResolution: "720p", label: "E" } },
|
|
54
|
+
{ id: "f", type: "video-upscale", data: { provider: "topaz", targetResolution: "8k", upscaleFactor: "4" } },
|
|
55
|
+
{ id: "g", type: "video-upscale", data: { provider: "topaz", targetResolution: "2k", targetFps: 30 } },
|
|
56
|
+
]
|
|
57
|
+
const { nodes: out, adjustments } = normalizeNodeModelParams(nodes)
|
|
58
|
+
for (const i of [0, 1, 2, 3, 5, 6]) expect(out[i], nodes[i]!.id).toBe(nodes[i])
|
|
59
|
+
expect(out[4]!.data).toEqual({ provider: "nodaro-video-upscale", targetResolution: "1080p", label: "E" })
|
|
60
|
+
expect(adjustments.map((a) => [a.nodeId, a.from, a.to])).toEqual([["e", "720p", "1080p"]])
|
|
61
|
+
})
|
|
62
|
+
})
|
|
@@ -60,6 +60,14 @@ export interface ProjectedCatalogOption {
|
|
|
60
60
|
* large tile stays sharp; `imageUrl` is its 480px member.
|
|
61
61
|
*/
|
|
62
62
|
imageSrcSet?: string
|
|
63
|
+
/**
|
|
64
|
+
* Absolute URL of the option's enlarged picture: the larger version to show
|
|
65
|
+
* where a picker shows the option big (hover, zoom, a detail view). Present
|
|
66
|
+
* only on a deployment that shows its own pictures (`catalogs.images:
|
|
67
|
+
* "own"`) and gave one for this option, on the REST replies; on its media
|
|
68
|
+
* host, like `imageUrl`. Absent otherwise — draw `imageUrl` there instead.
|
|
69
|
+
*/
|
|
70
|
+
imageLargeUrl?: string
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
export interface ProjectedCatalogDimension {
|
|
@@ -82,6 +82,16 @@ export {
|
|
|
82
82
|
semitonesToPitchRatio,
|
|
83
83
|
} from "./pitch-tempo.js"
|
|
84
84
|
|
|
85
|
+
export {
|
|
86
|
+
NEMOTRON_TRANSCRIBE_ID,
|
|
87
|
+
NEMOTRON_TRANSCRIBE_PRICING,
|
|
88
|
+
nemotronTranscribeStartedMinutes,
|
|
89
|
+
nemotronTranscribeCreditId,
|
|
90
|
+
nemotronTranscribeQuoteCreditId,
|
|
91
|
+
parseNemotronTranscribeCreditId,
|
|
92
|
+
nemotronTranscribeBaseCredits,
|
|
93
|
+
} from "./nemotron-transcribe.js"
|
|
94
|
+
|
|
85
95
|
export {
|
|
86
96
|
VIDEO_OVERLAY_PRICING,
|
|
87
97
|
VIDEO_OVERLAY_REMEASURE_SLACK_SEC,
|