@nodaro/shared 3.41.0 → 3.44.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-FVZMFDRO.js → chunk-2JJTZCZ5.js} +4 -4
- package/dist/{chunk-FVZMFDRO.js.map → chunk-2JJTZCZ5.js.map} +1 -1
- package/dist/{chunk-BWQRAQUD.cjs → chunk-4EEPHWWF.cjs} +43 -43
- package/dist/{chunk-BWQRAQUD.cjs.map → chunk-4EEPHWWF.cjs.map} +1 -1
- package/dist/{chunk-GXTWKAJF.js → chunk-5RBJBUIR.js} +3 -3
- package/dist/{chunk-GXTWKAJF.js.map → chunk-5RBJBUIR.js.map} +1 -1
- package/dist/{chunk-4IWVZR44.cjs → chunk-6BVYKKSF.cjs} +5 -5
- package/dist/{chunk-4IWVZR44.cjs.map → chunk-6BVYKKSF.cjs.map} +1 -1
- package/dist/{chunk-ZXIP5T5V.js → chunk-6KAEQ3GU.js} +3 -3
- package/dist/{chunk-ZXIP5T5V.js.map → chunk-6KAEQ3GU.js.map} +1 -1
- package/dist/{chunk-ZAOBNW6Y.cjs → chunk-6SFJOTRF.cjs} +12 -20
- package/dist/chunk-6SFJOTRF.cjs.map +1 -0
- package/dist/{chunk-IKCFSNNH.cjs → chunk-ASB4U75K.cjs} +21 -21
- package/dist/{chunk-IKCFSNNH.cjs.map → chunk-ASB4U75K.cjs.map} +1 -1
- package/dist/{chunk-X7IRSO4L.js → chunk-B4FQY5P7.js} +3 -3
- package/dist/{chunk-X7IRSO4L.js.map → chunk-B4FQY5P7.js.map} +1 -1
- package/dist/{chunk-ADYPAGQF.cjs → chunk-BHL6P3O5.cjs} +9 -26
- package/dist/chunk-BHL6P3O5.cjs.map +1 -0
- package/dist/{chunk-5CKTBGB6.js → chunk-GBKDNDEM.js} +9 -26
- package/dist/chunk-GBKDNDEM.js.map +1 -0
- package/dist/{chunk-BOUEGYGI.cjs → chunk-II2LEEDH.cjs} +33 -37
- package/dist/chunk-II2LEEDH.cjs.map +1 -0
- package/dist/{chunk-LOTL72UI.js → chunk-KLKWAVQO.js} +4 -5
- package/dist/chunk-KLKWAVQO.js.map +1 -0
- package/dist/{chunk-LOWOJN65.js → chunk-KZGGUDAB.js} +45 -7
- package/dist/chunk-KZGGUDAB.js.map +1 -0
- package/dist/{chunk-A4NDZBSJ.js → chunk-MVJX7N6H.js} +14 -20
- package/dist/chunk-MVJX7N6H.js.map +1 -0
- package/dist/{chunk-2BJADMEX.js → chunk-O5XJDHAL.js} +3 -3
- package/dist/{chunk-2BJADMEX.js.map → chunk-O5XJDHAL.js.map} +1 -1
- package/dist/{chunk-YEET2QGF.cjs → chunk-OVLY5XO4.cjs} +4 -4
- package/dist/{chunk-YEET2QGF.cjs.map → chunk-OVLY5XO4.cjs.map} +1 -1
- package/dist/{chunk-GNY2S63W.js → chunk-PEVJKGGC.js} +4 -4
- package/dist/{chunk-GNY2S63W.js.map → chunk-PEVJKGGC.js.map} +1 -1
- package/dist/{chunk-YEZ2YUKK.js → chunk-QG6UYOLZ.js} +3 -3
- package/dist/{chunk-YEZ2YUKK.js.map → chunk-QG6UYOLZ.js.map} +1 -1
- package/dist/{chunk-TGZJXCLL.cjs → chunk-QHODM5TS.cjs} +46 -6
- package/dist/chunk-QHODM5TS.cjs.map +1 -0
- package/dist/{chunk-YX5FW7ON.js → chunk-R6MULOGA.js} +4 -12
- package/dist/chunk-R6MULOGA.js.map +1 -0
- package/dist/{chunk-RLVZ3RLE.cjs → chunk-RPS35CNO.cjs} +8 -8
- package/dist/{chunk-RLVZ3RLE.cjs.map → chunk-RPS35CNO.cjs.map} +1 -1
- package/dist/{chunk-MLB6YNLS.js → chunk-RQKSILMF.js} +4 -4
- package/dist/{chunk-MLB6YNLS.js.map → chunk-RQKSILMF.js.map} +1 -1
- package/dist/{chunk-VNC5DNIQ.cjs → chunk-RYDJ5BLT.cjs} +11 -13
- package/dist/chunk-RYDJ5BLT.cjs.map +1 -0
- package/dist/{chunk-VSDJCJKP.cjs → chunk-S32Z2JMC.cjs} +46 -45
- package/dist/chunk-S32Z2JMC.cjs.map +1 -0
- package/dist/{chunk-TUUEQ2WR.cjs → chunk-SHWZPCZU.cjs} +8 -8
- package/dist/{chunk-TUUEQ2WR.cjs.map → chunk-SHWZPCZU.cjs.map} +1 -1
- package/dist/{chunk-PYDZ7ZGH.js → chunk-U2CCL5YF.js} +3 -3
- package/dist/{chunk-PYDZ7ZGH.js.map → chunk-U2CCL5YF.js.map} +1 -1
- package/dist/{chunk-4LKEOIOT.cjs → chunk-UYGTZJGT.cjs} +6 -6
- package/dist/{chunk-4LKEOIOT.cjs.map → chunk-UYGTZJGT.cjs.map} +1 -1
- package/dist/{chunk-CWQC6IGE.js → chunk-V5TSXS5A.js} +100 -6
- package/dist/chunk-V5TSXS5A.js.map +1 -0
- package/dist/{chunk-E4MLBJKG.js → chunk-VNAMNWRX.js} +8 -8
- package/dist/{chunk-E4MLBJKG.js.map → chunk-VNAMNWRX.js.map} +1 -1
- package/dist/{chunk-5J5L26IZ.js → chunk-WE5ZENCO.js} +5 -7
- package/dist/chunk-WE5ZENCO.js.map +1 -0
- package/dist/{chunk-N2KG5AMQ.cjs → chunk-WXMLMN5Y.cjs} +4 -4
- package/dist/{chunk-N2KG5AMQ.cjs.map → chunk-WXMLMN5Y.cjs.map} +1 -1
- package/dist/{chunk-SYUY7GNT.js → chunk-XANN72AJ.js} +7 -6
- package/dist/chunk-XANN72AJ.js.map +1 -0
- package/dist/{chunk-JN3V33AN.cjs → chunk-XKLFXNE7.cjs} +6 -6
- package/dist/{chunk-JN3V33AN.cjs.map → chunk-XKLFXNE7.cjs.map} +1 -1
- package/dist/{chunk-DC5EYYVX.cjs → chunk-XUBZO6QA.cjs} +154 -39
- package/dist/chunk-XUBZO6QA.cjs.map +1 -0
- package/dist/chunk-Y4JG3ZAA.cjs +27 -0
- package/dist/{chunk-XOZIHGR5.cjs.map → chunk-Y4JG3ZAA.cjs.map} +1 -1
- package/dist/{chunk-DJIRIBKX.cjs → chunk-Z5W7W24Z.cjs} +5 -6
- package/dist/chunk-Z5W7W24Z.cjs.map +1 -0
- package/dist/entries/apps.cjs +42 -42
- package/dist/entries/apps.js +7 -7
- package/dist/entries/credits.cjs +150 -150
- package/dist/entries/credits.d.cts +1 -1
- package/dist/entries/credits.d.ts +1 -1
- package/dist/entries/credits.js +7 -7
- package/dist/entries/llm-models.d.cts +1 -1
- package/dist/entries/llm-models.d.ts +1 -1
- package/dist/entries/media.cjs +56 -48
- package/dist/entries/media.d.cts +65 -3
- package/dist/entries/media.d.ts +65 -3
- package/dist/entries/media.js +1 -1
- package/dist/entries/model-catalog.cjs +66 -66
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +336 -244
- package/dist/entries/models.d.cts +125 -8
- package/dist/entries/models.d.ts +125 -8
- package/dist/entries/models.js +4 -4
- package/dist/entries/nodes.cjs +206 -206
- package/dist/entries/nodes.js +8 -8
- package/dist/entries/pipeline.cjs +149 -149
- package/dist/entries/pipeline.d.cts +10 -14
- package/dist/entries/pipeline.d.ts +10 -14
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +117 -117
- package/dist/entries/video.js +4 -4
- package/dist/index.cjs +1169 -1069
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +18 -18
- package/dist/{model-constants-B5ka4TQr.d.cts → model-constants-BL-Ae0OU.d.cts} +24 -7
- package/dist/{model-constants-B5ka4TQr.d.ts → model-constants-BL-Ae0OU.d.ts} +24 -7
- package/package.json +1 -1
- package/src/__tests__/cast-swap-limits.test.ts +43 -0
- package/src/__tests__/credit-identifiers.test.ts +13 -32
- package/src/__tests__/pricing-default-duration.test.ts +0 -2
- package/src/__tests__/retired-video-provider.test.ts +42 -0
- package/src/__tests__/topaz-video.test.ts +72 -0
- package/src/__tests__/video-audio-capability.test.ts +4 -13
- package/src/__tests__/video-mask.test.ts +31 -0
- package/src/__tests__/video-mode-aliases.test.ts +10 -1
- package/src/cast-swap-limits.ts +74 -0
- package/src/credit-identifiers.ts +4 -1
- package/src/entries/models.ts +33 -1
- package/src/film-pricing.ts +0 -1
- package/src/model-catalog.ts +7 -24
- package/src/model-constants.ts +29 -15
- package/src/pipeline-types.ts +4 -2
- package/src/provider-directive-defaults.ts +0 -1
- package/src/topaz-video.ts +141 -0
- package/src/video-mask.ts +69 -2
- package/src/video-output-canvas.ts +0 -8
- package/dist/chunk-5CKTBGB6.js.map +0 -1
- package/dist/chunk-5J5L26IZ.js.map +0 -1
- package/dist/chunk-A4NDZBSJ.js.map +0 -1
- package/dist/chunk-ADYPAGQF.cjs.map +0 -1
- package/dist/chunk-BOUEGYGI.cjs.map +0 -1
- package/dist/chunk-CWQC6IGE.js.map +0 -1
- package/dist/chunk-DC5EYYVX.cjs.map +0 -1
- package/dist/chunk-DJIRIBKX.cjs.map +0 -1
- package/dist/chunk-LOTL72UI.js.map +0 -1
- package/dist/chunk-LOWOJN65.js.map +0 -1
- package/dist/chunk-SYUY7GNT.js.map +0 -1
- package/dist/chunk-TGZJXCLL.cjs.map +0 -1
- package/dist/chunk-VNC5DNIQ.cjs.map +0 -1
- package/dist/chunk-VSDJCJKP.cjs.map +0 -1
- package/dist/chunk-XOZIHGR5.cjs +0 -27
- package/dist/chunk-YX5FW7ON.js.map +0 -1
- package/dist/chunk-ZAOBNW6Y.cjs.map +0 -1
|
@@ -352,13 +352,13 @@ type ImageGenProvider = typeof IMAGE_GEN_PROVIDERS[number];
|
|
|
352
352
|
type ImageI2IProvider = typeof IMAGE_I2I_PROVIDERS[number];
|
|
353
353
|
type ImageEditProvider = typeof IMAGE_EDIT_PROVIDERS[number];
|
|
354
354
|
/** Image-to-video providers */
|
|
355
|
-
declare const IMAGE_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance
|
|
355
|
+
declare const IMAGE_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5"];
|
|
356
356
|
type ImageToVideoProvider = typeof IMAGE_TO_VIDEO_PROVIDERS[number];
|
|
357
357
|
/** Text-to-video providers */
|
|
358
|
-
declare const TEXT_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "grok", "seedance
|
|
358
|
+
declare const TEXT_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "grok", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "wan", "hailuo-standard", "bytedance-lite", "bytedance-pro", "wan-turbo", "wan-2.7-t2v", "happyhorse", "runway-kie", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", "kling-3-omni", "kling-master", "hailuo-2.3", "hailuo-2.3-pro", "bytedance-pro-fast", "happyhorse-ref2v", "vidu-q4"];
|
|
359
359
|
type TextToVideoProvider = typeof TEXT_TO_VIDEO_PROVIDERS[number];
|
|
360
360
|
/** Unified video-generation providers (image-to-video ∪ text-to-video) for the generate-video node. */
|
|
361
|
-
declare const VIDEO_GEN_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance
|
|
361
|
+
declare const VIDEO_GEN_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "vidu-q4", "kling-4", "kling-4-keyframes", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", ...("seedance-2-5" | "minimax" | "veo3" | "kling-3.0" | "seedance-2" | "veo3.1" | "wan-turbo" | "bytedance-lite" | "kling-turbo" | "hailuo-standard" | "grok" | "minimax-h3" | "hailuo-2.3-pro" | "hailuo-2.3" | "veo3_lite" | "gemini-omni-video" | "gemini-omni-flash" | "kling" | "kling-master" | "kling-3-omni" | "kling-4" | "kling-4-keyframes" | "grok-imagine-video-1.5" | "seedance-2-fast" | "seedance-2-mini" | "wan-3" | "wan-3-prime" | "wan" | "wan-2.7-t2v" | "ltx-2.3-pro" | "ltx-2.3-fast" | "happyhorse" | "happyhorse-ref2v" | "vidu-q4" | "bytedance-pro" | "bytedance-pro-fast" | "runway-kie")[]];
|
|
362
362
|
type VideoGenProvider = typeof VIDEO_GEN_PROVIDERS[number];
|
|
363
363
|
/**
|
|
364
364
|
* Video models that expose DISTINCT provider ids per mode (text-to-video vs
|
|
@@ -386,14 +386,31 @@ interface VideoModeAlias {
|
|
|
386
386
|
t2v: string;
|
|
387
387
|
}
|
|
388
388
|
declare const VIDEO_MODE_ALIASES: readonly VideoModeAlias[];
|
|
389
|
+
/**
|
|
390
|
+
* Video model ids the provider retired, each with the model it now runs as.
|
|
391
|
+
* They have no catalog entry and are in no provider list: every boundary that
|
|
392
|
+
* receives a stored or sent id (editor load, a run's payload and its estimate,
|
|
393
|
+
* a request body, the video worker, a pipeline pin, the MCP model choice, the
|
|
394
|
+
* credit id) passes it through {@link canonicalVideoProvider} first,
|
|
395
|
+
* so a saved node, an app run or an API call naming one keeps working and is
|
|
396
|
+
* priced as the model it runs as.
|
|
397
|
+
*
|
|
398
|
+
* - `seedance` (Seedance 1.5 Pro, KIE `bytedance/seedance-1.5-pro`): retired
|
|
399
|
+
* upstream 2026-10-25 (KIE answers 410). Runs as Seedance 2 Mini, the
|
|
400
|
+
* cheapest Seedance left (owner's decision 2026-10-25).
|
|
401
|
+
*/
|
|
402
|
+
declare const RETIRED_VIDEO_PROVIDERS: Readonly<Record<string, string>>;
|
|
403
|
+
/** A retired video model id becomes the id it runs as; any other value passes through unchanged. Own properties only. */
|
|
404
|
+
declare function canonicalVideoProvider<T>(provider: T): T | string;
|
|
389
405
|
/**
|
|
390
406
|
* Resolve a (possibly base / cross-mode) video provider id to the concrete KIE
|
|
391
407
|
* id for the given execution mode. Accepts any member id of an alias group
|
|
392
408
|
* (base, i2v, or t2v) so existing workflows that stored either mode's id keep
|
|
393
|
-
* working
|
|
409
|
+
* working, and a retired id ({@link RETIRED_VIDEO_PROVIDERS}) as the model it
|
|
410
|
+
* runs as. Non-aliased providers (single-id models, VEO, Replicate, etc.) pass
|
|
394
411
|
* through unchanged.
|
|
395
412
|
*/
|
|
396
|
-
declare function resolveVideoProviderForMode(
|
|
413
|
+
declare function resolveVideoProviderForMode(rawProvider: string, mode: "image-to-video" | "text-to-video"): string;
|
|
397
414
|
/**
|
|
398
415
|
* Which execution mode a unified Generate Video run takes from what is wired.
|
|
399
416
|
* Shared by the frontend DAG executor (`execute-node.ts`) and the backend
|
|
@@ -1537,7 +1554,7 @@ type LocationAtmosphereProvider = (typeof LOCATION_ATMOSPHERE_PROVIDERS)[number]
|
|
|
1537
1554
|
* Phase 2 candidate for adding veo3.1 if demand for premium hero shots
|
|
1538
1555
|
* materializes.
|
|
1539
1556
|
*/
|
|
1540
|
-
declare const OBJECT_MOTION_PROVIDERS: readonly ["kling-turbo", "kling", "kling-3.0", "minimax", "hailuo-2.3", "wan-i2v", "seedance", "bytedance-lite"];
|
|
1557
|
+
declare const OBJECT_MOTION_PROVIDERS: readonly ["kling-turbo", "kling", "kling-3.0", "minimax", "hailuo-2.3", "wan-i2v", "seedance-2-mini", "bytedance-lite"];
|
|
1541
1558
|
type ObjectMotionProvider = (typeof OBJECT_MOTION_PROVIDERS)[number];
|
|
1542
1559
|
/**
|
|
1543
1560
|
* SceneInputMode — the input-shape contract a video model exposes to the
|
|
@@ -1646,4 +1663,4 @@ declare function applyDefaultVideoSelection<D>(input: {
|
|
|
1646
1663
|
duration: D | number | undefined;
|
|
1647
1664
|
};
|
|
1648
1665
|
|
|
1649
|
-
export { IMAGE_TO_VIDEO_PROVIDERS as $, AI_WRITER_PROVIDERS as A, GVP_ANCHOR_CHOICES as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, GEMINI_OMNI_PROVIDERS as G, GVP_DEFAULT_PROVIDER as H, GVP_END_FRAME_PROVIDERS as I, GVP_EXTEND_PROVIDERS as J, GVP_SUPPORTED_PROVIDERS as K, type GvpAnchorChoice as L, type GvpAnchorWireMode as M, HIGH_QUALITY_PROVIDERS as N, I2I_MASK_SUPPORT as O, I2I_STRENGTH_SUPPORT as P, IDEOGRAM_PROVIDERS as Q, IMAGE_ASPECT_RATIO_VALUES as R, IMAGE_EDIT_PROVIDERS as S, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as T, IMAGE_GEN_PROVIDERS as U, IMAGE_I2I_PROVIDERS as V, IMAGE_MASK_MODE as W, IMAGE_PROMPT_MAX as X, IMAGE_QUALITY_VALUES as Y, IMAGE_RENDERING_SPEED_VALUES as Z, IMAGE_RESOLUTION_VALUES as _, ASPECT_RATIO_DIMENSIONS as a,
|
|
1666
|
+
export { IMAGE_TO_VIDEO_PROVIDERS as $, AI_WRITER_PROVIDERS as A, GVP_ANCHOR_CHOICES as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, GEMINI_OMNI_PROVIDERS as G, GVP_DEFAULT_PROVIDER as H, GVP_END_FRAME_PROVIDERS as I, GVP_EXTEND_PROVIDERS as J, GVP_SUPPORTED_PROVIDERS as K, type GvpAnchorChoice as L, type GvpAnchorWireMode as M, HIGH_QUALITY_PROVIDERS as N, I2I_MASK_SUPPORT as O, I2I_STRENGTH_SUPPORT as P, IDEOGRAM_PROVIDERS as Q, IMAGE_ASPECT_RATIO_VALUES as R, IMAGE_EDIT_PROVIDERS as S, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as T, IMAGE_GEN_PROVIDERS as U, IMAGE_I2I_PROVIDERS as V, IMAGE_MASK_MODE as W, IMAGE_PROMPT_MAX as X, IMAGE_QUALITY_VALUES as Y, IMAGE_RENDERING_SPEED_VALUES as Z, IMAGE_RESOLUTION_VALUES as _, ASPECT_RATIO_DIMENSIONS as a, SEEDANCE_VIDEO_EDIT_SHAPE as a$, type ImageAspectRatio as a0, type ImageEditProvider as a1, type ImageEditTargetResolution as a2, type ImageGenProvider as a3, type ImageI2IProvider as a4, type ImageMaskMode as a5, type ImageQuality as a6, type ImageRenderingSpeed as a7, type ImageResolution as a8, type ImageToVideoProvider as a9, NATIVE_NEGATIVE_VIDEO_PROVIDERS as aA, NEGATIVE_PROMPT_MAX as aB, OBJECT_MOTION_PROVIDERS as aC, type ObjectMotionProvider as aD, PRICING_DEFAULT_DURATION_SEC as aE, PRICING_DEFAULT_RESOLUTION as aF, PROMPT_HARD_CEILING as aG, QA_CHECK_PROVIDERS as aH, type QaCheckProvider as aI, REF_IMAGE_MAX_LIMITS as aJ, RENDERING_SPEED_SUPPORT as aK, REPLICATE_LIP_SYNC_PROVIDERS as aL, RETIRED_VIDEO_PROVIDERS as aM, type RefAudioCheck as aN, type RefAudioProbe as aO, type RefAudioRule as aP, type RefVideoDurationLimit as aQ, SCRIPT_PROVIDERS as aR, SEEDANCE_2_5_REF_LIMITS as aS, SEEDANCE_2_CONTINUATION_REF_SEC as aT, SEEDANCE_2_EXTEND_STITCH as aU, SEEDANCE_2_PROVIDERS as aV, SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER as aW, SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC as aX, SEEDANCE_2_REF_LIMITS as aY, SEEDANCE_LIP_SYNC_PROVIDERS as aZ, SEEDANCE_VIDEO_EDIT_PROVIDERS as a_, KLING_4_DEFAULT_RESOLUTION as aa, KLING_4_MAX_MIDDLE_FRAMES as ab, KLING_4_PROVIDERS as ac, LIP_SYNC_PROVIDERS as ad, LLM_TEXT_INPUT_MAX as ae, LOCATION_ATMOSPHERE_PROVIDERS as af, type LipSyncProvider as ag, type LocationAtmosphereProvider as ah, MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER as ai, MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER as aj, MAX_TTS_CHARS_BY_PROVIDER as ak, MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER as al, MINIMAX_H3_DEFAULT_RESOLUTION as am, MINIMAX_H3_PROVIDERS as an, MODELS_WITH_REFERENCE_IMAGE_SUPPORT as ao, MODIFY_IMAGE_PROVIDERS as ap, MOTION_TRANSFER_PROVIDERS as aq, MUSIC_CREDIT_ID as ar, MUSIC_PROVIDERS as as, MUSIC_PROVIDER_LABELS as at, type ModelPromptingStyle as au, type ModifyImageProvider as av, type MotionTransferProviderType as aw, type MusicProvider as ax, NATIVE_ADAPTIVE_ASPECT as ay, NATIVE_NEGATIVE_PROMPT_MODELS as az, AUDIO_ADDON_PROVIDERS as b, type VideoReferenceSyntax as b$, SEED_SUPPORT as b0, SUNO_ACTIVE_MODELS as b1, SUNO_ADD_TRACK_MODELS as b2, SUNO_DURATION_MODELS as b3, SUNO_HARD_CEILING as b4, SUNO_LEGACY_MODELS as b5, SUNO_MODELS as b6, SUNO_TEXT_MAX as b7, SUNO_TITLE_MAX as b8, type SceneInputMode as b9, VIDEO_AUDIO_CAPABILITY as bA, VIDEO_DURATION_TIERS as bB, VIDEO_GEN_COLLAPSED_T2V_IDS as bC, VIDEO_GEN_PROVIDERS as bD, VIDEO_INPUT_LIP_SYNC_PROVIDERS as bE, VIDEO_MODEL_CAPS as bF, VIDEO_MODE_ALIASES as bG, VIDEO_PROMPT_MAX as bH, VIDEO_PROVIDERS_REQUIRING_IMAGE as bI, VIDEO_PROVIDERS_WITHOUT_DISPATCH as bJ, VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL as bK, VIDEO_REF_AUDIO_RULES as bL, VIDEO_REF_LIMITS_BY_PROVIDER as bM, VIDEO_REF_RATE_PROVIDERS as bN, VIDEO_REF_VIDEO_DURATION_LIMITS as bO, VIDEO_TO_VIDEO_NODE_PROVIDERS as bP, VIDEO_TO_VIDEO_PROVIDERS as bQ, VIDEO_UPSCALE_PROVIDERS as bR, VIDEO_VARIABLE_PRICING as bS, VIDU_Q4_DEFAULT_RESOLUTION as bT, VIDU_Q4_PROVIDERS as bU, VOICE_DESIGN_MODELS as bV, type VideoAudioCapability as bW, type VideoAudioMode as bX, type VideoGenProvider as bY, type VideoModeAlias as bZ, type VideoModelCapabilities as b_, SceneInputModeSchema as ba, type ScriptProvider as bb, type SeedanceVideoEditProvider as bc, type SunoAddTrackModel as bd, type SunoModel as be, T2I_TO_I2I_VARIANT as bf, TASK_CHAINED_EDIT_PROVIDERS as bg, TASK_CHAINED_EDIT_PROVIDER_IDS as bh, TEXT_TO_AUDIO_PROVIDERS as bi, TEXT_TO_VIDEO_PROVIDERS as bj, TRANSCRIBE_LANES as bk, TRANSCRIBE_PROVIDERS as bl, TRANSCRIBE_PROVIDER_CAPABILITIES as bm, TTS_PROVIDERS as bn, TTS_TEXT_MAX as bo, TWO_K_RESOLUTION_PROVIDERS as bp, type TaskChainedEditProvider as bq, type TextToAudioProvider as br, type TextToVideoProvider as bs, type TranscribeLane as bt, type TranscribeProvider as bu, type TtsProvider as bv, UPSCALE_IMAGE_PROVIDERS as bw, type UpscaleImageProvider as bx, VARIABLE_PRICING_MODELS as by, VEO_PROVIDERS as bz, type AiWriterProvider as c, videoProviderAppendsFrames as c$, type VideoToVideoNodeProvider as c0, type VideoToVideoProvider as c1, type VideoUpscaleProvider as c2, type VoiceDesignModel as c3, WAN_3_DEFAULT_RESOLUTION as c4, WAN_3_PROVIDERS as c5, applyDefaultVideoSelection as c6, applyVideoAudioToggle as c7, applyVideoNegativePrompt as c8, billsReferenceVideoSeconds as c9, maxSegmentsFor as cA, maxVideoDurationSec as cB, minSegmentSecFor as cC, modelsForInputMode as cD, normalizeKling4Resolution as cE, normalizeMinimaxH3Resolution as cF, normalizeViduQ4Resolution as cG, normalizeWan3Resolution as cH, preferredInputModeForModel as cI, pricedOutputDurationSec as cJ, resolveGvpAnchorWire as cK, resolveMusicProvider as cL, resolveVideoModeForInputs as cM, resolveVideoProviderForMode as cN, seedance2AudioLimitSec as cO, segmentDurationsFor as cP, snapToNearestDuration as cQ, sunoModelHonoursDuration as cR, supportsAutoVideoDuration as cS, supportsEndAnchor as cT, supportsExtendRender as cU, transcribeLaneSupportsWordTimestamps as cV, transcribeProvidersWithWordTimestamps as cW, videoDefaultDurationSec as cX, videoModelCanSpeakDialogue as cY, videoModelSupportsAudio as cZ, videoNegativeSuffix as c_, canonicalVideoProvider as ca, checkRefAudioRules as cb, checkRefVideoDurations as cc, defaultVideoAspectRatio as cd, findSeedance2AudioOverLimit as ce, getMaxImagePromptChars as cf, getMaxNegativePromptChars as cg, getMaxSunoPromptChars as ch, getMaxSunoStyleChars as ci, getMaxTtsChars as cj, getMaxVideoPromptChars as ck, getVideoAudioCapability as cl, hasContiguousSegmentDurations as cm, imageReferenceLimit as cn, isGeminiOmniProvider as co, isGvpSupportedProvider as cp, isKling4Provider as cq, isLegacySunoModel as cr, isMinimaxH3Provider as cs, isSeedance2Provider as ct, isSeedanceVideoEditProvider as cu, isVeoProvider as cv, isViduQ4Provider as cw, isWan3Provider as cx, kling4KeyframeFrameCap as cy, maxSegmentSecFor as cz, COMPOSER_PLAN_FIELDS as d, videoProviderFoldsLoneEndFrame as d0, videoProviderRefModeFrameSeats as d1, videoProviderReferenceSyntax as d2, videoProviderRequiresImage as d3, videoProviderRunsFromReferences as d4, COMPOSER_PLAN_MAP as e, CREDIT_BASE_USD as f, type CharacterMotionProvider as g, DEFAULT_MUSIC_PROVIDER as h, DEFAULT_REF_IMAGE_MAX as i, DEFAULT_SUNO_MODEL as j, DEFAULT_TEXT_TO_AUDIO_PROVIDER as k, DEFAULT_TRANSCRIBE_NODE_PROVIDER as l, DEFAULT_TRANSCRIBE_PROVIDER as m, DEFAULT_TTS_PROVIDER as n, DEFAULT_VIDEO_DURATION_SEC as o, DEFAULT_VIDEO_PROVIDER as p, DEFAULT_VOICE_DESIGN_MODEL as q, DIALOGUE_PROVIDERS as r, DURATION_PRICED_PROVIDERS as s, type DialogueProvider as t, type ExtendVideoProvider as u, FAL_LIP_SYNC_PROVIDERS as v, FLEXIBLE_INPUT_LIP_SYNC_PROVIDERS as w, FRAME_MODE_ADAPTIVE_ONLY_ASPECT as x, type FaceSwapProvider as y, GUIDANCE_SCALE_SUPPORT as z };
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import { describe, expect, it } from "vitest"
|
|
|
7
7
|
import {
|
|
8
8
|
CAST_SWAP_FACE_MASKING_BOUNDS,
|
|
9
9
|
CAST_SWAP_FACE_MASKING_DEFAULTS,
|
|
10
|
+
CAST_SWAP_FACE_MASK_TARGETS,
|
|
10
11
|
CAST_SWAP_ENGINE_WHEN_OMITTED,
|
|
11
12
|
CAST_SWAP_ENGINES,
|
|
12
13
|
CAST_SWAP_POST_PROMPT_MAX,
|
|
@@ -16,6 +17,14 @@ import {
|
|
|
16
17
|
CAST_SWAP_KLING_LENGTHS,
|
|
17
18
|
CAST_SWAP_KLING_LENGTH_WHEN_OMITTED,
|
|
18
19
|
CAST_SWAP_KLING_MAX_IMAGES,
|
|
20
|
+
CAST_SWAP_ENGINE_IDS_ACCEPTED,
|
|
21
|
+
CAST_SWAP_ENGINE_OF_NODARO_MOTION,
|
|
22
|
+
NODARO_MOTION_ENGINES,
|
|
23
|
+
NODARO_MOTION_ENGINE_NAMES,
|
|
24
|
+
NODARO_MOTION_ENGINE_OF_CAST_SWAP,
|
|
25
|
+
castSwapEngineFrom,
|
|
26
|
+
nodaroMotionEngineName,
|
|
27
|
+
nodaroMotionEngineOf,
|
|
19
28
|
} from "../cast-swap-limits.js"
|
|
20
29
|
|
|
21
30
|
describe("Cast Swap limits", () => {
|
|
@@ -50,6 +59,12 @@ describe("Cast Swap limits", () => {
|
|
|
50
59
|
expect(CAST_SWAP_FACE_MASKING_DEFAULTS.fill).toBe("blur")
|
|
51
60
|
})
|
|
52
61
|
|
|
62
|
+
it("masks the face or the whole head, the head by default", () => {
|
|
63
|
+
expect(CAST_SWAP_FACE_MASK_TARGETS).toEqual(["face", "head"])
|
|
64
|
+
expect(CAST_SWAP_FACE_MASKING_DEFAULTS.target).toBe("head")
|
|
65
|
+
expect(CAST_SWAP_FACE_MASK_TARGETS).toContain(CAST_SWAP_FACE_MASKING_DEFAULTS.target)
|
|
66
|
+
})
|
|
67
|
+
|
|
53
68
|
it("leaves 10 % margins at the left and right when the zone is left out", () => {
|
|
54
69
|
expect(CAST_SWAP_FACE_MASKING_DEFAULTS.zone).toEqual({ leftPct: 10, rightPct: 10, topPct: 0, bottomPct: 0 })
|
|
55
70
|
})
|
|
@@ -73,4 +88,32 @@ describe("Cast Swap limits", () => {
|
|
|
73
88
|
it("caps a Kling 4 run at 10 images", () => {
|
|
74
89
|
expect(CAST_SWAP_KLING_MAX_IMAGES).toBe(10)
|
|
75
90
|
})
|
|
91
|
+
|
|
92
|
+
it("names the two engines Nodaro Motion Pro and Lite, with public ids that map one-to-one onto the internal ones", () => {
|
|
93
|
+
expect(NODARO_MOTION_ENGINES).toEqual(["motion-pro", "motion-lite"])
|
|
94
|
+
expect(NODARO_MOTION_ENGINE_NAMES).toEqual({ "motion-pro": "Nodaro Motion Pro", "motion-lite": "Nodaro Motion Lite" })
|
|
95
|
+
expect(CAST_SWAP_ENGINE_OF_NODARO_MOTION).toEqual({ "motion-pro": "seedance-2-5", "motion-lite": "kling-4" })
|
|
96
|
+
// Total and inverse both ways: every internal engine has exactly one public id.
|
|
97
|
+
for (const engine of CAST_SWAP_ENGINES) {
|
|
98
|
+
const pub = nodaroMotionEngineOf(engine)
|
|
99
|
+
expect(CAST_SWAP_ENGINE_OF_NODARO_MOTION[pub]).toBe(engine)
|
|
100
|
+
expect(NODARO_MOTION_ENGINE_OF_CAST_SWAP[engine]).toBe(pub)
|
|
101
|
+
}
|
|
102
|
+
for (const pub of NODARO_MOTION_ENGINES) expect(nodaroMotionEngineOf(CAST_SWAP_ENGINE_OF_NODARO_MOTION[pub])).toBe(pub)
|
|
103
|
+
expect(new Set(Object.values(NODARO_MOTION_ENGINE_OF_CAST_SWAP)).size).toBe(CAST_SWAP_ENGINES.length)
|
|
104
|
+
expect(nodaroMotionEngineName("seedance-2-5")).toBe("Nodaro Motion Pro")
|
|
105
|
+
expect(nodaroMotionEngineName("kling-4")).toBe("Nodaro Motion Lite")
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
it("reads an engine named in either vocabulary, and nothing else", () => {
|
|
109
|
+
expect(castSwapEngineFrom("motion-pro")).toBe("seedance-2-5")
|
|
110
|
+
expect(castSwapEngineFrom("motion-lite")).toBe("kling-4")
|
|
111
|
+
expect(castSwapEngineFrom("seedance-2-5")).toBe("seedance-2-5")
|
|
112
|
+
expect(castSwapEngineFrom("kling-4")).toBe("kling-4")
|
|
113
|
+
for (const other of ["kling-3", "Motion-Pro", "", "toString", "__proto__", undefined, null, 4, {}]) {
|
|
114
|
+
expect(castSwapEngineFrom(other), String(other)).toBeUndefined()
|
|
115
|
+
}
|
|
116
|
+
expect(CAST_SWAP_ENGINE_IDS_ACCEPTED).toEqual(["motion-pro", "motion-lite", "seedance-2-5", "kling-4"])
|
|
117
|
+
for (const id of CAST_SWAP_ENGINE_IDS_ACCEPTED) expect(castSwapEngineFrom(id)).toBeDefined()
|
|
118
|
+
})
|
|
76
119
|
})
|
|
@@ -516,38 +516,19 @@ describe("buildVideoCreditModelIdentifier", () => {
|
|
|
516
516
|
})
|
|
517
517
|
})
|
|
518
518
|
|
|
519
|
-
// --- seedance
|
|
520
|
-
describe("seedance
|
|
521
|
-
it(
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
it("6s is charged as the 4s the runner renders (nearest offered length, a tie goes shorter)", () => {
|
|
534
|
-
expect(buildVideoCreditModelIdentifier("seedance", 6)).toBe("seedance:4s")
|
|
535
|
-
})
|
|
536
|
-
|
|
537
|
-
it("12s -> :12s", () => {
|
|
538
|
-
expect(buildVideoCreditModelIdentifier("seedance", 12)).toBe("seedance:12s")
|
|
539
|
-
})
|
|
540
|
-
|
|
541
|
-
it("10s is charged as the 8s the runner renders (nearest offered length)", () => {
|
|
542
|
-
expect(buildVideoCreditModelIdentifier("seedance", 10)).toBe("seedance:8s")
|
|
543
|
-
})
|
|
544
|
-
|
|
545
|
-
it("11s is charged as the 12s the runner renders", () => {
|
|
546
|
-
expect(buildVideoCreditModelIdentifier("seedance", 11)).toBe("seedance:12s")
|
|
547
|
-
})
|
|
548
|
-
|
|
549
|
-
it("exceeding max clamps to 12s", () => {
|
|
550
|
-
expect(buildVideoCreditModelIdentifier("seedance", 20)).toBe("seedance:12s")
|
|
519
|
+
// --- seedance (Seedance 1.5, retired 2026-10-25) ---
|
|
520
|
+
describe("a retired seedance is priced as the seedance-2-mini it runs as", () => {
|
|
521
|
+
it.each([
|
|
522
|
+
[4, undefined],
|
|
523
|
+
[8, undefined],
|
|
524
|
+
[12, "720p"],
|
|
525
|
+
[8, "480p"],
|
|
526
|
+
] as const)("%ss %s", (duration, resolution) => {
|
|
527
|
+
for (const nodeType of ["image-to-video", "text-to-video"] as const) {
|
|
528
|
+
const asMini = buildVideoCreditModelIdentifier("seedance-2-mini", duration, undefined, nodeType, undefined, resolution)
|
|
529
|
+
expect(buildVideoCreditModelIdentifier("seedance", duration, undefined, nodeType, undefined, resolution)).toBe(asMini)
|
|
530
|
+
expect(asMini.startsWith("seedance-2-mini")).toBe(true)
|
|
531
|
+
}
|
|
551
532
|
})
|
|
552
533
|
})
|
|
553
534
|
|
|
@@ -40,8 +40,6 @@ describe("pricedOutputDurationSec", () => {
|
|
|
40
40
|
expect(pricedOutputDurationSec("kling", 8)).toBe(10)
|
|
41
41
|
expect(pricedOutputDurationSec("grok-i2v", 8)).toBe(6)
|
|
42
42
|
expect(pricedOutputDurationSec("grok-i2v", 15)).toBe(10)
|
|
43
|
-
expect(pricedOutputDurationSec("seedance", 6)).toBe(4)
|
|
44
|
-
expect(pricedOutputDurationSec("seedance", 10)).toBe(8)
|
|
45
43
|
})
|
|
46
44
|
|
|
47
45
|
it("snapToNearestDuration is the runners' rule: offered values pass, ties go to the earlier entry", () => {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest"
|
|
2
|
+
import {
|
|
3
|
+
IMAGE_TO_VIDEO_PROVIDERS,
|
|
4
|
+
OBJECT_MOTION_PROVIDERS,
|
|
5
|
+
RETIRED_VIDEO_PROVIDERS,
|
|
6
|
+
TEXT_TO_VIDEO_PROVIDERS,
|
|
7
|
+
canonicalVideoProvider,
|
|
8
|
+
} from "../model-constants.js"
|
|
9
|
+
import { MODEL_CATALOG } from "../model-catalog.js"
|
|
10
|
+
import { PIPELINE_PINNABLE_VIDEO_MODELS, PipelineConfigSchema } from "../pipeline-types.js"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A retired video model (Seedance 1.5, retired upstream 2026-10-25) has no
|
|
14
|
+
* catalog entry and is in no provider list; every stored or sent copy of its
|
|
15
|
+
* id runs as the model it became.
|
|
16
|
+
*/
|
|
17
|
+
describe("RETIRED_VIDEO_PROVIDERS", () => {
|
|
18
|
+
it("a retired id is gone from the catalog and every provider list; the model it runs as is live in both modes", () => {
|
|
19
|
+
for (const [retired, runsAs] of Object.entries(RETIRED_VIDEO_PROVIDERS)) {
|
|
20
|
+
expect(MODEL_CATALOG[retired], retired).toBeUndefined()
|
|
21
|
+
for (const list of [IMAGE_TO_VIDEO_PROVIDERS, TEXT_TO_VIDEO_PROVIDERS, OBJECT_MOTION_PROVIDERS, PIPELINE_PINNABLE_VIDEO_MODELS]) {
|
|
22
|
+
expect((list as readonly string[]).includes(retired), retired).toBe(false)
|
|
23
|
+
}
|
|
24
|
+
expect(MODEL_CATALOG[runsAs]?.kind, runsAs).toBe("video")
|
|
25
|
+
expect((IMAGE_TO_VIDEO_PROVIDERS as readonly string[]).includes(runsAs)).toBe(true)
|
|
26
|
+
expect((TEXT_TO_VIDEO_PROVIDERS as readonly string[]).includes(runsAs)).toBe(true)
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it("canonicalVideoProvider maps a retired id and passes anything else through", () => {
|
|
31
|
+
expect(canonicalVideoProvider("seedance")).toBe("seedance-2-mini")
|
|
32
|
+
expect(canonicalVideoProvider("seedance-2")).toBe("seedance-2")
|
|
33
|
+
expect(canonicalVideoProvider(undefined)).toBeUndefined()
|
|
34
|
+
expect(canonicalVideoProvider("constructor")).toBe("constructor")
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it("a saved pipeline pinned to a retired model reads as the model it runs as", () => {
|
|
38
|
+
const parsed = PipelineConfigSchema.parse({ video_model: "seedance", stage_models: { shots_video: "seedance" } })
|
|
39
|
+
expect(parsed.video_model).toBe("seedance-2-mini")
|
|
40
|
+
expect(parsed.stage_models?.shots_video).toBe("seedance-2-mini")
|
|
41
|
+
})
|
|
42
|
+
})
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest"
|
|
2
|
+
import { resolveTopazVideoTarget, topazVideoOutputSize, topazVideoResolutionNearest } from "../topaz-video.js"
|
|
3
|
+
|
|
4
|
+
const HD = { width: 1280, height: 720, fps: 24 }
|
|
5
|
+
const PORTRAIT_1080 = { width: 1080, height: 1920, fps: 30 }
|
|
6
|
+
|
|
7
|
+
describe("resolveTopazVideoTarget", () => {
|
|
8
|
+
it("defaults to 1080p at the source's own frame rate", () => {
|
|
9
|
+
expect(resolveTopazVideoTarget({ source: HD })).toEqual({ resolution: "1080p", fps: 24, adjustments: [] })
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it("takes an explicit target as sent", () => {
|
|
13
|
+
expect(resolveTopazVideoTarget({ targetResolution: "4k", targetFps: 60, source: HD })).toMatchObject({ resolution: "4k", fps: 60 })
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
it("clamps the frame rate into 15–60 and says so", () => {
|
|
17
|
+
const r = resolveTopazVideoTarget({ targetResolution: "720p", targetFps: 120, source: HD })
|
|
18
|
+
expect(r.fps).toBe(60)
|
|
19
|
+
expect(r.adjustments).toHaveLength(1)
|
|
20
|
+
expect(resolveTopazVideoTarget({ targetFps: 8 }).fps).toBe(15)
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it("reads a string frame rate, and \"source\" as the source's rate", () => {
|
|
24
|
+
expect(resolveTopazVideoTarget({ targetFps: "50", source: HD }).fps).toBe(50)
|
|
25
|
+
expect(resolveTopazVideoTarget({ targetFps: "source", source: HD }).fps).toBe(24)
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it("falls back to 30 fps when neither the caller nor the source names a rate", () => {
|
|
29
|
+
expect(resolveTopazVideoTarget({ source: { width: 1280, height: 720 } }).fps).toBe(30)
|
|
30
|
+
expect(resolveTopazVideoTarget({}).fps).toBe(30)
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it("maps a legacy factor over the source's SHORT side, to the nearest target", () => {
|
|
34
|
+
expect(resolveTopazVideoTarget({ upscaleFactor: "1", source: HD }).resolution).toBe("720p")
|
|
35
|
+
expect(resolveTopazVideoTarget({ upscaleFactor: "2", source: HD }).resolution).toBe("1080p") // 1440 → 1080p
|
|
36
|
+
expect(resolveTopazVideoTarget({ upscaleFactor: "4", source: HD }).resolution).toBe("4k") // 2880 → 4k
|
|
37
|
+
expect(resolveTopazVideoTarget({ upscaleFactor: "2", source: { width: 640, height: 360 } }).resolution).toBe("720p")
|
|
38
|
+
expect(resolveTopazVideoTarget({ upscaleFactor: "2", source: PORTRAIT_1080 }).resolution).toBe("4k") // 2160
|
|
39
|
+
expect(resolveTopazVideoTarget({ upscaleFactor: "1", source: PORTRAIT_1080 }).resolution).toBe("1080p")
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
it("a valid target resolution beats a legacy factor", () => {
|
|
43
|
+
expect(resolveTopazVideoTarget({ targetResolution: "720p", upscaleFactor: "4", source: HD }).resolution).toBe("720p")
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it("a factor with no readable source, or an unknown target, lands on 1080p and says so", () => {
|
|
47
|
+
const noSource = resolveTopazVideoTarget({ upscaleFactor: "4" })
|
|
48
|
+
expect(noSource.resolution).toBe("1080p")
|
|
49
|
+
expect(noSource.adjustments).toHaveLength(1)
|
|
50
|
+
const unknown = resolveTopazVideoTarget({ targetResolution: "8k", source: HD })
|
|
51
|
+
expect(unknown.resolution).toBe("1080p")
|
|
52
|
+
expect(unknown.adjustments).toHaveLength(1)
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
describe("topazVideoResolutionNearest", () => {
|
|
57
|
+
it("is the target whose short side is nearest, 720p below and 4k above the range", () => {
|
|
58
|
+
expect(topazVideoResolutionNearest(360)).toBe("720p")
|
|
59
|
+
expect(topazVideoResolutionNearest(900)).toBe("1080p") // a tie takes the larger
|
|
60
|
+
expect(topazVideoResolutionNearest(1440)).toBe("1080p")
|
|
61
|
+
expect(topazVideoResolutionNearest(1621)).toBe("4k")
|
|
62
|
+
expect(topazVideoResolutionNearest(5000)).toBe("4k")
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
describe("topazVideoOutputSize", () => {
|
|
67
|
+
it("keeps the source's orientation and aspect, the short side at the target", () => {
|
|
68
|
+
expect(topazVideoOutputSize("1080p", HD)).toEqual({ width: 1920, height: 1080 })
|
|
69
|
+
expect(topazVideoOutputSize("1080p", { width: 1072, height: 1928 })).toEqual({ width: 1080, height: 1942 })
|
|
70
|
+
expect(topazVideoOutputSize("4k")).toEqual({ width: 3840, height: 2160 })
|
|
71
|
+
})
|
|
72
|
+
})
|
|
@@ -57,12 +57,6 @@ describe("getVideoAudioCapability", () => {
|
|
|
57
57
|
}
|
|
58
58
|
})
|
|
59
59
|
|
|
60
|
-
it("returns ambient (audio but not dialogue) for Seedance 1.x", () => {
|
|
61
|
-
const cap = getVideoAudioCapability("seedance")
|
|
62
|
-
expect(cap.mode).toBe("ambient")
|
|
63
|
-
expect(cap.field).toBe("generateAudio")
|
|
64
|
-
})
|
|
65
|
-
|
|
66
60
|
it("returns ambient with the `audio` field for the Wan 3.0 family", () => {
|
|
67
61
|
// Wan 3.0's lever is literally `input.audio` — neither `sound` nor
|
|
68
62
|
// `generate_audio`. Classified "ambient", NOT audio_driven: the KIE schema
|
|
@@ -125,7 +119,6 @@ describe("videoModelSupportsAudio", () => {
|
|
|
125
119
|
expect(videoModelSupportsAudio("kling-3.0")).toBe(true)
|
|
126
120
|
expect(videoModelSupportsAudio("kling-3-omni")).toBe(true)
|
|
127
121
|
expect(videoModelSupportsAudio("seedance-2")).toBe(true)
|
|
128
|
-
expect(videoModelSupportsAudio("seedance")).toBe(true)
|
|
129
122
|
expect(videoModelSupportsAudio("gemini-omni-video")).toBe(true)
|
|
130
123
|
expect(videoModelSupportsAudio("gemini-omni-flash")).toBe(true)
|
|
131
124
|
expect(videoModelSupportsAudio("minimax")).toBe(false)
|
|
@@ -145,8 +138,6 @@ describe("videoModelCanSpeakDialogue", () => {
|
|
|
145
138
|
expect(videoModelCanSpeakDialogue("kling")).toBe(true)
|
|
146
139
|
expect(videoModelCanSpeakDialogue("kling-3.0")).toBe(true)
|
|
147
140
|
expect(videoModelCanSpeakDialogue("kling-3-omni")).toBe(true)
|
|
148
|
-
// ambient-only models are NOT dialogue-capable — their audio is SFX/ambient
|
|
149
|
-
expect(videoModelCanSpeakDialogue("seedance")).toBe(false)
|
|
150
141
|
// Gemini Omni generates an audio track on every render, but its documented
|
|
151
142
|
// dialogue path is multi-turn extension, which our transport cannot reach.
|
|
152
143
|
expect(videoModelCanSpeakDialogue("gemini-omni-video")).toBe(false)
|
|
@@ -232,9 +223,9 @@ describe("applyVideoAudioToggle — neutral audio intent → per-model KIE field
|
|
|
232
223
|
applyVideoAudioToggle(off, "seedance-2", { sound: false })
|
|
233
224
|
expect(off.generate_audio).toBe(false)
|
|
234
225
|
|
|
235
|
-
const
|
|
236
|
-
applyVideoAudioToggle(
|
|
237
|
-
expect(
|
|
226
|
+
const mini: Record<string, unknown> = {}
|
|
227
|
+
applyVideoAudioToggle(mini, "seedance-2-mini", { sound: true })
|
|
228
|
+
expect(mini.generate_audio).toBe(true)
|
|
238
229
|
})
|
|
239
230
|
|
|
240
231
|
it("maps the neutral toggle onto Wan 3.0's `audio` field", () => {
|
|
@@ -264,7 +255,7 @@ describe("applyVideoAudioToggle — neutral audio intent → per-model KIE field
|
|
|
264
255
|
|
|
265
256
|
it("accepts `generateAudio` as a legacy alias on FREE models (Seedance)", () => {
|
|
266
257
|
const input: Record<string, unknown> = {}
|
|
267
|
-
applyVideoAudioToggle(input, "seedance", { generateAudio: true })
|
|
258
|
+
applyVideoAudioToggle(input, "seedance-2-mini", { generateAudio: true })
|
|
268
259
|
expect(input.generate_audio).toBe(true)
|
|
269
260
|
})
|
|
270
261
|
|
|
@@ -5,7 +5,9 @@ import {
|
|
|
5
5
|
VIDEO_MASK_DEFAULTS,
|
|
6
6
|
VIDEO_MASK_LIMITS,
|
|
7
7
|
VIDEO_MASK_PROVIDERS,
|
|
8
|
+
VIDEO_MASK_RECIPE,
|
|
8
9
|
resolveVideoMaskProvider,
|
|
10
|
+
resolveVideoMaskRedetectSec,
|
|
9
11
|
resolveVideoMaskZone,
|
|
10
12
|
videoMaskBilledSeconds,
|
|
11
13
|
videoMaskCreditId,
|
|
@@ -92,6 +94,28 @@ describe("Video Mask perShot", () => {
|
|
|
92
94
|
})
|
|
93
95
|
})
|
|
94
96
|
|
|
97
|
+
describe("Video Mask redetectEverySec", () => {
|
|
98
|
+
it("is off by default (0), with a 1–10 s range", () => {
|
|
99
|
+
expect(VIDEO_MASK_DEFAULTS.redetectEverySec).toBe(0)
|
|
100
|
+
expect(VIDEO_MASK_LIMITS.REDETECT_EVERY_SEC_MIN).toBe(1)
|
|
101
|
+
expect(VIDEO_MASK_LIMITS.REDETECT_EVERY_SEC_MAX).toBe(10)
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
it("resolveVideoMaskRedetectSec: absent / 0 / negative / not a number = 0; above 0 clamped to 1–10", () => {
|
|
105
|
+
expect(resolveVideoMaskRedetectSec(undefined)).toBe(0)
|
|
106
|
+
expect(resolveVideoMaskRedetectSec(null)).toBe(0)
|
|
107
|
+
expect(resolveVideoMaskRedetectSec(0)).toBe(0)
|
|
108
|
+
expect(resolveVideoMaskRedetectSec(-2)).toBe(0)
|
|
109
|
+
expect(resolveVideoMaskRedetectSec("1")).toBe(0)
|
|
110
|
+
expect(resolveVideoMaskRedetectSec(Number.NaN)).toBe(0)
|
|
111
|
+
expect(resolveVideoMaskRedetectSec(Infinity)).toBe(0)
|
|
112
|
+
expect(resolveVideoMaskRedetectSec(1)).toBe(1)
|
|
113
|
+
expect(resolveVideoMaskRedetectSec(2.5)).toBe(2.5)
|
|
114
|
+
expect(resolveVideoMaskRedetectSec(0.4)).toBe(1)
|
|
115
|
+
expect(resolveVideoMaskRedetectSec(30)).toBe(10)
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
|
|
95
119
|
describe("Mask Composite units", () => {
|
|
96
120
|
// Repeated in docs/nodes/processing-video/mask-composite.md (at the 10-credit row).
|
|
97
121
|
it.each([[3, 1], [5, 1], [10, 2], [10.0000001, 2], [61, 13], [300, 60]])("%s s → %s unit(s)", (sec, units) => {
|
|
@@ -102,3 +126,10 @@ describe("Mask Composite units", () => {
|
|
|
102
126
|
expect(maskCompositeUnits(900)).toBe(60)
|
|
103
127
|
})
|
|
104
128
|
})
|
|
129
|
+
|
|
130
|
+
describe("VIDEO_MASK_RECIPE", () => {
|
|
131
|
+
it("names the algorithm that makes today's masks (the lone-spike cut rule and the 1 s hold cap)", () => {
|
|
132
|
+
expect(VIDEO_MASK_RECIPE).toBe("2026-10-25")
|
|
133
|
+
expect(VIDEO_MASK_LIMITS.HOLD_MAX_SEC).toBe(1)
|
|
134
|
+
})
|
|
135
|
+
})
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
VIDEO_GEN_COLLAPSED_T2V_IDS,
|
|
8
8
|
VIDEO_PROVIDERS_REQUIRING_IMAGE,
|
|
9
9
|
resolveVideoProviderForMode,
|
|
10
|
+
RETIRED_VIDEO_PROVIDERS,
|
|
10
11
|
} from "../model-constants.js"
|
|
11
12
|
|
|
12
13
|
const I2V = "image-to-video"
|
|
@@ -48,12 +49,20 @@ describe("resolveVideoProviderForMode", () => {
|
|
|
48
49
|
})
|
|
49
50
|
|
|
50
51
|
it("passes non-aliased providers through unchanged in both modes", () => {
|
|
51
|
-
for (const p of ["kling", "seedance", "veo3", "minimax", "ltx-2.3-pro"]) {
|
|
52
|
+
for (const p of ["kling", "seedance-2", "veo3", "minimax", "ltx-2.3-pro"]) {
|
|
52
53
|
expect(resolveVideoProviderForMode(p, I2V)).toBe(p)
|
|
53
54
|
expect(resolveVideoProviderForMode(p, T2V)).toBe(p)
|
|
54
55
|
}
|
|
55
56
|
})
|
|
56
57
|
|
|
58
|
+
it("resolves a retired id to the model it runs as, in both modes", () => {
|
|
59
|
+
for (const [retired, runsAs] of Object.entries(RETIRED_VIDEO_PROVIDERS)) {
|
|
60
|
+
expect(resolveVideoProviderForMode(retired, I2V)).toBe(runsAs)
|
|
61
|
+
expect(resolveVideoProviderForMode(retired, T2V)).toBe(runsAs)
|
|
62
|
+
}
|
|
63
|
+
expect(resolveVideoProviderForMode("seedance", I2V)).toBe("seedance-2-mini")
|
|
64
|
+
})
|
|
65
|
+
|
|
57
66
|
it("passes single-id i2v-only models (grok-imagine-video-1.5) through unchanged", () => {
|
|
58
67
|
// It is its own id in both arrays — never aliased, so no remap.
|
|
59
68
|
expect(resolveVideoProviderForMode("grok-imagine-video-1.5", I2V)).toBe("grok-imagine-video-1.5")
|
package/src/cast-swap-limits.ts
CHANGED
|
@@ -42,8 +42,21 @@ export const CAST_SWAP_FACE_MASKING_BOUNDS = {
|
|
|
42
42
|
threshold: [0.05, 0.95],
|
|
43
43
|
} as const satisfies Record<string, readonly [number, number]>
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* What a Cast Swap face mask covers (`faceMasking.target`):
|
|
47
|
+
*
|
|
48
|
+
* - `"head"` (the default): the whole head, hair included, and people seen
|
|
49
|
+
* from behind or turned away, with a bigger mask.
|
|
50
|
+
* - `"face"`: the face only; the hair, and a person turned away, stay visible.
|
|
51
|
+
*/
|
|
52
|
+
export const CAST_SWAP_FACE_MASK_TARGETS = ["face", "head"] as const
|
|
53
|
+
|
|
54
|
+
export type CastSwapFaceMaskTarget = (typeof CAST_SWAP_FACE_MASK_TARGETS)[number]
|
|
55
|
+
|
|
45
56
|
/** What Cast Swap uses for a `faceMasking` setting left out. */
|
|
46
57
|
export const CAST_SWAP_FACE_MASKING_DEFAULTS = {
|
|
58
|
+
/** What a mask covers: the whole head (`CAST_SWAP_FACE_MASK_TARGETS`). */
|
|
59
|
+
target: "head",
|
|
47
60
|
/** What covers a masked face: a blur (`"depth"`, a depth-color view of it, is the other fill). */
|
|
48
61
|
fill: "blur",
|
|
49
62
|
minFaceHeightPct: 15,
|
|
@@ -72,6 +85,67 @@ export type CastSwapEngine = (typeof CAST_SWAP_ENGINES)[number]
|
|
|
72
85
|
/** The engine of a run, estimate or trend that names none. */
|
|
73
86
|
export const CAST_SWAP_ENGINE_WHEN_OMITTED: CastSwapEngine = "seedance-2-5"
|
|
74
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Nodaro Motion — what people see of Cast Swap. Its two engines' PUBLIC ids,
|
|
90
|
+
* the only ones documented and returned (a trend's `engine`, a run record, a
|
|
91
|
+
* quote): `"motion-pro"` (Nodaro Motion Pro) and `"motion-lite"` (Nodaro
|
|
92
|
+
* Motion Lite).
|
|
93
|
+
*
|
|
94
|
+
* `CAST_SWAP_ENGINES` stays the INTERNAL vocabulary: what a stored trend
|
|
95
|
+
* version names, and what the platform sends the Cast Swap engine (which takes
|
|
96
|
+
* both). A public id is mapped to it at every boundary that reads one
|
|
97
|
+
* (`castSwapEngineFrom`), and back at every boundary a person reads
|
|
98
|
+
* (`nodaroMotionEngineOf`).
|
|
99
|
+
*/
|
|
100
|
+
export const NODARO_MOTION_ENGINES = ["motion-pro", "motion-lite"] as const
|
|
101
|
+
|
|
102
|
+
export type NodaroMotionEngine = (typeof NODARO_MOTION_ENGINES)[number]
|
|
103
|
+
|
|
104
|
+
/** Each public engine's name, as people read it. */
|
|
105
|
+
export const NODARO_MOTION_ENGINE_NAMES = {
|
|
106
|
+
"motion-pro": "Nodaro Motion Pro",
|
|
107
|
+
"motion-lite": "Nodaro Motion Lite",
|
|
108
|
+
} as const satisfies Record<NodaroMotionEngine, string>
|
|
109
|
+
|
|
110
|
+
/** The internal engine each public id runs on (and the inverse, below). */
|
|
111
|
+
export const CAST_SWAP_ENGINE_OF_NODARO_MOTION = {
|
|
112
|
+
"motion-pro": "seedance-2-5",
|
|
113
|
+
"motion-lite": "kling-4",
|
|
114
|
+
} as const satisfies Record<NodaroMotionEngine, CastSwapEngine>
|
|
115
|
+
|
|
116
|
+
/** The public id of each internal engine. */
|
|
117
|
+
export const NODARO_MOTION_ENGINE_OF_CAST_SWAP = {
|
|
118
|
+
"seedance-2-5": "motion-pro",
|
|
119
|
+
"kling-4": "motion-lite",
|
|
120
|
+
} as const satisfies Record<CastSwapEngine, NodaroMotionEngine>
|
|
121
|
+
|
|
122
|
+
/** The public id of an internal engine. */
|
|
123
|
+
export function nodaroMotionEngineOf(engine: CastSwapEngine): NodaroMotionEngine {
|
|
124
|
+
return NODARO_MOTION_ENGINE_OF_CAST_SWAP[engine]
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** The name people read for an internal engine ("Nodaro Motion Pro" / "Nodaro Motion Lite"). */
|
|
128
|
+
export function nodaroMotionEngineName(engine: CastSwapEngine): string {
|
|
129
|
+
return NODARO_MOTION_ENGINE_NAMES[nodaroMotionEngineOf(engine)]
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The internal engine a value names, in either vocabulary: a public id
|
|
134
|
+
* (`"motion-pro"`, `"motion-lite"`) or an internal one (`"seedance-2-5"`,
|
|
135
|
+
* `"kling-4"`, still accepted from older clients and stored data). Undefined
|
|
136
|
+
* for anything else.
|
|
137
|
+
*/
|
|
138
|
+
export function castSwapEngineFrom(value: unknown): CastSwapEngine | undefined {
|
|
139
|
+
if (typeof value !== "string") return undefined
|
|
140
|
+
if (Object.hasOwn(CAST_SWAP_ENGINE_OF_NODARO_MOTION, value)) {
|
|
141
|
+
return CAST_SWAP_ENGINE_OF_NODARO_MOTION[value as NodaroMotionEngine]
|
|
142
|
+
}
|
|
143
|
+
return (CAST_SWAP_ENGINES as readonly string[]).includes(value) ? (value as CastSwapEngine) : undefined
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** Every engine id a request may name: the public ids, then the internal ones (still accepted, never documented). */
|
|
147
|
+
export const CAST_SWAP_ENGINE_IDS_ACCEPTED = [...NODARO_MOTION_ENGINES, ...CAST_SWAP_ENGINES] as const
|
|
148
|
+
|
|
75
149
|
/**
|
|
76
150
|
* The resolutions each engine renders, the default first. Seedance 2.5's 480p
|
|
77
151
|
* is its draft (`draft` is 480p only); Kling 4 has no draft and no 480p.
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
normalizeWan3Resolution,
|
|
33
33
|
normalizeViduQ4Resolution,
|
|
34
34
|
getVideoAudioCapability,
|
|
35
|
+
canonicalVideoProvider,
|
|
35
36
|
} from "./model-constants.js"
|
|
36
37
|
import { isFlux2Model, FLUX2_RES_MP, type Flux2Model } from "./flux2-pricing.js"
|
|
37
38
|
import { VIDEO_DURATION_AUTO } from "./video-duration-auto.js"
|
|
@@ -354,7 +355,7 @@ function wireNormalizedResolution(provider: string, resolution: string | undefin
|
|
|
354
355
|
}
|
|
355
356
|
|
|
356
357
|
export function buildVideoCreditModelIdentifier(
|
|
357
|
-
|
|
358
|
+
rawProvider: string,
|
|
358
359
|
duration?: number | string,
|
|
359
360
|
sound?: boolean,
|
|
360
361
|
nodeType?: "image-to-video" | "text-to-video",
|
|
@@ -362,6 +363,8 @@ export function buildVideoCreditModelIdentifier(
|
|
|
362
363
|
resolution?: string,
|
|
363
364
|
hasVideoRef?: boolean,
|
|
364
365
|
): string {
|
|
366
|
+
// A retired model (RETIRED_VIDEO_PROVIDERS) is priced as the model it runs as.
|
|
367
|
+
const provider = canonicalVideoProvider(rawProvider) as string
|
|
365
368
|
// T2V overrides: some providers have different base costs for text-to-video
|
|
366
369
|
let effectiveProvider = provider
|
|
367
370
|
if (nodeType === "text-to-video") {
|