@nodaro/shared 3.48.0 → 3.50.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-GFK4DZFC.js → chunk-26L7NHK4.js} +4 -4
- package/dist/{chunk-GFK4DZFC.js.map → chunk-26L7NHK4.js.map} +1 -1
- package/dist/{chunk-Y5DCFOLQ.js → chunk-27LQR7DO.js} +3 -3
- package/dist/{chunk-Y5DCFOLQ.js.map → chunk-27LQR7DO.js.map} +1 -1
- package/dist/{chunk-CRCQCK6X.cjs → chunk-2JUNYRMS.cjs} +26 -29
- package/dist/chunk-2JUNYRMS.cjs.map +1 -0
- package/dist/{chunk-A6HWGGU3.cjs → chunk-6GTTATPR.cjs} +6 -6
- package/dist/{chunk-A6HWGGU3.cjs.map → chunk-6GTTATPR.cjs.map} +1 -1
- package/dist/{chunk-VNB4BH36.js → chunk-6TL7JMVF.js} +5 -5
- package/dist/{chunk-VNB4BH36.js.map → chunk-6TL7JMVF.js.map} +1 -1
- package/dist/{chunk-ZHRU7HF3.js → chunk-77R3HYOE.js} +5 -5
- package/dist/{chunk-ZHRU7HF3.js.map → chunk-77R3HYOE.js.map} +1 -1
- package/dist/{chunk-H3HV4OZM.js → chunk-AENQLVQH.js} +4 -4
- package/dist/{chunk-H3HV4OZM.js.map → chunk-AENQLVQH.js.map} +1 -1
- package/dist/{chunk-EOY4G4GQ.cjs → chunk-BQSXEU3O.cjs} +4 -4
- package/dist/{chunk-EOY4G4GQ.cjs.map → chunk-BQSXEU3O.cjs.map} +1 -1
- package/dist/{chunk-ZEMK3FPF.cjs → chunk-DDTA6X2S.cjs} +8 -8
- package/dist/{chunk-ZEMK3FPF.cjs.map → chunk-DDTA6X2S.cjs.map} +1 -1
- package/dist/{chunk-BAUQVNG5.cjs → chunk-DPUIJHM7.cjs} +5 -5
- package/dist/{chunk-BAUQVNG5.cjs.map → chunk-DPUIJHM7.cjs.map} +1 -1
- package/dist/{chunk-FLC5KEYV.js → chunk-DZOCFLMK.js} +3 -3
- package/dist/{chunk-FLC5KEYV.js.map → chunk-DZOCFLMK.js.map} +1 -1
- package/dist/{chunk-FZFHP5SA.cjs → chunk-FEPSSBD5.cjs} +5 -5
- package/dist/{chunk-FZFHP5SA.cjs.map → chunk-FEPSSBD5.cjs.map} +1 -1
- package/dist/{chunk-AKXCJKWT.js → chunk-FV43YJ5I.js} +4 -4
- package/dist/{chunk-AKXCJKWT.js.map → chunk-FV43YJ5I.js.map} +1 -1
- package/dist/{chunk-3O6JBTJW.js → chunk-GIU37YMD.js} +8 -11
- package/dist/chunk-GIU37YMD.js.map +1 -0
- package/dist/{chunk-P3A3QVFA.js → chunk-HCZYIYKK.js} +4 -4
- package/dist/{chunk-P3A3QVFA.js.map → chunk-HCZYIYKK.js.map} +1 -1
- package/dist/{chunk-QHODM5TS.cjs → chunk-HLPRXII4.cjs} +31 -2
- package/dist/chunk-HLPRXII4.cjs.map +1 -0
- package/dist/{chunk-2JRAAOQD.js → chunk-HNBJP2IR.js} +3 -3
- package/dist/{chunk-2JRAAOQD.js.map → chunk-HNBJP2IR.js.map} +1 -1
- package/dist/{chunk-HS2IAUYM.cjs → chunk-HPT244UT.cjs} +6 -6
- package/dist/{chunk-HS2IAUYM.cjs.map → chunk-HPT244UT.cjs.map} +1 -1
- package/dist/{chunk-UTCOO6PQ.js → chunk-JGCGLHZL.js} +3 -3
- package/dist/{chunk-UTCOO6PQ.js.map → chunk-JGCGLHZL.js.map} +1 -1
- package/dist/{chunk-KV6MNZHI.js → chunk-KOVIMPZS.js} +3 -3
- package/dist/{chunk-KV6MNZHI.js.map → chunk-KOVIMPZS.js.map} +1 -1
- package/dist/{chunk-KZGGUDAB.js → chunk-MFM7XRFO.js} +27 -3
- package/dist/{chunk-QHODM5TS.cjs.map → chunk-MFM7XRFO.js.map} +1 -1
- package/dist/{chunk-G7MSESCZ.js → chunk-ML7Q2LTB.js} +8 -16
- package/dist/chunk-ML7Q2LTB.js.map +1 -0
- package/dist/{chunk-TQH7DYZP.cjs → chunk-NGT2FYP2.cjs} +8 -16
- package/dist/chunk-NGT2FYP2.cjs.map +1 -0
- package/dist/{chunk-HP4X2XGD.cjs → chunk-NU6UR5RI.cjs} +8 -8
- package/dist/{chunk-HP4X2XGD.cjs.map → chunk-NU6UR5RI.cjs.map} +1 -1
- package/dist/{chunk-4ZNG2PHH.js → chunk-QBRTPVT6.js} +8 -8
- package/dist/{chunk-4ZNG2PHH.js.map → chunk-QBRTPVT6.js.map} +1 -1
- package/dist/chunk-QIXL2ZLX.cjs +27 -0
- package/dist/{chunk-UEXF2XQH.cjs.map → chunk-QIXL2ZLX.cjs.map} +1 -1
- package/dist/{chunk-2FYKQVMA.cjs → chunk-QZANEGZ3.cjs} +21 -21
- package/dist/{chunk-2FYKQVMA.cjs.map → chunk-QZANEGZ3.cjs.map} +1 -1
- package/dist/{chunk-PNYOLAD6.cjs → chunk-S5CRPOYD.cjs} +43 -43
- package/dist/{chunk-PNYOLAD6.cjs.map → chunk-S5CRPOYD.cjs.map} +1 -1
- package/dist/{chunk-GBB4VVVZ.cjs → chunk-TA5MZZKE.cjs} +45 -45
- package/dist/{chunk-GBB4VVVZ.cjs.map → chunk-TA5MZZKE.cjs.map} +1 -1
- package/dist/{chunk-FZQVONQ2.cjs → chunk-TMXFL6RC.cjs} +12 -12
- package/dist/{chunk-FZQVONQ2.cjs.map → chunk-TMXFL6RC.cjs.map} +1 -1
- package/dist/{chunk-FIWTGVGY.cjs → chunk-U6BDA2CX.cjs} +11 -11
- package/dist/{chunk-FIWTGVGY.cjs.map → chunk-U6BDA2CX.cjs.map} +1 -1
- package/dist/{chunk-HZMZLUU3.cjs → chunk-UDYFWB7D.cjs} +4 -4
- package/dist/{chunk-HZMZLUU3.cjs.map → chunk-UDYFWB7D.cjs.map} +1 -1
- package/dist/{chunk-6W4XHOR2.js → chunk-VCHWYREY.js} +3 -3
- package/dist/{chunk-6W4XHOR2.js.map → chunk-VCHWYREY.js.map} +1 -1
- package/dist/{chunk-BWXF34WW.js → chunk-WAUWKYLF.js} +3 -3
- package/dist/{chunk-BWXF34WW.js.map → chunk-WAUWKYLF.js.map} +1 -1
- package/dist/{chunk-44PLEHQS.js → chunk-X62EMX7Y.js} +4 -4
- package/dist/chunk-X62EMX7Y.js.map +1 -0
- package/dist/{chunk-XYUCAZS6.cjs → chunk-XQBBBQZH.cjs} +39 -39
- package/dist/chunk-XQBBBQZH.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.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 +70 -50
- package/dist/entries/media.d.cts +74 -1
- package/dist/entries/media.d.ts +74 -1
- 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 +276 -276
- package/dist/entries/models.d.cts +6 -4
- package/dist/entries/models.d.ts +6 -4
- 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 +1 -1
- package/dist/entries/pipeline.d.ts +1 -1
- 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 +1123 -1103
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +18 -18
- package/dist/{model-constants-BL-Ae0OU.d.ts → model-constants-DZUGVDOw.d.cts} +13 -3
- package/dist/{model-constants-BL-Ae0OU.d.cts → model-constants-DZUGVDOw.d.ts} +13 -3
- package/package.json +1 -1
- package/src/__tests__/video-face-mesh.test.ts +51 -0
- package/src/cast-swap-limits.ts +4 -2
- package/src/entries/media.ts +1 -0
- package/src/model-catalog.ts +6 -14
- package/src/model-constants.ts +16 -9
- package/src/video-face-mesh.ts +88 -0
- package/dist/chunk-3O6JBTJW.js.map +0 -1
- package/dist/chunk-44PLEHQS.js.map +0 -1
- package/dist/chunk-CRCQCK6X.cjs.map +0 -1
- package/dist/chunk-G7MSESCZ.js.map +0 -1
- package/dist/chunk-KZGGUDAB.js.map +0 -1
- package/dist/chunk-TQH7DYZP.cjs.map +0 -1
- package/dist/chunk-UEXF2XQH.cjs +0 -27
- package/dist/chunk-XYUCAZS6.cjs.map +0 -1
package/src/model-constants.ts
CHANGED
|
@@ -819,19 +819,27 @@ export const IMAGE_I2I_PROVIDERS = [
|
|
|
819
819
|
"flux-fill",
|
|
820
820
|
] as const
|
|
821
821
|
|
|
822
|
-
/**
|
|
822
|
+
/**
|
|
823
|
+
* Image editing providers (upscale, remove bg, etc.)
|
|
824
|
+
*
|
|
825
|
+
* `grok-upscale` was retired 2026-10-29: it never upscaled an image. The id was
|
|
826
|
+
* wired to the provider's `grok-imagine/upscale`, which upscales a Grok VIDEO
|
|
827
|
+
* task (its task id must be a text-to-video or image-to-video task), and the
|
|
828
|
+
* provider offers no Grok image upscale at all — every run was refused
|
|
829
|
+
* upstream. Its price row is removed by migration 567; the edit-image route
|
|
830
|
+
* answers the id with a 400 naming the replacement. A Grok video upscale, if
|
|
831
|
+
* ever offered, is a new id on the video-upscale node.
|
|
832
|
+
*/
|
|
823
833
|
export const IMAGE_EDIT_PROVIDERS = [
|
|
824
834
|
"recraft-upscale",
|
|
825
835
|
"recraft-remove-bg",
|
|
826
836
|
"nano-banana-edit",
|
|
827
837
|
"topaz-image-upscale",
|
|
828
|
-
//
|
|
829
|
-
// see edit-image route for the taskId-vs-imageUrl
|
|
830
|
-
|
|
831
|
-
//
|
|
832
|
-
// grok-2-
|
|
833
|
-
// targeted via mask indexes from grok-2-segment. grok-2-segment: FREE named
|
|
834
|
-
// segment-mask map of a prior grok-2 generation.
|
|
838
|
+
// Grok Imagine 2 task-chained ops — a prior grok-2 generation's task_id (NOT
|
|
839
|
+
// an image URL); see the edit-image route for the taskId-vs-imageUrl
|
|
840
|
+
// branching. grok-2-edit: prompt edit of a prior grok-2 generation,
|
|
841
|
+
// optionally region-targeted via mask indexes from grok-2-segment.
|
|
842
|
+
// grok-2-segment: FREE named segment-mask map of a prior grok-2 generation.
|
|
835
843
|
"grok-2-edit",
|
|
836
844
|
"grok-2-segment",
|
|
837
845
|
] as const
|
|
@@ -849,7 +857,6 @@ export const IMAGE_EDIT_PROVIDERS = [
|
|
|
849
857
|
* built from it, so the two cannot disagree.
|
|
850
858
|
*/
|
|
851
859
|
export const TASK_CHAINED_EDIT_PROVIDER_IDS = [
|
|
852
|
-
"grok-upscale",
|
|
853
860
|
"grok-2-edit",
|
|
854
861
|
"grok-2-segment",
|
|
855
862
|
] as const satisfies readonly (typeof IMAGE_EDIT_PROVIDERS)[number][]
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Video Face Mesh (`POST /v1/video-face-mesh`, job type `video-face-mesh`):
|
|
3
|
+
* thin face lines — a blue mesh, a blue lip outline, green eye outlines —
|
|
4
|
+
* drawn on the faces of a clip, frame for frame. An internal step of Nodaro
|
|
5
|
+
* Motion's face masking: the lines go on the masked (or depth) clip so the
|
|
6
|
+
* video model still sees where the mouth and the eyes are.
|
|
7
|
+
*
|
|
8
|
+
* Priced by the clip's length at the 30 fps basis Video Mask uses
|
|
9
|
+
* (`videoMaskBilledSeconds`), one row per length bucket.
|
|
10
|
+
*/
|
|
11
|
+
import { VIDEO_MASK_LIMITS, type VideoMaskZone } from "./video-mask.js"
|
|
12
|
+
|
|
13
|
+
/** The route, as the Cast Swap engine calls it. */
|
|
14
|
+
export const VIDEO_FACE_MESH_PATH = "/v1/video-face-mesh"
|
|
15
|
+
|
|
16
|
+
export const VIDEO_FACE_MESH_LIMITS = {
|
|
17
|
+
/** The longest clip a run accepts, in seconds of PRICED length (the 30 fps basis): Video Mask's own cap. */
|
|
18
|
+
MAX_BILLED_SEC: VIDEO_MASK_LIMITS.MAX_BILLED_SEC,
|
|
19
|
+
/** `minFaceHeightPct` / `maxFaceHeightPct` bounds (0 = off). */
|
|
20
|
+
FACE_HEIGHT_PCT_MIN: 0,
|
|
21
|
+
FACE_HEIGHT_PCT_MAX: 100,
|
|
22
|
+
/** `zone` margin bounds, as Video Mask's. */
|
|
23
|
+
ZONE_MARGIN_PCT_MIN: VIDEO_MASK_LIMITS.ZONE_MARGIN_PCT_MIN,
|
|
24
|
+
ZONE_MARGIN_PCT_MAX: VIDEO_MASK_LIMITS.ZONE_MARGIN_PCT_MAX,
|
|
25
|
+
} as const
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The version of what a face mesh run draws for a given clip and settings:
|
|
29
|
+
* every finished `video-face-mesh` job reports it as `output_data.recipe`,
|
|
30
|
+
* for the caller to record beside a clip it stores with the lines on it (a
|
|
31
|
+
* trend's approved face mask). Nothing on the platform compares it yet: a
|
|
32
|
+
* stored mask is held to Video Mask's recipe and the engine's own.
|
|
33
|
+
*
|
|
34
|
+
* BUMP IT (to the date of the change) whenever the drawing changes for the
|
|
35
|
+
* same input: the model, the crop, the smoothing, the filters, the colours or
|
|
36
|
+
* the widths. Never for pricing, limits or messages.
|
|
37
|
+
*/
|
|
38
|
+
export const VIDEO_FACE_MESH_RECIPE = "2026-10-31"
|
|
39
|
+
|
|
40
|
+
const VIDEO_FACE_MESH_BUCKETS_SEC = [5, 10, 15, 30, 60, 120, 300] as const
|
|
41
|
+
|
|
42
|
+
/** Every price row, smallest first (`video-face-mesh:<n>s`). */
|
|
43
|
+
export function videoFaceMeshCreditIds(): string[] {
|
|
44
|
+
return VIDEO_FACE_MESH_BUCKETS_SEC.map((sec) => `video-face-mesh:${sec}s`)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The price row for a clip priced at `billedSec` seconds: the smallest bucket
|
|
49
|
+
* that holds it. An unknown or non-positive length, or one past the cap,
|
|
50
|
+
* prices the LONGEST row (the route measures every clip and refuses one past
|
|
51
|
+
* the cap, so this is only ever a ceiling).
|
|
52
|
+
*/
|
|
53
|
+
export function videoFaceMeshCreditId(billedSec: number | null | undefined): string {
|
|
54
|
+
const ids = videoFaceMeshCreditIds()
|
|
55
|
+
if (typeof billedSec !== "number" || !Number.isFinite(billedSec) || billedSec <= 0) return ids[ids.length - 1]!
|
|
56
|
+
const i = VIDEO_FACE_MESH_BUCKETS_SEC.findIndex((b) => billedSec <= b)
|
|
57
|
+
return ids[i === -1 ? ids.length - 1 : i]!
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** `POST /v1/video-face-mesh` request body. */
|
|
61
|
+
export interface VideoFaceMeshRequest {
|
|
62
|
+
/** The clip the faces are FOUND in (the original). */
|
|
63
|
+
readonly videoUrl: string
|
|
64
|
+
/** The clip the lines are DRAWN on (default `videoUrl`): the masked or depth clip. Same frame count. */
|
|
65
|
+
readonly drawOnUrl?: string
|
|
66
|
+
/** A mask video (white = covered, same frame count): only faces whose box centre lies inside it are drawn. */
|
|
67
|
+
readonly maskUrl?: string
|
|
68
|
+
/** Draw only faces at least this % of the frame's height (default 0 = off). */
|
|
69
|
+
readonly minFaceHeightPct?: number
|
|
70
|
+
/** Draw only faces at most this % of the frame's height (0 = no cap). */
|
|
71
|
+
readonly maxFaceHeightPct?: number
|
|
72
|
+
/** Margins (% of the frame) where no face is drawn. */
|
|
73
|
+
readonly zone?: Partial<VideoMaskZone> | null
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** A finished `video-face-mesh` job's `output_data`. */
|
|
77
|
+
export interface VideoFaceMeshOutput {
|
|
78
|
+
/** The drawn clip: `drawOnUrl`'s frame count, size and frame rate, its audio copied untouched. */
|
|
79
|
+
readonly videoUrl: string
|
|
80
|
+
readonly width: number
|
|
81
|
+
readonly height: number
|
|
82
|
+
readonly frames: number
|
|
83
|
+
/** Frames with at least one face drawn. */
|
|
84
|
+
readonly framesWithFaces: number
|
|
85
|
+
/** Faces drawn, summed over the frames (0 = nothing drawn; the clip comes back as it was sent). */
|
|
86
|
+
readonly facesDrawn: number
|
|
87
|
+
readonly recipe: string
|
|
88
|
+
}
|