@nodaro/shared 3.61.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-4KYLNTR7.cjs → chunk-2PU3AGGS.cjs} +27 -4
- package/dist/chunk-2PU3AGGS.cjs.map +1 -0
- package/dist/{chunk-43TGSZRJ.js → chunk-2QKF7M2Z.js} +3 -3
- package/dist/{chunk-43TGSZRJ.js.map → chunk-2QKF7M2Z.js.map} +1 -1
- package/dist/{chunk-B6BG3LV2.js → chunk-34QLPTSA.js} +3 -3
- package/dist/{chunk-B6BG3LV2.js.map → chunk-34QLPTSA.js.map} +1 -1
- package/dist/chunk-3K24DWOH.js +453 -0
- package/dist/chunk-3K24DWOH.js.map +1 -0
- package/dist/{chunk-IRQ3SPX7.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-MQZRQ5LM.cjs → chunk-63H4C56Q.cjs} +8 -8
- package/dist/{chunk-MQZRQ5LM.cjs.map → chunk-63H4C56Q.cjs.map} +1 -1
- package/dist/{chunk-IVXSNW2B.cjs → chunk-6BZC2ZHC.cjs} +18 -332
- package/dist/chunk-6BZC2ZHC.cjs.map +1 -0
- package/dist/{chunk-M3SXUUWC.cjs → chunk-6FQBKI2A.cjs} +4 -11
- package/dist/chunk-6FQBKI2A.cjs.map +1 -0
- package/dist/{chunk-673E4KYC.js → chunk-6M563QE6.js} +134 -8
- package/dist/chunk-6M563QE6.js.map +1 -0
- package/dist/chunk-6TGB7ECA.cjs +48 -0
- package/dist/chunk-6TGB7ECA.cjs.map +1 -0
- package/dist/{chunk-XUJC6GHE.cjs → chunk-6XUG4L7X.cjs} +6 -6
- package/dist/{chunk-XUJC6GHE.cjs.map → chunk-6XUG4L7X.cjs.map} +1 -1
- package/dist/{chunk-XZKFZMRT.cjs → chunk-77WU3V3J.cjs} +6 -6
- package/dist/{chunk-XZKFZMRT.cjs.map → chunk-77WU3V3J.cjs.map} +1 -1
- package/dist/{chunk-ZFJN23V4.cjs → chunk-A2PX5IRC.cjs} +4 -4
- package/dist/{chunk-ZFJN23V4.cjs.map → chunk-A2PX5IRC.cjs.map} +1 -1
- package/dist/{chunk-ZDBPQBAA.js → chunk-AE3AAJ4O.js} +3 -3
- package/dist/{chunk-ZDBPQBAA.js.map → chunk-AE3AAJ4O.js.map} +1 -1
- package/dist/chunk-ALRXY4QH.cjs +13 -0
- package/dist/chunk-ALRXY4QH.cjs.map +1 -0
- package/dist/{chunk-UARGJ5IZ.js → chunk-BMJVKYVB.js} +56 -12
- package/dist/chunk-BMJVKYVB.js.map +1 -0
- package/dist/{chunk-6XVHYD5R.js → chunk-CLAKSLXF.js} +4 -9
- package/dist/chunk-CLAKSLXF.js.map +1 -0
- package/dist/chunk-CTANEPMY.js +61 -0
- package/dist/chunk-CTANEPMY.js.map +1 -0
- package/dist/chunk-CZ5IQB3L.js +42 -0
- package/dist/chunk-CZ5IQB3L.js.map +1 -0
- package/dist/{chunk-WGKAOUEQ.cjs → chunk-D34K455O.cjs} +3 -2
- package/dist/chunk-D34K455O.cjs.map +1 -0
- package/dist/chunk-EPXGG27L.js +331 -0
- 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-ZNM2LW3D.cjs → chunk-GMBDLNLD.cjs} +105 -56
- package/dist/chunk-GMBDLNLD.cjs.map +1 -0
- package/dist/{chunk-NJVOJXBS.cjs → chunk-GSKLPI3J.cjs} +104 -49
- package/dist/chunk-GSKLPI3J.cjs.map +1 -0
- package/dist/{chunk-EWS2VFO4.js → chunk-HBXF6RUU.js} +4 -4
- package/dist/{chunk-EWS2VFO4.js.map → chunk-HBXF6RUU.js.map} +1 -1
- package/dist/{chunk-MOMFX32D.js → chunk-HWQ2SYNA.js} +194 -325
- package/dist/chunk-HWQ2SYNA.js.map +1 -0
- package/dist/{chunk-SCMTN57Y.js → chunk-IY3Y462W.js} +3 -3
- package/dist/{chunk-SCMTN57Y.js.map → chunk-IY3Y462W.js.map} +1 -1
- package/dist/{chunk-ZZGQRRN7.js → chunk-KCZHQH2O.js} +6 -306
- package/dist/chunk-KCZHQH2O.js.map +1 -0
- package/dist/{chunk-XROE3CAS.cjs → chunk-KHH54GRP.cjs} +120 -79
- package/dist/chunk-KHH54GRP.cjs.map +1 -0
- package/dist/{chunk-FVVD6XY2.js → chunk-KL6GAYTT.js} +13 -4
- package/dist/chunk-KL6GAYTT.js.map +1 -0
- package/dist/{chunk-FVII3KHN.js → chunk-KMGCHV6O.js} +163 -4
- package/dist/chunk-KMGCHV6O.js.map +1 -0
- package/dist/{chunk-FMXFHJWX.cjs → chunk-L2TVY6XN.cjs} +4 -4
- package/dist/{chunk-FMXFHJWX.cjs.map → chunk-L2TVY6XN.cjs.map} +1 -1
- package/dist/{chunk-FQXRYPCX.cjs → chunk-LH72PQO2.cjs} +505 -68
- package/dist/chunk-LH72PQO2.cjs.map +1 -0
- package/dist/chunk-LMAQUR55.cjs +506 -0
- package/dist/chunk-LMAQUR55.cjs.map +1 -0
- package/dist/{chunk-F5YEMSNK.cjs → chunk-M5OCFGHF.cjs} +571 -30
- package/dist/chunk-M5OCFGHF.cjs.map +1 -0
- package/dist/{chunk-VOWJCUMR.js → chunk-MD4XHED4.js} +3 -3
- package/dist/{chunk-VOWJCUMR.js.map → chunk-MD4XHED4.js.map} +1 -1
- package/dist/chunk-N5HH46JF.cjs +68 -0
- package/dist/chunk-N5HH46JF.cjs.map +1 -0
- package/dist/{chunk-G4XWVWRI.js → chunk-NIAFR5EE.js} +5 -4
- 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-SWVGHAYO.js → chunk-O7RZRUMZ.js} +110 -74
- package/dist/chunk-O7RZRUMZ.js.map +1 -0
- package/dist/{chunk-LLOIAGFB.js → chunk-OV3JTKBY.js} +449 -51
- package/dist/chunk-OV3JTKBY.js.map +1 -0
- package/dist/{chunk-A3FHTSLB.js → chunk-PSKZKLDG.js} +550 -31
- package/dist/chunk-PSKZKLDG.js.map +1 -0
- package/dist/{chunk-VB2ARGQ6.js → chunk-RGNHHIMN.js} +3 -3
- package/dist/chunk-RGNHHIMN.js.map +1 -0
- package/dist/chunk-SMOO5FAH.js +10 -0
- package/dist/chunk-SMOO5FAH.js.map +1 -0
- package/dist/{chunk-5XRRENHD.cjs → chunk-TM5JYSJF.cjs} +170 -17
- package/dist/chunk-TM5JYSJF.cjs.map +1 -0
- package/dist/{chunk-PONP5J5E.cjs → chunk-V24EPI5N.cjs} +13 -3
- package/dist/chunk-V24EPI5N.cjs.map +1 -0
- package/dist/{chunk-RQ4F3AJH.cjs → chunk-V5EEQR2U.cjs} +21 -21
- package/dist/{chunk-RQ4F3AJH.cjs.map → chunk-V5EEQR2U.cjs.map} +1 -1
- package/dist/chunk-WZVIBAKN.cjs +351 -0
- 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-RUHKBEFF.js → chunk-XBTYGQ6Z.js} +63 -10
- package/dist/chunk-XBTYGQ6Z.js.map +1 -0
- package/dist/{chunk-JHTT2V4A.cjs → chunk-XGGZWA4A.cjs} +118 -52
- package/dist/chunk-XGGZWA4A.cjs.map +1 -0
- package/dist/{chunk-5I4T4QR5.cjs → chunk-XGVJGNZW.cjs} +5 -5
- package/dist/{chunk-5I4T4QR5.cjs.map → chunk-XGVJGNZW.cjs.map} +1 -1
- package/dist/{chunk-7ARKVJTN.cjs → chunk-Y35JQPT6.cjs} +228 -383
- package/dist/chunk-Y35JQPT6.cjs.map +1 -0
- package/dist/{chunk-AFQFGZN7.cjs → chunk-Y4GCJJPF.cjs} +8 -6
- package/dist/chunk-Y4GCJJPF.cjs.map +1 -0
- package/dist/{chunk-C77F4ZTL.js → chunk-YUER7TJG.js} +3 -3
- package/dist/{chunk-C77F4ZTL.js.map → chunk-YUER7TJG.js.map} +1 -1
- package/dist/{chunk-HGI2VKIV.js → chunk-YX6TFX7H.js} +67 -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 +44 -44
- package/dist/entries/apps.js +9 -9
- package/dist/entries/credits.cjs +286 -153
- package/dist/entries/credits.d.cts +254 -5
- package/dist/entries/credits.d.ts +254 -5
- package/dist/entries/credits.js +14 -9
- package/dist/entries/entities.cjs +188 -143
- package/dist/entries/entities.d.cts +122 -1
- package/dist/entries/entities.d.ts +122 -1
- package/dist/entries/entities.js +2 -1
- package/dist/entries/llm-models.cjs +77 -57
- package/dist/entries/llm-models.d.cts +85 -5
- package/dist/entries/llm-models.d.ts +85 -5
- package/dist/entries/llm-models.js +2 -2
- package/dist/entries/media.cjs +92 -87
- package/dist/entries/media.d.cts +19 -1
- package/dist/entries/media.d.ts +19 -1
- package/dist/entries/media.js +3 -2
- package/dist/entries/model-catalog.cjs +211 -103
- package/dist/entries/model-catalog.d.cts +135 -19
- package/dist/entries/model-catalog.d.ts +135 -19
- package/dist/entries/model-catalog.js +5 -5
- package/dist/entries/models.cjs +504 -295
- package/dist/entries/models.d.cts +71 -4
- package/dist/entries/models.d.ts +71 -4
- package/dist/entries/models.js +7 -6
- package/dist/entries/nodes.cjs +249 -233
- package/dist/entries/nodes.d.cts +35 -6
- package/dist/entries/nodes.d.ts +35 -6
- package/dist/entries/nodes.js +10 -10
- package/dist/entries/pipeline.cjs +152 -152
- package/dist/entries/pipeline.d.cts +3 -2
- package/dist/entries/pipeline.d.ts +3 -2
- 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 +316 -208
- package/dist/entries/video.d.cts +490 -99
- package/dist/entries/video.d.ts +490 -99
- package/dist/entries/video.js +8 -4
- package/dist/entries/workflow.cjs +102 -102
- package/dist/entries/workflow.d.cts +5 -4
- package/dist/entries/workflow.d.ts +5 -4
- package/dist/entries/workflow.js +2 -2
- package/dist/{gpt-image-2-6-BeZdT-pW.d.cts → gpt-image-2-6-jIRQBRag.d.cts} +6 -0
- package/dist/{gpt-image-2-6-BeZdT-pW.d.ts → gpt-image-2-6-jIRQBRag.d.ts} +6 -0
- package/dist/index.cjs +2727 -2092
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +30 -27
- package/dist/{model-catalog-BgSvskgY.d.ts → model-catalog-C_Eo35tL.d.cts} +158 -14
- package/dist/{model-catalog-BgSvskgY.d.cts → model-catalog-C_Eo35tL.d.ts} +158 -14
- package/dist/{model-constants-DHd9jwQ7.d.cts → model-constants-Bg4ccSQb.d.ts} +427 -34
- package/dist/{model-constants-DHd9jwQ7.d.ts → model-constants-DWcxOmaY.d.cts} +427 -34
- package/package.json +1 -1
- package/src/__tests__/credit-identifiers.test.ts +29 -0
- package/src/__tests__/extend-providers.test.ts +194 -0
- package/src/__tests__/fixtures/mask-composite-quote-parity.json +118 -0
- package/src/__tests__/fixtures/root-exports.baseline.json +68 -0
- package/src/__tests__/gpt-image-2-6-formats.test.ts +4 -1
- package/src/__tests__/grok-video-15-catalog.test.ts +189 -0
- package/src/__tests__/gvp-supported-providers.test.ts +32 -4
- 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__/minimax-h3-image.test.ts +140 -0
- package/src/__tests__/model-makers.test.ts +49 -11
- package/src/__tests__/model-tree.test.ts +13 -0
- 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__/retired-video-provider.test.ts +15 -5
- package/src/__tests__/seedance-25-catalog-modes.test.ts +1 -1
- package/src/__tests__/seedance-task-type.test.ts +188 -0
- package/src/__tests__/seedream-5-5.test.ts +117 -0
- package/src/__tests__/transcribe-capabilities.test.ts +39 -2
- package/src/__tests__/transcribe-preflight.test.ts +50 -1
- package/src/__tests__/unit-contract-compose.test.ts +27 -1
- package/src/__tests__/unit-contracts.test.ts +20 -6
- package/src/__tests__/upscale-factors.test.ts +107 -0
- package/src/__tests__/video-audio-capability.test.ts +35 -6
- package/src/__tests__/video-character-refs.test.ts +20 -2
- package/src/__tests__/video-collapse-parity.test.ts +19 -0
- package/src/__tests__/video-overlay-geometry.test.ts +68 -0
- package/src/__tests__/video-overlay-layer-plan.test.ts +3 -4
- package/src/__tests__/video-overlay-layouts.test.ts +529 -0
- package/src/__tests__/video-overlay-pricing.test.ts +61 -0
- package/src/__tests__/video-overlay-validate.test.ts +128 -0
- package/src/__tests__/video-overlay-wired-kind.test.ts +207 -0
- package/src/__tests__/video-overlay.test.ts +280 -194
- package/src/__tests__/video-ref-limits.test.ts +2 -1
- package/src/__tests__/video-reference-only.test.ts +6 -2
- package/src/__tests__/video-resolution-billed-as-named.test.ts +30 -0
- package/src/__tests__/video-start-frame-only.test.ts +98 -0
- package/src/__tests__/video-upscale-params.test.ts +62 -0
- package/src/__tests__/wired-character-names.test.ts +220 -0
- package/src/catalog-projection.ts +8 -0
- package/src/credit-estimators/index.ts +18 -0
- package/src/credit-estimators/nemotron-transcribe.ts +87 -0
- package/src/credit-estimators/video-overlay.ts +70 -0
- package/src/credit-identifiers.ts +183 -16
- package/src/entity-image-url.ts +21 -0
- package/src/entries/credits.ts +26 -1
- package/src/entries/entities.ts +14 -0
- package/src/entries/llm-models.ts +6 -0
- package/src/entries/model-catalog.ts +44 -1
- package/src/entries/models.ts +69 -0
- package/src/entries/nodes.ts +4 -0
- package/src/entries/video.ts +7 -1
- package/src/freecut-protocol.ts +8 -0
- package/src/generated/unit-contracts.ts +8 -1
- package/src/gpt-image-2-6.ts +6 -0
- package/src/input-image-pricing.ts +76 -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/mask-composite.ts +11 -0
- package/src/minimax-h3-image.ts +61 -0
- package/src/model-catalog.ts +604 -40
- package/src/model-constants.ts +860 -55
- package/src/model-tree.ts +2 -1
- package/src/nodaro-video-upscale.ts +48 -0
- package/src/node-default-mappings.ts +15 -2
- package/src/node-execution-state.ts +4 -3
- package/src/normalize-node-params.ts +49 -1
- package/src/producer-types.ts +23 -1
- package/src/runtime-config/contract.ts +10 -7
- package/src/seedance-draft.ts +2 -1
- package/src/seedance-task-type.ts +37 -0
- package/src/seedream-5-5.ts +45 -0
- package/src/transcribe-preflight.ts +58 -7
- package/src/unit-contract-compose.ts +4 -1
- package/src/upscale-factors.ts +111 -0
- package/src/video-character-refs.ts +7 -4
- package/src/video-duration.ts +9 -0
- package/src/video-overlay-geometry.ts +99 -0
- package/src/video-overlay-input.ts +25 -0
- package/src/video-overlay-layout-ids.ts +48 -0
- package/src/video-overlay-layouts.ts +315 -0
- package/src/video-overlay-validate.ts +223 -0
- package/src/video-overlay-video-layers.ts +304 -0
- package/src/video-overlay.ts +165 -297
- package/src/video-ui-defaults.ts +11 -7
- package/src/video-upscale-params.ts +67 -0
- package/src/wired-character-names.ts +202 -0
- package/dist/chunk-3M4BNKFJ.cjs.map +0 -1
- package/dist/chunk-4KYLNTR7.cjs.map +0 -1
- package/dist/chunk-5XRRENHD.cjs.map +0 -1
- package/dist/chunk-673E4KYC.js.map +0 -1
- package/dist/chunk-6XVHYD5R.js.map +0 -1
- package/dist/chunk-7ARKVJTN.cjs.map +0 -1
- package/dist/chunk-7WGKP3EU.js +0 -23
- package/dist/chunk-7WGKP3EU.js.map +0 -1
- package/dist/chunk-A3FHTSLB.js.map +0 -1
- package/dist/chunk-AFQFGZN7.cjs.map +0 -1
- package/dist/chunk-F5YEMSNK.cjs.map +0 -1
- package/dist/chunk-FQXRYPCX.cjs.map +0 -1
- package/dist/chunk-FVII3KHN.js.map +0 -1
- package/dist/chunk-FVVD6XY2.js.map +0 -1
- package/dist/chunk-G4XWVWRI.js.map +0 -1
- package/dist/chunk-HGI2VKIV.js.map +0 -1
- package/dist/chunk-IRQ3SPX7.js.map +0 -1
- package/dist/chunk-IVXSNW2B.cjs.map +0 -1
- package/dist/chunk-JHTT2V4A.cjs.map +0 -1
- package/dist/chunk-KHZAQGRP.js +0 -17
- package/dist/chunk-KHZAQGRP.js.map +0 -1
- package/dist/chunk-LLOIAGFB.js.map +0 -1
- package/dist/chunk-M3SXUUWC.cjs.map +0 -1
- package/dist/chunk-MOMFX32D.js.map +0 -1
- package/dist/chunk-NCOGGRRP.cjs +0 -27
- package/dist/chunk-NCOGGRRP.cjs.map +0 -1
- package/dist/chunk-NJVOJXBS.cjs.map +0 -1
- package/dist/chunk-PONP5J5E.cjs.map +0 -1
- package/dist/chunk-RUHKBEFF.js.map +0 -1
- package/dist/chunk-SWVGHAYO.js.map +0 -1
- package/dist/chunk-UARGJ5IZ.js.map +0 -1
- package/dist/chunk-VB2ARGQ6.js.map +0 -1
- package/dist/chunk-WGKAOUEQ.cjs.map +0 -1
- package/dist/chunk-XROE3CAS.cjs.map +0 -1
- package/dist/chunk-ZLDFPVVI.cjs +0 -19
- package/dist/chunk-ZLDFPVVI.cjs.map +0 -1
- package/dist/chunk-ZNM2LW3D.cjs.map +0 -1
- package/dist/chunk-ZZGQRRN7.js.map +0 -1
package/src/model-tree.ts
CHANGED
|
@@ -74,7 +74,8 @@ const MODE_TO_NODE: Readonly<Partial<Record<ModelMode, string>>> = {
|
|
|
74
74
|
|
|
75
75
|
export function modelToNodeTarget(modelId: string): ModelNodeTarget | null {
|
|
76
76
|
const entry = MODEL_CATALOG[modelId]
|
|
77
|
-
|
|
77
|
+
// A model the platform runs on its own creates no node (`pickerHidden`).
|
|
78
|
+
if (!entry || entry.pickerHidden === true) return null
|
|
78
79
|
// Resolve the target node: a valid provider-enum value wins, else the catalog's modes.
|
|
79
80
|
const enumMatch = ENUM_TARGETS.find(([providers]) => providers.includes(modelId))
|
|
80
81
|
const nodeType = enumMatch?.[1] ?? entry.modes.map((m) => MODE_TO_NODE[m]).find(Boolean)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nodaro Video Upscale — the Video Upscale node's `nodaro-video-upscale`
|
|
3
|
+
* provider (decided 2026-11-11): what a caller may ask for and what the
|
|
4
|
+
* platform accepts. The pricing rule lives in `@nodaro/render-rules`
|
|
5
|
+
* (`nodaro-video-upscale-pricing.ts`). It is offered under the deployment's
|
|
6
|
+
* own label (`ownLabel` in the catalog), and only where the deployment serves
|
|
7
|
+
* it (the backend's house-model seam).
|
|
8
|
+
*
|
|
9
|
+
* A tier is an output BOX, not a short side: the clip is fitted into
|
|
10
|
+
* 1920×1080, 2560×1440 or 3840×2160 (the box turned for a portrait clip),
|
|
11
|
+
* never cropped, at its own frame rate, length and audio. It has no frame-rate
|
|
12
|
+
* setting and no 720p tier — Topaz has both.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export const NODARO_VIDEO_UPSCALE_PROVIDER = "nodaro-video-upscale" as const
|
|
16
|
+
|
|
17
|
+
/** The output tiers, cheapest first. */
|
|
18
|
+
export const NODARO_VIDEO_UPSCALE_TIERS = ["1080p", "2k", "4k"] as const
|
|
19
|
+
export type NodaroVideoUpscaleTier = (typeof NODARO_VIDEO_UPSCALE_TIERS)[number]
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The tier a request that names none runs at — the cheapest, as Topaz's
|
|
23
|
+
* default is its 1080p (decided 2026-11-11 by the build; the catalog entry's
|
|
24
|
+
* `defaultResolution` says the same, so the normalizer snaps to it).
|
|
25
|
+
*/
|
|
26
|
+
export const NODARO_VIDEO_UPSCALE_DEFAULT_TIER: NodaroVideoUpscaleTier = "1080p"
|
|
27
|
+
|
|
28
|
+
/** The landscape output box of each tier (a portrait clip gets it turned). */
|
|
29
|
+
export const NODARO_VIDEO_UPSCALE_BOX: Readonly<Record<NodaroVideoUpscaleTier, { readonly width: number; readonly height: number }>> = {
|
|
30
|
+
"1080p": { width: 1920, height: 1080 },
|
|
31
|
+
"2k": { width: 2560, height: 1440 },
|
|
32
|
+
"4k": { width: 3840, height: 2160 },
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** The longest clip accepted, in seconds. A longer one is refused before anything is held. */
|
|
36
|
+
export const NODARO_VIDEO_UPSCALE_MAX_SEC = 60
|
|
37
|
+
|
|
38
|
+
/** The largest clip accepted, in bytes (50 MB, decimal). A larger one is refused before anything is held. */
|
|
39
|
+
export const NODARO_VIDEO_UPSCALE_MAX_BYTES = 50_000_000
|
|
40
|
+
|
|
41
|
+
export function isNodaroVideoUpscaleTier(v: unknown): v is NodaroVideoUpscaleTier {
|
|
42
|
+
return typeof v === "string" && (NODARO_VIDEO_UPSCALE_TIERS as readonly string[]).includes(v)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Is this Video Upscale `provider` value the Nodaro Video Upscale provider? */
|
|
46
|
+
export function isNodaroVideoUpscaleProvider(provider: unknown): provider is typeof NODARO_VIDEO_UPSCALE_PROVIDER {
|
|
47
|
+
return provider === NODARO_VIDEO_UPSCALE_PROVIDER
|
|
48
|
+
}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
VOICE_DESIGN_MODELS,
|
|
12
12
|
} from "./model-constants.js"
|
|
13
13
|
import { LLM_MODEL_IDS } from "./llm-models.js"
|
|
14
|
+
import { SEEDREAM_5_5_DEFAULT_RESOLUTION } from "./seedream-5-5.js"
|
|
14
15
|
|
|
15
16
|
// ──────────────────────────────────────────────────────────────────────────
|
|
16
17
|
// Types
|
|
@@ -188,6 +189,13 @@ const QUALITY_MAP: Record<string, QualityMapping> = {
|
|
|
188
189
|
// Seedream 5 Flash's lever is size (sent as KIE `size`), flat-priced — resolution-style.
|
|
189
190
|
"seedream-5-flash": { field: "resolution", values: { low: "1K", mid: "2K", high: "2K" } },
|
|
190
191
|
"seedream-5-flash-i2i": { field: "resolution", values: { low: "1K", mid: "2K", high: "2K" } },
|
|
192
|
+
// MiniMax H3 Image: 1K and 2K cost the same, 2K is its default.
|
|
193
|
+
"minimax-h3-image": { field: "resolution", values: { low: "1K", mid: "2K", high: "4K" } },
|
|
194
|
+
"minimax-h3-image-i2i": { field: "resolution", values: { low: "1K", mid: "2K", high: "4K" } },
|
|
195
|
+
// Seedream 5.5's lever is its size too (KIE `size`): mid is its default, 2K;
|
|
196
|
+
// low the cheapest, 1K (1.5K costs the same, and is the panel's to pick).
|
|
197
|
+
"seedream-5-5": { field: "resolution", values: { low: "1K", mid: SEEDREAM_5_5_DEFAULT_RESOLUTION, high: "2K" } },
|
|
198
|
+
"seedream-5-5-i2i": { field: "resolution", values: { low: "1K", mid: SEEDREAM_5_5_DEFAULT_RESOLUTION, high: "2K" } },
|
|
191
199
|
// Video gen — resolution-style (720p/1080p)
|
|
192
200
|
"veo3": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
|
|
193
201
|
"veo3.1": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
|
|
@@ -209,6 +217,8 @@ const QUALITY_MAP: Record<string, QualityMapping> = {
|
|
|
209
217
|
// Kling 4.0 — two tiers on both endpoints.
|
|
210
218
|
"kling-4": { field: "resolution", values: { low: "720p", mid: "720p", high: "1080p" } },
|
|
211
219
|
"kling-4-keyframes": { field: "resolution", values: { low: "720p", mid: "720p", high: "1080p" } },
|
|
220
|
+
// Kling 4.0 Flash — 720p only, so every level lands on it.
|
|
221
|
+
"kling-4-flash": { field: "resolution", values: { low: "720p", mid: "720p", high: "720p" } },
|
|
212
222
|
"wan-2.7-i2v": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
|
|
213
223
|
"wan-2.7-t2v": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
|
|
214
224
|
"happyhorse": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
|
|
@@ -224,8 +234,11 @@ const QUALITY_MAP: Record<string, QualityMapping> = {
|
|
|
224
234
|
"gemini-omni-video": { field: "resolution", values: { low: "720p", mid: "1080p", high: "4k" } },
|
|
225
235
|
"gemini-omni-flash": { field: "resolution", values: { low: "720p", mid: "1080p", high: "4k" } },
|
|
226
236
|
"gemini-omni-flash-1-2": { field: "resolution", values: { low: "720p", mid: "1080p", high: "4k" } },
|
|
227
|
-
// Grok Imagine Video 1.5 —
|
|
228
|
-
"grok-imagine-video-1.5": { field: "resolution", values: { low: "480p", mid: "720p", high: "
|
|
237
|
+
// Grok Imagine Video 1.5 — 480p / 720p / 1080p, each quality rung its own tier.
|
|
238
|
+
"grok-imagine-video-1.5": { field: "resolution", values: { low: "480p", mid: "720p", high: "1080p" } },
|
|
239
|
+
// PixVerse V6 Max — four tiers; "low" stops at 540p (360p is a preview tier,
|
|
240
|
+
// as on Gemini Omni Flash 1.2) and "mid" is its declared 720p default.
|
|
241
|
+
"pixverse-v6-max": { field: "resolution", values: { low: "540p", mid: "720p", high: "1080p" } },
|
|
229
242
|
// Replicate Flux 2 family — MP-based resolution (matching IMAGE_RESOLUTION_OPTIONS["flux-2-*"]).
|
|
230
243
|
// `field: "resolution"` is mandatory — see Provider Enum Sync pitfall 4.
|
|
231
244
|
// mid = provider default: 1 MP for Klein, 2 MP for Pro/Max.
|
|
@@ -94,9 +94,10 @@ export interface NodeExecutionStateWire<TOutput = Record<string, unknown>> {
|
|
|
94
94
|
* `error_detail`), with links cut to their host and secrets removed; absent
|
|
95
95
|
* when the failure had no provider text (a platform refusal, a timeout).
|
|
96
96
|
* Display-only, beside `error`: branch on `errorCode` or the hint, never on
|
|
97
|
-
* these words.
|
|
98
|
-
*
|
|
99
|
-
* words for
|
|
97
|
+
* these words. Only a reader who can open the workflow the run executed
|
|
98
|
+
* receives it — never a published app's runner, nor a person running
|
|
99
|
+
* someone else's share link — and on a deployment that keeps these words for
|
|
100
|
+
* its administrators, no reader who is not one.
|
|
100
101
|
*/
|
|
101
102
|
errorDetail?: string | null
|
|
102
103
|
/**
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
import { autoAspectNeedsSourceImage, normalizeModelInput, type ModelInputAdjustment } from "./model-catalog.js"
|
|
24
|
-
import { imageGenAutoAspectNeedsSourceImage } from "./credit-identifiers.js"
|
|
24
|
+
import { imageGenAutoAspectNeedsSourceImage, motionTransferResolution } from "./credit-identifiers.js"
|
|
25
|
+
import { normalizeVideoUpscaleResolution, VIDEO_UPSCALE_RESOLUTIONS, videoUpscaleResolutionsFor } from "./video-upscale-params.js"
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* Node types whose `data` carries catalog-governed model parameters under the
|
|
@@ -140,6 +141,8 @@ export function normalizeNodeModelParams<T extends NodeLike>(
|
|
|
140
141
|
const adjustments: NodeParamAdjustment[] = []
|
|
141
142
|
const out = nodes.map((node) => {
|
|
142
143
|
const type = typeof node.type === "string" ? node.type : ""
|
|
144
|
+
if (type === "video-upscale") return normalizeVideoUpscaleNode(node, adjustments)
|
|
145
|
+
if (type === "motion-transfer") return normalizeMotionTransferNode(node, adjustments)
|
|
143
146
|
if (!MODEL_PARAM_NODE_TYPES.has(type)) return node
|
|
144
147
|
|
|
145
148
|
const data = node.data
|
|
@@ -199,6 +202,51 @@ export function normalizeNodeModelParams<T extends NodeLike>(
|
|
|
199
202
|
return { nodes: out, adjustments }
|
|
200
203
|
}
|
|
201
204
|
|
|
205
|
+
/**
|
|
206
|
+
* A Video Upscale node: its `targetResolution` held to what its provider takes,
|
|
207
|
+
* only for a provider whose catalog entry declares its resolutions
|
|
208
|
+
* (`normalizeVideoUpscaleResolution`; today Nodaro Video Upscale's 1080p / 2K /
|
|
209
|
+
* 4K). Every other provider's node — Topaz's, VEO's, Seedance HD's — is
|
|
210
|
+
* returned as it came: its run reads the field by its own rules. Only that one
|
|
211
|
+
* key is rewritten, and only when it holds a value some Video Upscale provider
|
|
212
|
+
* takes (`VIDEO_UPSCALE_RESOLUTIONS`, spelled any way); an unset value and any
|
|
213
|
+
* other value are left alone.
|
|
214
|
+
*/
|
|
215
|
+
function normalizeVideoUpscaleNode<T extends NodeLike>(node: T, adjustments: NodeParamAdjustment[]): T {
|
|
216
|
+
const data = node.data
|
|
217
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) return node
|
|
218
|
+
const d = data as Record<string, unknown>
|
|
219
|
+
if (typeof d.targetResolution !== "string" || d.targetResolution === "") return node
|
|
220
|
+
const provider = typeof d.provider === "string" && d.provider !== "" ? d.provider : "topaz"
|
|
221
|
+
if (videoUpscaleResolutionsFor(provider).length === 0) return node
|
|
222
|
+
const asked = d.targetResolution.trim().toLowerCase()
|
|
223
|
+
if (!(VIDEO_UPSCALE_RESOLUTIONS as readonly string[]).includes(asked)) return node
|
|
224
|
+
const normalized = normalizeVideoUpscaleResolution(provider, d.targetResolution)
|
|
225
|
+
if (normalized.targetResolution === d.targetResolution) return node
|
|
226
|
+
const nodeId = typeof node.id === "string" ? node.id : "(unknown node)"
|
|
227
|
+
if (normalized.adjustment) adjustments.push({ ...normalized.adjustment, nodeId, provider })
|
|
228
|
+
return { ...node, data: { ...d, targetResolution: normalized.targetResolution } }
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* A Motion Transfer node: its `resolution` held to the size its model runs at
|
|
233
|
+
* (`motionTransferResolution`: a Wan Animate node at 1080p runs as 720p), the
|
|
234
|
+
* same rule its run is sent and charged by. Only that key is rewritten, and
|
|
235
|
+
* only when the rule moves it; an unset size is left for the run's default.
|
|
236
|
+
*/
|
|
237
|
+
function normalizeMotionTransferNode<T extends NodeLike>(node: T, adjustments: NodeParamAdjustment[]): T {
|
|
238
|
+
const data = node.data
|
|
239
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) return node
|
|
240
|
+
const d = data as Record<string, unknown>
|
|
241
|
+
if (typeof d.resolution !== "string" || d.resolution === "") return node
|
|
242
|
+
const provider = typeof d.provider === "string" && d.provider !== "" ? d.provider : "kling"
|
|
243
|
+
const sized = motionTransferResolution(provider, d.resolution)
|
|
244
|
+
if (sized.resolution === d.resolution) return node
|
|
245
|
+
const nodeId = typeof node.id === "string" ? node.id : "(unknown node)"
|
|
246
|
+
for (const adj of sized.adjustments) adjustments.push({ ...adj, nodeId, provider })
|
|
247
|
+
return { ...node, data: { ...d, resolution: sized.resolution } }
|
|
248
|
+
}
|
|
249
|
+
|
|
202
250
|
/** One-line-per-change summary, for surfacing back to an agent or a log. */
|
|
203
251
|
export function describeNodeAdjustments(adjustments: readonly NodeParamAdjustment[]): string[] {
|
|
204
252
|
return adjustments.map(
|
package/src/producer-types.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* execution time (the prior drift bug, see issue 1 of the Task 4.1 review).
|
|
16
16
|
*/
|
|
17
17
|
import { UGC_PRIMARY_HANDLE } from "./ugc-node-wires.js"
|
|
18
|
-
import { composeUnitRecord, composeUnitSet, unitFanOutEach, unitProducers } from "./unit-contract-compose.js"
|
|
18
|
+
import { composeUnitRecord, composeUnitSet, unitFanOutEach, unitListPips, unitProducers } from "./unit-contract-compose.js"
|
|
19
19
|
|
|
20
20
|
// Each producer set below is its hand-written members ∪ the node units
|
|
21
21
|
// (tools/units/README.md) of that producer kind, from their generated contract
|
|
@@ -358,6 +358,27 @@ export function ownsItsList(nodeType: string | null | undefined): boolean {
|
|
|
358
358
|
return typeof nodeType === "string" && OWN_LIST_NODE_TYPES.has(nodeType)
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
+
/**
|
|
362
|
+
* The output pips that carry the LIST one run produced — several files on one
|
|
363
|
+
* pip (a node unit's `handles.outputs[].list`: each layer of a split image). An
|
|
364
|
+
* edge leaving one runs the next node once per item by default ("each"); a
|
|
365
|
+
* Bundle hands the whole list to a node that takes several. Unlike
|
|
366
|
+
* FAN_OUT_EACH_HANDLES, the list is what ONE run made on that pip, never the
|
|
367
|
+
* node's per-iteration results. An edge naming no pip reads the node's primary
|
|
368
|
+
* output, which is never a list pip (tools/units/json-output-rules.mjs).
|
|
369
|
+
* Node units only (generated/unit-contracts.ts UNIT_LIST_PIPS).
|
|
370
|
+
*/
|
|
371
|
+
export const LIST_OUTPUT_HANDLES: Readonly<Record<string, readonly string[]>> = composeUnitRecord("LIST_OUTPUT_HANDLES", {}, unitListPips())
|
|
372
|
+
|
|
373
|
+
/** Whether an edge leaving `sourceHandle` of a `sourceType` node carries a list one run produced (LIST_OUTPUT_HANDLES). */
|
|
374
|
+
export function isListOutputHandle(
|
|
375
|
+
sourceType: string | null | undefined,
|
|
376
|
+
sourceHandle: string | null | undefined,
|
|
377
|
+
): boolean {
|
|
378
|
+
if (typeof sourceType !== "string" || typeof sourceHandle !== "string" || !Object.hasOwn(LIST_OUTPUT_HANDLES, sourceType)) return false
|
|
379
|
+
return LIST_OUTPUT_HANDLES[sourceType]!.includes(sourceHandle)
|
|
380
|
+
}
|
|
381
|
+
|
|
361
382
|
/** The `outputMode` an edge has when none is set on it — the ONE rule both
|
|
362
383
|
* engines, the credit estimate and the editor read. */
|
|
363
384
|
export function defaultEdgeOutputMode(
|
|
@@ -366,6 +387,7 @@ export function defaultEdgeOutputMode(
|
|
|
366
387
|
): "each" | "last" {
|
|
367
388
|
if (typeof sourceType !== "string") return "last"
|
|
368
389
|
if (FAN_OUT_EACH_TYPES.has(sourceType)) return "each"
|
|
390
|
+
if (isListOutputHandle(sourceType, sourceHandle)) return "each"
|
|
369
391
|
const entry = FAN_OUT_EACH_HANDLES[sourceType]
|
|
370
392
|
if (!entry) return "last"
|
|
371
393
|
return entry.each.includes(sourceHandle || entry.primary) ? "each" : "last"
|
|
@@ -142,17 +142,20 @@ export interface NodaroRuntimeConfig {
|
|
|
142
142
|
*/
|
|
143
143
|
readonly mediaOrigin?: string
|
|
144
144
|
/**
|
|
145
|
-
* The https origin the app's
|
|
146
|
-
* them
|
|
147
|
-
*
|
|
145
|
+
* The https origin of the app's pages' own host, when this deployment gives
|
|
146
|
+
* them one. Alone (with `linkOrigin`), every host keeps serving the pages
|
|
147
|
+
* and only a browser's saved settings carry over to it. With
|
|
148
|
+
* `legacyUiHosts` too, the pages have moved there, and a page on it calls
|
|
149
|
+
* the API same-origin. Absent: the deployment has one host.
|
|
148
150
|
*/
|
|
149
151
|
readonly flowUiOrigin?: string
|
|
150
|
-
/** The hosts the app's pages moved away from (with `flowUiOrigin`): a navigation on one goes to the page's home. */
|
|
152
|
+
/** The hosts the app's pages moved away from (with `flowUiOrigin`): a navigation on one goes to the page's home. Absent: nothing moved. */
|
|
151
153
|
readonly legacyUiHosts?: readonly string[]
|
|
152
154
|
/**
|
|
153
|
-
* The https origin
|
|
154
|
-
*
|
|
155
|
-
*
|
|
155
|
+
* The https origin the API keeps, with `flowUiOrigin`: where a browser's
|
|
156
|
+
* saved settings are carried over from and, once the pages have moved
|
|
157
|
+
* (`legacyUiHosts`), the origin developer-facing links name (published
|
|
158
|
+
* apps, embeds, API examples). Absent: the page's own origin, as ever.
|
|
156
159
|
*/
|
|
157
160
|
readonly linkOrigin?: string
|
|
158
161
|
}
|
package/src/seedance-draft.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* Every surface (generation routes, the workflow engine, MCP, the editor's
|
|
14
14
|
* toggle) gates on {@link isSeedanceDraftCapable}; never hand-list the model.
|
|
15
15
|
*/
|
|
16
|
+
import { CONTAINER_OVERHANG_SEC } from "./video-duration.js"
|
|
16
17
|
|
|
17
18
|
/** Models that accept the draft flag. */
|
|
18
19
|
export const SEEDANCE_DRAFT_MODELS = ["seedance-2-5"] as const
|
|
@@ -43,7 +44,7 @@ export const SEEDANCE_DRAFT_FINALIZE_MAX_SEC = 30
|
|
|
43
44
|
* auto-duration settlement uses — and land on the seeded ladder (4–30 s).
|
|
44
45
|
*/
|
|
45
46
|
export function seedanceDraftFinalizeBillableSec(measuredSec: number): number {
|
|
46
|
-
const whole = Math.max(1, Math.ceil(measuredSec -
|
|
47
|
+
const whole = Math.max(1, Math.ceil(measuredSec - CONTAINER_OVERHANG_SEC))
|
|
47
48
|
return Math.min(SEEDANCE_DRAFT_FINALIZE_MAX_SEC, Math.max(SEEDANCE_DRAFT_FINALIZE_MIN_SEC, whole))
|
|
48
49
|
}
|
|
49
50
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seedance 2.5 reference task type — what a request's reference media is FOR.
|
|
3
|
+
*
|
|
4
|
+
* The provider takes an optional declaration of the job a run's references do:
|
|
5
|
+
* - `reference` — the media guides a new clip (look, subject, motion);
|
|
6
|
+
* - `edit` — the clip is an edit of the reference video, in its own shape
|
|
7
|
+
* and length;
|
|
8
|
+
* - `extend` — the clip continues the reference video.
|
|
9
|
+
* Without one the provider guesses from the prompt. `auto` is the platform's
|
|
10
|
+
* spelling of "declare nothing": the provider keeps guessing.
|
|
11
|
+
*
|
|
12
|
+
* Which models take the declaration is a catalog capability
|
|
13
|
+
* (`MODEL_CATALOG[id].referenceTaskTypes`), read through
|
|
14
|
+
* `supportsReferenceTaskType`; whether a given request declares one, and the
|
|
15
|
+
* aspect ratio and length that forces, is decided in one place by
|
|
16
|
+
* `resolveSeedanceTaskType` (both in `model-constants.ts`). Never hand-list the
|
|
17
|
+
* model.
|
|
18
|
+
*
|
|
19
|
+
* Import-free on purpose: the catalog (`model-catalog.ts`) and the constants
|
|
20
|
+
* module (`model-constants.ts`, which imports the catalog) both read it. The
|
|
21
|
+
* resolver itself lives in `model-constants.ts` because it needs
|
|
22
|
+
* `videoDefaultDurationSec` from there.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/** Every value a request may carry, `auto` (declare nothing) first. */
|
|
26
|
+
export const SEEDANCE_REFERENCE_TASK_TYPES = ["auto", "reference", "edit", "extend"] as const
|
|
27
|
+
export type SeedanceReferenceTaskType = typeof SEEDANCE_REFERENCE_TASK_TYPES[number]
|
|
28
|
+
|
|
29
|
+
/** A value that is actually sent to the provider. */
|
|
30
|
+
export type DeclaredSeedanceTaskType = Exclude<SeedanceReferenceTaskType, "auto">
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The reference-video length (seconds, inclusive) an `edit` declaration
|
|
34
|
+
* accepts. Every reference video must be measured and inside it; otherwise
|
|
35
|
+
* nothing is declared.
|
|
36
|
+
*/
|
|
37
|
+
export const SEEDANCE_EDIT_REF_VIDEO_SEC = { min: 4, max: 30 } as const
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What makes Seedream 5.5 price differently from the other Seedream models: its
|
|
3
|
+
* size (1K, 1.5K or 2K), and on an edit the number of input images as well.
|
|
4
|
+
*
|
|
5
|
+
* Only the ids and levers live in this published package. The rates and the
|
|
6
|
+
* formula are `backend/src/ee/billing/seedream-5-5-pricing.ts`.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export const SEEDREAM_5_5_T2I = "seedream-5-5"
|
|
10
|
+
export const SEEDREAM_5_5_I2I = "seedream-5-5-i2i"
|
|
11
|
+
export type Seedream55Model = typeof SEEDREAM_5_5_T2I | typeof SEEDREAM_5_5_I2I
|
|
12
|
+
|
|
13
|
+
/** The sizes it renders, smallest first; the provider names the field `size`. */
|
|
14
|
+
export const SEEDREAM_5_5_RESOLUTIONS = ["1K", "1.5K", "2K"] as const
|
|
15
|
+
export type Seedream55Resolution = (typeof SEEDREAM_5_5_RESOLUTIONS)[number]
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The size a run renders when it names none: the provider's own default, and
|
|
19
|
+
* the size an unset or unknown value is priced and sent at. Every place that
|
|
20
|
+
* fills an unset size for this model reads it from here.
|
|
21
|
+
*/
|
|
22
|
+
export const SEEDREAM_5_5_DEFAULT_RESOLUTION: Seedream55Resolution = "2K"
|
|
23
|
+
|
|
24
|
+
/** The most input images an edit takes, and is priced for (`REF_IMAGE_MAX_LIMITS`). */
|
|
25
|
+
export const SEEDREAM_5_5_MAX_INPUT_IMAGES = 10
|
|
26
|
+
|
|
27
|
+
/** The fewest characters a prompt may have: the provider refuses a shorter one. */
|
|
28
|
+
export const SEEDREAM_5_5_MIN_PROMPT_CHARS = 5
|
|
29
|
+
|
|
30
|
+
export function isSeedream55I2i(model: unknown): boolean {
|
|
31
|
+
return model === SEEDREAM_5_5_I2I
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function isSeedream55(model: unknown): model is Seedream55Model {
|
|
35
|
+
return model === SEEDREAM_5_5_T2I || model === SEEDREAM_5_5_I2I
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The size a Seedream 5.5 run is priced and sent at: the one asked for when it
|
|
40
|
+
* is one of its sizes (any case), else the default. Unset is the default.
|
|
41
|
+
*/
|
|
42
|
+
export function seedream55Resolution(resolution: unknown): Seedream55Resolution {
|
|
43
|
+
const asked = typeof resolution === "string" ? resolution.trim().toUpperCase() : ""
|
|
44
|
+
return SEEDREAM_5_5_RESOLUTIONS.find((r) => r === asked) ?? SEEDREAM_5_5_DEFAULT_RESOLUTION
|
|
45
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_TRANSCRIBE_NODE_PROVIDER,
|
|
3
|
+
TRANSCRIBE_TARGET_LANGUAGES,
|
|
4
|
+
transcribeLaneSupportsTranslation,
|
|
3
5
|
transcribeLaneSupportsWordTimestamps,
|
|
6
|
+
transcribeProvidersWithTranslation,
|
|
4
7
|
transcribeProvidersWithWordTimestamps,
|
|
5
8
|
} from "./model-constants.js"
|
|
6
9
|
import { renderTranscriptOutputOf } from "./render-nodes.js"
|
|
@@ -16,12 +19,57 @@ import { renderTranscriptOutputOf } from "./render-nodes.js"
|
|
|
16
19
|
* Pure: no I/O, no framework types — callers pass plain nodes/edges.
|
|
17
20
|
*/
|
|
18
21
|
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
/** A transcription's target language as data carries it: a non-empty string, else `undefined` (no translation). */
|
|
23
|
+
export function transcribeTargetLanguageOf(value: unknown): string | undefined {
|
|
24
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** The refusal for a request that can't return word timings; `null` when it can.
|
|
28
|
+
* An absent provider resolves to the transcribe NODE default. A translation
|
|
29
|
+
* (`targetLanguage`) never carries word timings, whatever the engine: KIE
|
|
30
|
+
* refuses Nemotron's `target_language` together with `timestamps`. */
|
|
31
|
+
export function transcribeWordTimestampsRefusal(
|
|
32
|
+
provider: string | null | undefined,
|
|
33
|
+
targetLanguage?: unknown,
|
|
34
|
+
): string | null {
|
|
35
|
+
const lane = provider || DEFAULT_TRANSCRIBE_NODE_PROVIDER
|
|
36
|
+
if (!transcribeLaneSupportsWordTimestamps(lane)) {
|
|
37
|
+
return `the "${lane}" engine does not return word timings — pick ${transcribeProvidersWithWordTimestamps().join(" or ")}`
|
|
38
|
+
}
|
|
39
|
+
if (transcribeTargetLanguageOf(targetLanguage) !== undefined) {
|
|
40
|
+
return "a translation carries no word timings — clear the target language to get a transcript with word timings"
|
|
41
|
+
}
|
|
42
|
+
return null
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The refusal for a translation request (`targetLanguage`) that cannot run;
|
|
47
|
+
* `null` when there is none to refuse (no target language, or a valid one on
|
|
48
|
+
* an engine that translates, without word timings). One message for every run
|
|
49
|
+
* surface: the route, the workflow run, the editor's Run and MCP.
|
|
50
|
+
* - only Nemotron 3.5 Transcribe translates;
|
|
51
|
+
* - only into a language KIE lists (`TRANSCRIBE_TARGET_LANGUAGES`);
|
|
52
|
+
* - never together with word timings (KIE refuses the pair).
|
|
53
|
+
* An absent provider resolves to the transcribe NODE default.
|
|
54
|
+
*/
|
|
55
|
+
export function transcribeTranslationRefusal(
|
|
56
|
+
provider: string | null | undefined,
|
|
57
|
+
targetLanguage: unknown,
|
|
58
|
+
wordTimestamps?: boolean,
|
|
59
|
+
): string | null {
|
|
60
|
+
const target = transcribeTargetLanguageOf(targetLanguage)
|
|
61
|
+
if (target === undefined) return null
|
|
22
62
|
const lane = provider || DEFAULT_TRANSCRIBE_NODE_PROVIDER
|
|
23
|
-
if (
|
|
24
|
-
|
|
63
|
+
if (!transcribeLaneSupportsTranslation(lane)) {
|
|
64
|
+
return `the "${lane}" engine does not translate — pick ${transcribeProvidersWithTranslation().join(" or ")} to translate, or clear the target language`
|
|
65
|
+
}
|
|
66
|
+
if (!(TRANSCRIBE_TARGET_LANGUAGES as readonly string[]).includes(target)) {
|
|
67
|
+
return `"${target}" is not a language the "${lane}" engine translates into — pick one of ${TRANSCRIBE_TARGET_LANGUAGES.join(", ")}`
|
|
68
|
+
}
|
|
69
|
+
if (wordTimestamps === true) {
|
|
70
|
+
return "word timings and a translation cannot be asked for together — turn word timings off, or clear the target language"
|
|
71
|
+
}
|
|
72
|
+
return null
|
|
25
73
|
}
|
|
26
74
|
|
|
27
75
|
export interface PreflightGraphNode {
|
|
@@ -49,7 +97,8 @@ const TRANSCRIBE_JSON_OUT = "json"
|
|
|
49
97
|
const TRANSCRIPT_IN = "transcript"
|
|
50
98
|
|
|
51
99
|
/**
|
|
52
|
-
* Every transcribe node on a word-INCAPABLE lane
|
|
100
|
+
* Every transcribe node on a word-INCAPABLE lane (or one set to translate, whose
|
|
101
|
+
* transcript is a translation with no word timings) whose `json` output reaches an
|
|
53
102
|
* add-captions `transcript` input — directly, or through apply-edl, which remaps
|
|
54
103
|
* the transcript and re-emits it on its own `json` handle (or any render, by
|
|
55
104
|
* its registry `transcriptOutput`: Speaker View's `transcript`). add-captions rejects a
|
|
@@ -72,7 +121,9 @@ export function findWordlessTranscriptFeeds(
|
|
|
72
121
|
for (const node of nodes) {
|
|
73
122
|
if (node.type !== "transcribe" || isSkipped(node)) continue
|
|
74
123
|
const provider = (typeof node.data?.provider === "string" && node.data.provider) || DEFAULT_TRANSCRIBE_NODE_PROVIDER
|
|
75
|
-
|
|
124
|
+
// A translating node is as wordless as an incapable lane: its transcript is
|
|
125
|
+
// the translation, with no word timings.
|
|
126
|
+
const refusal = transcribeWordTimestampsRefusal(provider, node.data?.targetLanguage)
|
|
76
127
|
if (!refusal) continue
|
|
77
128
|
|
|
78
129
|
// Walk the transcript's path: transcribe.json → [render.transcript → its transcript output]* → add-captions.transcript,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* the tables that compose its rows (producer-types, presentation-utils,
|
|
7
7
|
* json-kinds, fan-out-rows, preview-gate) are what consumers read.
|
|
8
8
|
*/
|
|
9
|
-
import { UNIT_CONTRACTS, UNIT_FAN_OUT_EACH, UNIT_JSON_PIPS, UNIT_NON_PROMPT_INPUTS, UNIT_PRESENTS, UNIT_REVIEW_HOLDS } from "./generated/unit-contracts.js"
|
|
9
|
+
import { UNIT_CONTRACTS, UNIT_FAN_OUT_EACH, UNIT_JSON_PIPS, UNIT_LIST_PIPS, UNIT_NON_PROMPT_INPUTS, UNIT_PRESENTS, UNIT_REVIEW_HOLDS } from "./generated/unit-contracts.js"
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* `legacy ∪ units` as a set, `legacy` first, refusing a type that is in both —
|
|
@@ -53,3 +53,6 @@ export const unitReviewHolds = (): readonly string[] => UNIT_REVIEW_HOLDS
|
|
|
53
53
|
|
|
54
54
|
/** Each node unit's fan-out "each" outputs and primary pip (`contract.fanOutEach`), in generated order. */
|
|
55
55
|
export const unitFanOutEach = (): ReadonlyArray<readonly [string, { readonly each: ReadonlyArray<string>; readonly primary: string }]> => UNIT_FAN_OUT_EACH
|
|
56
|
+
|
|
57
|
+
/** Each node unit's list outputs (`handles.outputs[].list`: one run's several files on one pip), in generated order. */
|
|
58
|
+
export const unitListPips = (): ReadonlyArray<readonly [string, ReadonlyArray<string>]> => UNIT_LIST_PIPS
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The upscale FACTOR of the image upscalers that take one — which factors each
|
|
3
|
+
* model accepts, and the factor a request renders at. One authority for the
|
|
4
|
+
* route's enum, the editor's dropdown and its fail-safe snap, the workflow
|
|
5
|
+
* payload, the worker, MCP and the SDK.
|
|
6
|
+
*
|
|
7
|
+
* Two models take a factor:
|
|
8
|
+
* - `topaz-image-upscale`: 1, 2 or 4 — resolved by `resolveTopazUpscale`,
|
|
9
|
+
* which also maps its legacy `targetResolution` (unchanged here).
|
|
10
|
+
* - `nodaro-image-upscale`: 1, 2, 4 or 8. A factor multiplies both sides; 1
|
|
11
|
+
* enhances the picture at its own size. Anything else is rendered at the
|
|
12
|
+
* default, 2. It has no `targetResolution`: its price follows the output's
|
|
13
|
+
* size (`@nodaro/render-rules` nodaro-image-upscale-pricing.ts), so a stored
|
|
14
|
+
* tier from another model is never read.
|
|
15
|
+
*
|
|
16
|
+
* Every other model (Recraft, and the edit models) declares no factor list,
|
|
17
|
+
* and a factor stored or mapped onto its node is passed on exactly as it
|
|
18
|
+
* always was — "1", "2" and "4" are the values the route takes for it — except
|
|
19
|
+
* a factor only the house model takes ({@link HOUSE_ONLY_UPSCALE_FACTORS}, "8"):
|
|
20
|
+
* no other model takes it, so it is never sent to one, and the editor clears
|
|
21
|
+
* it from a node switched away from Nodaro Image Upscale.
|
|
22
|
+
*/
|
|
23
|
+
import { resolveTopazUpscale, TOPAZ_UPSCALE_FACTORS } from "./topaz-upscale.js"
|
|
24
|
+
|
|
25
|
+
/** Nodaro Image Upscale's model id. */
|
|
26
|
+
export const NODARO_IMAGE_UPSCALE_MODEL_ID = "nodaro-image-upscale"
|
|
27
|
+
|
|
28
|
+
export type NodaroImageUpscaleFactor = "1" | "2" | "4" | "8"
|
|
29
|
+
|
|
30
|
+
/** The factors Nodaro Image Upscale renders at, smallest first. */
|
|
31
|
+
export const NODARO_IMAGE_UPSCALE_FACTORS: readonly NodaroImageUpscaleFactor[] = ["1", "2", "4", "8"]
|
|
32
|
+
|
|
33
|
+
/** The factor a Nodaro Image Upscale request without a valid one renders at. */
|
|
34
|
+
export const NODARO_IMAGE_UPSCALE_DEFAULT_FACTOR: NodaroImageUpscaleFactor = "2"
|
|
35
|
+
|
|
36
|
+
/** Every factor any image upscaler takes — the vocabulary the request enums carry. Each model's own list is {@link upscaleFactorsFor}. */
|
|
37
|
+
export const UPSCALE_FACTORS = ["1", "2", "4", "8"] as const
|
|
38
|
+
export type UpscaleFactor = (typeof UPSCALE_FACTORS)[number]
|
|
39
|
+
|
|
40
|
+
/** The factor Nodaro Image Upscale renders `raw` at: a listed factor as given (trimmed), anything else the default. */
|
|
41
|
+
export function resolveNodaroImageUpscaleFactor(raw: unknown): NodaroImageUpscaleFactor {
|
|
42
|
+
const trimmed = typeof raw === "string" ? raw.trim() : typeof raw === "number" ? String(raw) : ""
|
|
43
|
+
return (NODARO_IMAGE_UPSCALE_FACTORS as readonly string[]).includes(trimmed)
|
|
44
|
+
? (trimmed as NodaroImageUpscaleFactor)
|
|
45
|
+
: NODARO_IMAGE_UPSCALE_DEFAULT_FACTOR
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The factors only Nodaro Image Upscale takes: every other model's request
|
|
50
|
+
* refuses them (Topaz's list, and the 1/2/4 the route takes for a model with
|
|
51
|
+
* no list of its own), so none is ever sent to another model. "8".
|
|
52
|
+
*/
|
|
53
|
+
export const HOUSE_ONLY_UPSCALE_FACTORS: readonly UpscaleFactor[] = NODARO_IMAGE_UPSCALE_FACTORS.filter(
|
|
54
|
+
(f) => !(TOPAZ_UPSCALE_FACTORS as readonly string[]).includes(f),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
/** True when `value` is a factor only Nodaro Image Upscale takes ({@link HOUSE_ONLY_UPSCALE_FACTORS}). */
|
|
58
|
+
function isHouseOnlyUpscaleFactor(value: string): boolean {
|
|
59
|
+
return (HOUSE_ONLY_UPSCALE_FACTORS as readonly string[]).includes(value.trim())
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** The factors `provider` accepts, or undefined for a model that declares no factor list. */
|
|
63
|
+
export function upscaleFactorsFor(provider: unknown): readonly UpscaleFactor[] | undefined {
|
|
64
|
+
if (provider === NODARO_IMAGE_UPSCALE_MODEL_ID) return NODARO_IMAGE_UPSCALE_FACTORS
|
|
65
|
+
if (provider === "topaz-image-upscale") return TOPAZ_UPSCALE_FACTORS
|
|
66
|
+
return undefined
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The factor a request to `provider` sends: Topaz's through `resolveTopazUpscale`
|
|
71
|
+
* (its legacy `targetResolution` included), Nodaro Image Upscale's through
|
|
72
|
+
* {@link resolveNodaroImageUpscaleFactor}, and any other model's value as
|
|
73
|
+
* given — except a factor only the house model takes ("8"), which is not
|
|
74
|
+
* sent. What the editor's panel snaps a stale value to, and what the editor's
|
|
75
|
+
* Run and the workflow payload send.
|
|
76
|
+
*/
|
|
77
|
+
export function resolveUpscaleFactor(
|
|
78
|
+
provider: unknown,
|
|
79
|
+
input: { upscaleFactor?: unknown; targetResolution?: unknown },
|
|
80
|
+
): string | undefined {
|
|
81
|
+
if (provider === NODARO_IMAGE_UPSCALE_MODEL_ID) return resolveNodaroImageUpscaleFactor(input.upscaleFactor)
|
|
82
|
+
if (provider === "topaz-image-upscale") {
|
|
83
|
+
return resolveTopazUpscale({
|
|
84
|
+
upscaleFactor: typeof input.upscaleFactor === "string" ? input.upscaleFactor : undefined,
|
|
85
|
+
targetResolution: typeof input.targetResolution === "string" ? input.targetResolution : undefined,
|
|
86
|
+
}).upscaleFactor
|
|
87
|
+
}
|
|
88
|
+
return typeof input.upscaleFactor === "string" && !isHouseOnlyUpscaleFactor(input.upscaleFactor) ? input.upscaleFactor : undefined
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The factor a node on `provider` must carry instead of its stored one — the
|
|
93
|
+
* one the run would render ({@link resolveUpscaleFactor}) — `null` when it
|
|
94
|
+
* must carry none, or undefined when the stored factor stands. What the editor
|
|
95
|
+
* writes when a stale factor meets a model that does not take it: a Nodaro
|
|
96
|
+
* Image Upscale 8x switched to Topaz runs, and is stored, at 2x; one switched
|
|
97
|
+
* to a model with no factor list (Recraft) keeps no factor. Any other factor
|
|
98
|
+
* on such a model stands exactly as it always did (a saved Recraft node's "4"
|
|
99
|
+
* is never rewritten), as does none stored, or one the model takes.
|
|
100
|
+
*/
|
|
101
|
+
export function snappedUpscaleFactor(
|
|
102
|
+
provider: unknown,
|
|
103
|
+
input: { upscaleFactor?: unknown; targetResolution?: unknown },
|
|
104
|
+
): string | null | undefined {
|
|
105
|
+
const stored = typeof input.upscaleFactor === "string" ? input.upscaleFactor : undefined
|
|
106
|
+
if (stored === undefined) return undefined
|
|
107
|
+
const factors = upscaleFactorsFor(provider)
|
|
108
|
+
if (!factors) return isHouseOnlyUpscaleFactor(stored) ? null : undefined
|
|
109
|
+
if ((factors as readonly string[]).includes(stored)) return undefined
|
|
110
|
+
return resolveUpscaleFactor(provider, input) ?? null
|
|
111
|
+
}
|
|
@@ -211,17 +211,20 @@ export function videoCharacterRefProblem(args: {
|
|
|
211
211
|
// A provider that counts every material against ONE budget (Kling 4.0: 15
|
|
212
212
|
// images + videos + subjects + voices) takes characters beside a start frame
|
|
213
213
|
// (the frame joins the reference images) — the Gemini Omni unit rules below
|
|
214
|
-
// do not apply to it.
|
|
215
|
-
|
|
214
|
+
// do not apply to it. Where audio rides on the characters as their voices
|
|
215
|
+
// (`audioBindsToCharacters`, Kling 4.0 Flash), a clip takes no seat.
|
|
216
|
+
const limits = VIDEO_REF_LIMITS_BY_PROVIDER[provider as string]
|
|
217
|
+
const materials = limits?.materials
|
|
216
218
|
if (materials !== undefined) {
|
|
219
|
+
const audioSeats = limits?.audioBindsToCharacters ? 0 : (args.audioCount ?? 0)
|
|
217
220
|
const used =
|
|
218
|
-
args.imageCount + (args.hasStartFrame ? 1 : 0) + args.videoCount + characterReferences.length +
|
|
221
|
+
args.imageCount + (args.hasStartFrame ? 1 : 0) + args.videoCount + characterReferences.length + audioSeats
|
|
219
222
|
if (used > materials) {
|
|
220
223
|
return {
|
|
221
224
|
code: "character_references_quota",
|
|
222
225
|
message:
|
|
223
226
|
`${provider} takes at most ${materials} materials in all — reference images (a start frame counts as one), ` +
|
|
224
|
-
`reference videos, characters and voices. This request uses ${used}. Remove some.`,
|
|
227
|
+
`reference videos, characters${limits?.audioBindsToCharacters ? "" : " and voices"}. This request uses ${used}. Remove some.`,
|
|
225
228
|
}
|
|
226
229
|
}
|
|
227
230
|
return videoCharacterVoiceProblem({ provider, characterReferences })
|
package/src/video-duration.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How far past a whole second a delivered clip's container may read without
|
|
3
|
+
* counting as longer: a quarter second (8.04 s for an 8 s clip). Read by the
|
|
4
|
+
* rules that turn a delivered clip's measured length into the length it is
|
|
5
|
+
* charged as, or compare one with a length held for it. (Clip-priced steps
|
|
6
|
+
* that measure their own input use a smaller grace of their own.)
|
|
7
|
+
*/
|
|
8
|
+
export const CONTAINER_OVERHANG_SEC = 0.25
|
|
9
|
+
|
|
1
10
|
/** Read a video node's duration (in seconds) from its data shape.
|
|
2
11
|
* Tries `generatedResults[activeResultIndex].duration` (post-execution
|
|
3
12
|
* metadata) first, then `data.duration` (configured at design time on
|