@melite/models-h3 0.1.4-alpha → 0.2.0-alpha

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/lib/reshoot.js ADDED
@@ -0,0 +1,352 @@
1
+ /** The pack's clip-normalization node (the official chain's first
2
+ * stage — resamples to 24 fps, snaps the frame count to H3's 17k+5
3
+ * grid, centre-crops to the requested aspect at the pixel budget).
4
+ * The F13d grid-match burn this node kills at the source: the old
5
+ * chain resized VDA depth onto full-size frames by hand. */
6
+ export const CROSSVIEW_PREPARE_NODE = 'CrossViewPrepareClip';
7
+ /** The pack's reprojection node (the one class the pack always
8
+ * carried; the official graph wires moge_geometry, the metric
9
+ * input — never the legacy brightness-depth seat). */
10
+ export const CROSSVIEW_WARP_NODE = 'CrossViewWarp';
11
+ /** Core MoGe nodes (engine comfy_extras/nodes_moge.py — v0.37+,
12
+ * no pack provision rides them). */
13
+ export const MOGE_LOAD_NODE = 'LoadMoGeModel';
14
+ export const MOGE_INFER_NODE = 'MoGeInference';
15
+ /** The prepare node's own clock (it resamples every clip to 24 fps
16
+ * before the warp sees it) — the unit the guide duration is stated
17
+ * in. */
18
+ export const CROSSVIEW_PREP_FPS = 24;
19
+ /** The shortest window a re-shoot will guide: one second of prepared
20
+ * motion. Below this the warp carries no usable parallax and the
21
+ * guide outlives the window it is pinned into. */
22
+ export const CROSSVIEW_MIN_GUIDE_FRAMES = CROSSVIEW_PREP_FPS;
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+ export function crossviewGuideSeconds(windowFrames) {
40
+ if (!Number.isFinite(windowFrames) || windowFrames <= 0) {
41
+ throw new Error('h3 re-shoot: the guide needs the window length in frames — a re-shoot window of ' + String(windowFrames) + ' frames cannot carry the camera guide');
42
+ }
43
+ if (windowFrames < CROSSVIEW_MIN_GUIDE_FRAMES) {
44
+ throw new Error('h3 re-shoot: window too short for the camera guide — ' + String(Math.round(windowFrames)) + ' frames is below the ' + String(CROSSVIEW_MIN_GUIDE_FRAMES) + '-frame floor (one second at ' + String(CROSSVIEW_PREP_FPS) + ' fps); author the re-shoot call on a longer span');
45
+ }
46
+ return windowFrames / CROSSVIEW_PREP_FPS;
47
+ }
48
+ /** MoGe-2 ViTL normal fp16 — the official workflow's one geometry
49
+ * checkpoint (Comfy-Org/MoGe on HF), already on the engine's
50
+ * geometry_estimation shelf. */
51
+ export const MOGE_MODEL = 'moge_2_vitl_normal_fp16.safetensors';
52
+ /** The CrossView LoRA (Cseti/MiniMax-H3_Ref2VA-LoRA-CrossView-Warp_v1
53
+ * on HF, the _3500 step file comfy-reshoot pins): trained against
54
+ * the warp guide, it is what makes H3 FOLLOW the moved camera.
55
+ * Arm-functional, not a Modifiers row — the Fun ControlNet patch
56
+ * precedent (a per-arm model file provisioned by the family, never
57
+ * a user-picked distill seat; the catalog is for adapters a user
58
+ * stacks freely, and this one is meaningless outside a reshoot). */
59
+ export const CROSSVIEW_LORA = 'h3/MiniMax-H3_Ref2VA-LoRA-CrossView-Warp_v1_3500.safetensors';
60
+ /** The LoRA's trigger word (the pack's own docs + the official
61
+ * graph's prompt is exactly `crossview.`) — rides the r2v prompt
62
+ * when the arm is armed, or the LoRA does not fire. */
63
+ export const CROSSVIEW_TRIGGER = 'crossview';
64
+ const num = (e, key, fallback) => {
65
+ const v = e[key];
66
+ return typeof v === 'number' && Number.isFinite(v) ? v : fallback;
67
+ };
68
+ /** The dial bands — MIRRORED from the card's RESHOOT_MOD field rows
69
+ * (the UI's own bounds; the wall judges the two homes in 1:1
70
+ * agreement). A bag entry rides the compose door as a loose dict,
71
+ * so the READER owns the refusal — out-of-domain dials refuse LOUD
72
+ * here, ahead of the engine, never as a ComfyUI widget 400. */
73
+ /** The app's default camera move (see {@link readReshootKnobs}). */
74
+ export const RESHOOT_DEFAULT_POSE = {
75
+ orbit: -30,
76
+ tilt: 20,
77
+ };
78
+ /** The smallest pose the CrossView LoRA accepts as a camera MOVE. The
79
+ * pack's README: "Avoid near-zero angles — the LoRA misbehaves when
80
+ * the warp is almost identical to the source." Below this both-angle
81
+ * floor the warp is the input clip plus hole noise, and the guide
82
+ * prior contradicts the source prior instead of extending it. */
83
+ export const RESHOOT_MIN_POSE_DEGREES = 5;
84
+ export const RESHOOT_DIAL_BOUNDS = {
85
+ orbit: [-180, 180],
86
+ tilt: [-90, 90],
87
+ dolly: [0.1, 3],
88
+ zoom: [20, 120],
89
+ pan: [-1, 1],
90
+ strength: [0.5, 1],
91
+ depth_ratio: [1.5, 1000],
92
+ };
93
+ const banded = (e, key, fallback) => {
94
+ const v = num(e, key, fallback);
95
+ const [lo, hi] = RESHOOT_DIAL_BOUNDS[key];
96
+ if (v < lo || v > hi) {
97
+ throw new Error(`h3 re-shoot: the bag's ${key} dial is ${v} — outside the camera band [${lo}, ${hi}] (the card's Reshoot rows state the same bounds); refuse ahead of the engine, never a widget 400`);
98
+ }
99
+ return v;
100
+ };
101
+ /** The bag's first (and only — max_stack 1) entry, typed loose. */
102
+ const bagEntry = (p) => {
103
+ const bag = p.reshoot;
104
+ if (!Array.isArray(bag) || bag.length === 0)
105
+ return undefined;
106
+ const e = bag[0];
107
+ return typeof e === 'object' && e !== null && !Array.isArray(e)
108
+ ? e
109
+ : undefined;
110
+ };
111
+ /** THE OFFICIAL APP'S POSE (Comfy-Org/comfy-reshoot,
112
+ * workflows/generate.api.json node 5: azimuth -30, elevation 20, the
113
+ * app's own slider defaults) — never the identity camera. The pack's
114
+ * README names the failure mode verbatim: "Avoid near-zero angles —
115
+ * the LoRA misbehaves when the warp is almost identical to the
116
+ * source." The identity default shipped a warp indistinguishable from
117
+ * the input, fed it to a camera LoRA as the geometric prior, and
118
+ * round 5 measured the result (a second subject at a second scale).
119
+ * The neutral pose is therefore the app's DEFAULT camera move: orbit
120
+ * -30°, tilt +20° (inside the green training zone), the source
121
+ * distance, a normal 50° lens, no framing shift. The
122
+ * strength default is the official 0.8 (the LoRA's own tested
123
+ * band is 0.5–1, served default 0.8). */
124
+ export function readReshootKnobs(p) {
125
+ const e = bagEntry(p) ?? {};
126
+ return {
127
+ orbit: banded(e, 'orbit', RESHOOT_DEFAULT_POSE.orbit),
128
+ tilt: banded(e, 'tilt', RESHOOT_DEFAULT_POSE.tilt),
129
+ dolly: banded(e, 'dolly', 1.0),
130
+ zoom: banded(e, 'zoom', 50),
131
+ pan: banded(e, 'pan', 0),
132
+ strength: banded(e, 'strength', 0.8),
133
+ depthRatio: banded(e, 'depth_ratio', 6),
134
+ smoothDepth: e.smooth_depth === true,
135
+ invertDepth: e.invert_depth === true,
136
+ };
137
+ }
138
+ /** The arm predicate: BAG PRESENCE — the same law as the replace/
139
+ * repair/extend arms (the fourth-mod-bag unification: a commission
140
+ * is armed when its bag is a NON-EMPTY ARRAY, whatever its entry's
141
+ * shape). A non-object entry and a bag whose entry names no source
142
+ * clip both stay ARMED and refuse loud at the chain build (the
143
+ * compose's missing-required law) — neither quietly disarms the
144
+ * film. Absent or empty bag = the compose never sees the chain
145
+ * (byte-stable graphs). */
146
+ export function reshootArmed(p) {
147
+ const bag = p.reshoot;
148
+ return Array.isArray(bag) && bag.length > 0;
149
+ }
150
+ /** The r2v prompt seat under the arm: the trigger word leads (the
151
+ * official graph's prompt is exactly `crossview.` — the LoRA fires
152
+ * on the word's presence, the estate's own motion prose follows). */
153
+ export function reshootPrompt(prompt) {
154
+ return `${CROSSVIEW_TRIGGER}. ${prompt}`.trim();
155
+ }
156
+ /**
157
+ * Build the re-shoot chain on the run's graph (once per compose).
158
+ *
159
+ * @param p the gated compose doc (the reshoot bag's entry carries
160
+ * source_clip + the camera knobs; reshootArmed gates the build)
161
+ * @param g the run's graph builder
162
+ * @param windowFrames the SHORTEST window this run renders (the guide
163
+ * is pinned into every window, so its duration derives from this —
164
+ * F28)
165
+ * @param runId the run's own id — scopes the two preview saves under
166
+ * the run's output folder so the artifact harvest lists them with
167
+ * the film (§8.7)
168
+ * @returns the shared handles for the per-window seats
169
+ */
170
+ export function buildH3Reshoot(p, g, windowFrames, runId) {
171
+ const entry = bagEntry(p);
172
+ const clip = (entry?.source_clip ?? '').trim();
173
+ if (clip === '') {
174
+ throw new Error('h3 re-shoot: the reshoot bag carries an entry but names no source clip — a re-shoot needs the video whose scene the new camera views');
175
+ }
176
+ const knobs = readReshootKnobs(p);
177
+ // THE IDENTITY CAMERA IS NOT A RE-SHOOT (the pack README's warning as
178
+ // a compose-door refusal): a pose with no orbit and no tilt builds a
179
+ // warp almost identical to the source, which is the one condition the
180
+ // CrossView LoRA documents as misbehaving.
181
+ if (Math.abs(knobs.orbit) < RESHOOT_MIN_POSE_DEGREES &&
182
+ Math.abs(knobs.tilt) < RESHOOT_MIN_POSE_DEGREES) {
183
+ throw new Error(`h3 re-shoot: the camera pose is ${knobs.orbit}° orbit / ${knobs.tilt}° tilt — both under the ${RESHOOT_MIN_POSE_DEGREES}° floor, so the warp is almost identical to the source; the CrossView pack documents that pose as the one the LoRA misbehaves on ("avoid near-zero angles"). Set orbit or tilt to a real move (the app's default is -30° / +20°)`);
184
+ }
185
+
186
+ // one node that emits the VIDEO type CrossViewPrepareClip demands.
187
+ // The sibling arms' VHS seat stays theirs — VHS serves force-rate
188
+ // frames + audio for chains that consume frames; this chain hands
189
+ // the WHOLE video to the prepare node, which owns the resample
190
+ // (24 fps), the frame-grid snap and the crop — the staged leaf
191
+ // binds by name on the same input directory both loaders read.
192
+ const video = g.node('LoadVideo', { file: clip }).out(0);
193
+ // stage 1 — normalize: every downstream grid fact (width, height,
194
+ // length) comes from THIS node's outputs, never the raw clip
195
+
196
+ // TARGET's, never the pack's 0.5 MP default. The round-4 researh
197
+ // measured the cost of the default: a 0.97 MP plate squeezed to
198
+ // ~942×530 fed BOTH ref_video_0 and the guide for a 1344×768
199
+ // render — 48 % of the plate discarded, then reconstructed at
200
+ // 2.06×, which is the soft render the operator saw. The budget
201
+ // therefore tracks the window shape the doc states.
202
+ const targetW = p.width;
203
+ const targetH = p.height;
204
+ if (!Number.isFinite(targetW) || !Number.isFinite(targetH)) {
205
+ throw new Error('h3 re-shoot: the plate budget reads the render target — the doc carries no finite width/height (' + String(targetW) + '×' + String(targetH) + '); re-shoot documents walk the schema first (1344×768 are the declared defaults)');
206
+ }
207
+ const targetMp = (targetW * targetH) / 1_000_000;
208
+ const prep = g.node(CROSSVIEW_PREPARE_NODE, {
209
+ video,
210
+ duration: crossviewGuideSeconds(windowFrames),
211
+ aspect_ratio: 'source',
212
+ megapixels: Number(targetMp.toFixed(3)),
213
+ multiple: 32,
214
+ });
215
+ // metric geometry — MoGe-2 with forced projection and mask refine
216
+ // (the official literals; brightness depth died with the old chain)
217
+ const moge = g.node(MOGE_LOAD_NODE, { model_name: MOGE_MODEL }).out(0);
218
+ const geometry = g.node(MOGE_INFER_NODE, {
219
+ moge_model: moge,
220
+ image: prep.out(0),
221
+ resolution_level: 2,
222
+ fov_x_degrees: 0,
223
+ batch_size: 4,
224
+ force_projection: true,
225
+ apply_mask: true,
226
+ refine_steps: 3,
227
+ }).out(0);
228
+ // the warp — every literal below is the official graph's own
229
+ // (pose dials from the bag, the rest the verified posture)
230
+ const warpNode = g.node(CROSSVIEW_WARP_NODE, {
231
+ frames: prep.out(0),
232
+ moge_geometry: geometry,
233
+ azimuth: knobs.orbit,
234
+ elevation: knobs.tilt,
235
+ distance: knobs.dolly,
236
+ hfov: knobs.zoom,
237
+ vertical_shift: knobs.pan,
238
+ depth_ratio: knobs.depthRatio,
239
+ smooth_depth: knobs.smoothDepth,
240
+ invert_depth: knobs.invertDepth,
241
+ roll_lock: false,
242
+ pivot_override: false,
243
+ pivot_x: 0.0,
244
+ pivot_y: 0.0,
245
+ pivot_z: 1.05,
246
+ use_keyframes: false,
247
+ frame_count: 0,
248
+ keyframes: '',
249
+ interp_motion: 'linear',
250
+ interpolation: 'linear',
251
+ keep_source_aim: true,
252
+ preview_size: 384,
253
+ frame_index: 1,
254
+ });
255
+ // THE TWO SEATS ARE THE OFFICIAL APP'S OWN (Comfy-Org/comfy-reshoot,
256
+
257
+ // ref_videos.ref_video_0 <- CrossViewPrepareClip.out(0)
258
+ // (node 20 inputs; the SOURCE clip —
259
+ // appearance + identity)
260
+ // MiniMaxH3AddGuide.image <- CrossViewWarp.out(0)
261
+ // (node 21 inputs; the warp WITH its
262
+ // magenta disocclusions — the training
263
+ // signal, never a fill)
264
+ // This builder had collapsed both seats onto a filled warp (the
265
+ // F30 hole fill, which round 5 measured as a second full-size
266
+ // subject). The official app runs NO mask, NO grow, NO composite
267
+ // and NO blur: the CrossView LoRA was trained on the holed warp
268
+ // and reconstructs what the camera never saw, while the clean
269
+ // source clip carries identity. Those are the two priors, and the
270
+ // collapse is what starved the render.
271
+ const warp = warpNode.out(0);
272
+ const source = prep.out(0);
273
+ // THE TWO WITNESSES (§8.7): the plate the guide PINS and the pack's
274
+ // `orbit_view` gizmo (output 1: the camera dome with its
275
+ // az/el/dist overlay). Both save under the run's folder — zero
276
+ // extra compute (the tensors already exist), and the harvest lists
277
+ // them beside the film.
278
+ //
279
+ // ONE plate, never the warp clip: CrossViewWarp emits every warped
280
+ // frame, so saving `warp` raw wrote N PNGs per re-shoot (the
281
+ // operator's 90-file harvest of one still, report §13.1). The guide
282
+ // reads frame 0 (`MiniMaxH3AddGuide.frame_idx 0`), so the witness
283
+ // selects exactly that frame — the same take the guide pinned,
284
+ // holes and all, which is what makes the witness evidence.
285
+ const plate = g.node('ImageFromBatch', {
286
+ image: warp,
287
+ batch_index: 0,
288
+ length: 1,
289
+ }).out(0);
290
+ const plateSave = g.node('SaveImage', {
291
+ images: plate,
292
+ filename_prefix: `${runId}/reshoot_warp`,
293
+ }).out(0);
294
+ const orbitSave = g.node('SaveImage', {
295
+ images: warpNode.out(1),
296
+ filename_prefix: `${runId}/reshoot_orbit`,
297
+ }).out(0);
298
+ return {
299
+ refFrames: source,
300
+ warp,
301
+ plateSave,
302
+ orbitSave,
303
+ prepWidth: prep.out(1),
304
+ prepHeight: prep.out(2),
305
+ prepLength: prep.out(3),
306
+ };
307
+ }
308
+ /**
309
+ * The per-window MODEL seat: the CrossView LoRA on the window's
310
+ * model, post sigma shift (the official order — the distill lora
311
+ * loads first, the shift + attention ride over it, the CrossView
312
+ * LoRA applies LAST so the camera-trained adapters win). Mounted
313
+ * ahead of the file-based picks chain — the camera spine; picks
314
+ * refine on top.
315
+ *
316
+ * @param g the window's (scoped) builder
317
+ * @param model the window's model so far (post sigma shift)
318
+ * @param p the gated doc (the strength dial rides, band 0.5–1)
319
+ * @returns the LoRA-loaded model handle for the scheduler chain
320
+ */
321
+ export function applyH3ReshootModel(g, model, p) {
322
+ return g.node('LoraLoaderModelOnly', {
323
+ model,
324
+ lora_name: CROSSVIEW_LORA,
325
+ strength_model: readReshootKnobs(p).strength,
326
+ }).out();
327
+ }
328
+ /**
329
+ * The per-window CONDITIONING seat: the warp pinned into the
330
+ * window's own AV latent at row 0 through MiniMaxH3AddGuide — the
331
+ * H3-native guide lane (the same node the estate's keyframe pins
332
+ * ride), the official chain's image seat verbatim. Mounts AFTER the
333
+ * arm's own guide pins (audio first, keyframes next, the camera
334
+ * spine last — the strongest structural prior closes the chain).
335
+ *
336
+ * @param g the window's (scoped) builder
337
+ * @param cond the window's positive conditioning so far
338
+ * @param latent the window's latent (the guide pins into it)
339
+ * @param vae the window's video VAE (the guide image encodes through it)
340
+ * @param chain the shared run-level handles
341
+ * @returns the guide-wrapped conditioning for the guider
342
+ */
343
+ export function applyH3ReshootCond(g, cond, latent, vae, chain) {
344
+ return g.node('MiniMaxH3AddGuide', {
345
+ positive: cond,
346
+ latent,
347
+ vae,
348
+ image: chain.warp,
349
+ frame_idx: 0,
350
+ }).out(0);
351
+ }
352
+ //# sourceMappingURL=reshoot.js.map
package/lib/schema.d.ts CHANGED
@@ -4,19 +4,31 @@ export declare const FAMILIES: readonly ["t4r", "t4_open", "t4_chain"];
4
4
  export type Family = (typeof FAMILIES)[number];
5
5
  export declare const wireList: typeof normalizeDeclaredRefs;
6
6
  export declare const H3_RECOMMENDED_SAMPLERS: readonly ["euler", "euler_cfg_pp", "euler_ancestral", "dpmpp_2m", "dpmpp_2m_sde", "heun", "res_multistep", "res_multistep_cfg_pp", "er_sde", "seeds_2", "seeds_3"];
7
- export declare const JSON_ARRAY_PARAMS: readonly ["calls", "audio_clips"];
7
+ export declare const JSON_ARRAY_PARAMS: readonly ["calls", "audio_clips", "keyframes"];
8
8
  export declare const paramSchema: z<Schemastery.ObjectS<NoInfer<{
9
- prompt: z<string, string, "plain">;
10
9
  image: z<string, string, "plain">;
11
10
  last_frame: z<string, string, "plain">;
12
11
  ref_images: z<string[], string[], "plain">;
13
12
  ref_videos: z<string[], string[], "plain">;
13
+ ref_video_trims: z<({
14
+ start_time?: number | null | undefined;
15
+ duration?: number | null | undefined;
16
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<NoInfer<{
17
+ start_time: z<number, number, "defined">;
18
+ duration: z<number, number, "defined">;
19
+ }>>[], "plain">;
14
20
  ref_audios: z<string[], string[], "plain">;
21
+ ref_mods: z<string[], string[], "plain">;
22
+ refmod_mode: z<string, string, "defined">;
23
+ refmod_pool: z<number, number, "defined">;
24
+ refmod_identity: z<number, number, "defined">;
25
+ refmod_save: z<boolean, boolean, "defined">;
15
26
  duck_depth_db: z<number, number, "defined">;
16
27
  seed: z<number, number, "defined">;
17
28
  width: z<number, number, "defined">;
18
29
  height: z<number, number, "defined">;
19
30
  length: z<number, number, "defined">;
31
+ fps: z<number, number, "defined">;
20
32
  steps: z<number, number, "defined">;
21
33
  second_pass_enabled: z<boolean, boolean, "defined">;
22
34
  sharpen_enabled: z<boolean, boolean, "defined">;
@@ -28,6 +40,9 @@ export declare const paramSchema: z<Schemastery.ObjectS<NoInfer<{
28
40
  refine_lora: z<string, string, "defined">;
29
41
  refine_strength: z<number, number, "plain">;
30
42
  refine_steps: z<number, number, "plain">;
43
+ refine_denoise: z<number, number, "defined">;
44
+ upscale_route: z<string, string, "defined">;
45
+ upscale_model: z<string, string, "defined">;
31
46
  attention_backend: z<string, string, "defined">;
32
47
  interp_model: z<string, string, "defined">;
33
48
  interp_multiplier: z<number, number, "defined">;
@@ -48,29 +63,41 @@ export declare const paramSchema: z<Schemastery.ObjectS<NoInfer<{
48
63
  sla_protect_audio: z<boolean, boolean, "defined">;
49
64
  sla_stabilize_motion: z<boolean, boolean, "plain">;
50
65
  sla_disable_fp16_accum: z<boolean, boolean, "defined">;
51
- sharpen_method: z<string, string, "plain">;
66
+ sharpen_method: z<string, string, "defined">;
52
67
  sharpen_radius: z<number, number, "plain">;
53
68
  sharpen_threshold: z<number, number, "plain">;
54
69
  sharpen_iterations: z<number, number, "plain">;
55
70
  k: z<number, number, "plain">;
56
71
  noise_seed: z<number, number, "plain">;
57
- fps_seconds: z<number, number, "defined">;
72
+ fps_seconds: z<number, number, "plain">;
58
73
  interp_switch: z<boolean, boolean, "plain">;
59
74
  sharpen_switch: z<boolean, boolean, "plain">;
60
75
  sla_switch: z<boolean, boolean, "plain">;
61
76
  image_name: z<string, string, "plain">;
62
77
  }>>, Schemastery.ObjectT<NoInfer<{
63
- prompt: z<string, string, "plain">;
64
78
  image: z<string, string, "plain">;
65
79
  last_frame: z<string, string, "plain">;
66
80
  ref_images: z<string[], string[], "plain">;
67
81
  ref_videos: z<string[], string[], "plain">;
82
+ ref_video_trims: z<({
83
+ start_time?: number | null | undefined;
84
+ duration?: number | null | undefined;
85
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<NoInfer<{
86
+ start_time: z<number, number, "defined">;
87
+ duration: z<number, number, "defined">;
88
+ }>>[], "plain">;
68
89
  ref_audios: z<string[], string[], "plain">;
90
+ ref_mods: z<string[], string[], "plain">;
91
+ refmod_mode: z<string, string, "defined">;
92
+ refmod_pool: z<number, number, "defined">;
93
+ refmod_identity: z<number, number, "defined">;
94
+ refmod_save: z<boolean, boolean, "defined">;
69
95
  duck_depth_db: z<number, number, "defined">;
70
96
  seed: z<number, number, "defined">;
71
97
  width: z<number, number, "defined">;
72
98
  height: z<number, number, "defined">;
73
99
  length: z<number, number, "defined">;
100
+ fps: z<number, number, "defined">;
74
101
  steps: z<number, number, "defined">;
75
102
  second_pass_enabled: z<boolean, boolean, "defined">;
76
103
  sharpen_enabled: z<boolean, boolean, "defined">;
@@ -82,6 +109,9 @@ export declare const paramSchema: z<Schemastery.ObjectS<NoInfer<{
82
109
  refine_lora: z<string, string, "defined">;
83
110
  refine_strength: z<number, number, "plain">;
84
111
  refine_steps: z<number, number, "plain">;
112
+ refine_denoise: z<number, number, "defined">;
113
+ upscale_route: z<string, string, "defined">;
114
+ upscale_model: z<string, string, "defined">;
85
115
  attention_backend: z<string, string, "defined">;
86
116
  interp_model: z<string, string, "defined">;
87
117
  interp_multiplier: z<number, number, "defined">;
@@ -102,13 +132,13 @@ export declare const paramSchema: z<Schemastery.ObjectS<NoInfer<{
102
132
  sla_protect_audio: z<boolean, boolean, "defined">;
103
133
  sla_stabilize_motion: z<boolean, boolean, "plain">;
104
134
  sla_disable_fp16_accum: z<boolean, boolean, "defined">;
105
- sharpen_method: z<string, string, "plain">;
135
+ sharpen_method: z<string, string, "defined">;
106
136
  sharpen_radius: z<number, number, "plain">;
107
137
  sharpen_threshold: z<number, number, "plain">;
108
138
  sharpen_iterations: z<number, number, "plain">;
109
139
  k: z<number, number, "plain">;
110
140
  noise_seed: z<number, number, "plain">;
111
- fps_seconds: z<number, number, "defined">;
141
+ fps_seconds: z<number, number, "plain">;
112
142
  interp_switch: z<boolean, boolean, "plain">;
113
143
  sharpen_switch: z<boolean, boolean, "plain">;
114
144
  sla_switch: z<boolean, boolean, "plain">;
@@ -123,20 +153,51 @@ export declare const paramSchema: z<Schemastery.ObjectS<NoInfer<{
123
153
  * declared knobs — old drafts keep working because the schema admits
124
154
  * them and the compose door overlays explicit params last (the
125
155
  * img-to-mesh filename_prefix precedent). */
156
+
157
+
158
+
159
+
160
+
161
+
162
+ export declare const REFINE_PLANE_KEYS: readonly ["sched_name", "shift_video", "shift_audio", "sla_enabled", "sla_sparsity", "sla_block_size", "sla_min_seq_len", "sla_dense_last_steps", "sla_protect_audio", "sla_dense_steps", "sla_dense_backend", "sla_disable_fp16_accum", "sla_stabilize_motion", "sla_reference_protection"];
163
+ export declare const refinePlaneSchema: z<Schemastery.ObjectS<NoInfer<{
164
+ [k: string]: z;
165
+ }>>, Schemastery.ObjectT<NoInfer<{
166
+ [k: string]: z;
167
+ }>>, "plain">;
126
168
  export declare const coerceWireBoolean: (raw: Record<string, unknown>) => Record<string, unknown>;
169
+ /** THE PIN ROW SHAPE (one law, two seats): the doc walk and the compose
170
+ * gate both run this BEFORE any placement math — a row must carry a
171
+ * whole film-absolute frame and a non-empty image ref. Exported so the
172
+ * walk's refusal and the build door's are the same literal (the
173
+ * gate-and-walk wall pins them); placement and media existence stay
174
+ * the compose gate's, which owns the doc's calls/windows. */
175
+ export declare function assertKeyframeRowShape(rows: readonly unknown[]): void;
127
176
  export declare function schema(v: unknown): Record<string, unknown>;
128
177
  export declare const carrier: z<Schemastery.ObjectS<NoInfer<{
129
- prompt: z<string, string, "plain">;
130
178
  image: z<string, string, "plain">;
131
179
  last_frame: z<string, string, "plain">;
132
180
  ref_images: z<string[], string[], "plain">;
133
181
  ref_videos: z<string[], string[], "plain">;
182
+ ref_video_trims: z<({
183
+ start_time?: number | null | undefined;
184
+ duration?: number | null | undefined;
185
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<NoInfer<{
186
+ start_time: z<number, number, "defined">;
187
+ duration: z<number, number, "defined">;
188
+ }>>[], "plain">;
134
189
  ref_audios: z<string[], string[], "plain">;
190
+ ref_mods: z<string[], string[], "plain">;
191
+ refmod_mode: z<string, string, "defined">;
192
+ refmod_pool: z<number, number, "defined">;
193
+ refmod_identity: z<number, number, "defined">;
194
+ refmod_save: z<boolean, boolean, "defined">;
135
195
  duck_depth_db: z<number, number, "defined">;
136
196
  seed: z<number, number, "defined">;
137
197
  width: z<number, number, "defined">;
138
198
  height: z<number, number, "defined">;
139
199
  length: z<number, number, "defined">;
200
+ fps: z<number, number, "defined">;
140
201
  steps: z<number, number, "defined">;
141
202
  second_pass_enabled: z<boolean, boolean, "defined">;
142
203
  sharpen_enabled: z<boolean, boolean, "defined">;
@@ -148,6 +209,9 @@ export declare const carrier: z<Schemastery.ObjectS<NoInfer<{
148
209
  refine_lora: z<string, string, "defined">;
149
210
  refine_strength: z<number, number, "plain">;
150
211
  refine_steps: z<number, number, "plain">;
212
+ refine_denoise: z<number, number, "defined">;
213
+ upscale_route: z<string, string, "defined">;
214
+ upscale_model: z<string, string, "defined">;
151
215
  attention_backend: z<string, string, "defined">;
152
216
  interp_model: z<string, string, "defined">;
153
217
  interp_multiplier: z<number, number, "defined">;
@@ -168,29 +232,41 @@ export declare const carrier: z<Schemastery.ObjectS<NoInfer<{
168
232
  sla_protect_audio: z<boolean, boolean, "defined">;
169
233
  sla_stabilize_motion: z<boolean, boolean, "plain">;
170
234
  sla_disable_fp16_accum: z<boolean, boolean, "defined">;
171
- sharpen_method: z<string, string, "plain">;
235
+ sharpen_method: z<string, string, "defined">;
172
236
  sharpen_radius: z<number, number, "plain">;
173
237
  sharpen_threshold: z<number, number, "plain">;
174
238
  sharpen_iterations: z<number, number, "plain">;
175
239
  k: z<number, number, "plain">;
176
240
  noise_seed: z<number, number, "plain">;
177
- fps_seconds: z<number, number, "defined">;
241
+ fps_seconds: z<number, number, "plain">;
178
242
  interp_switch: z<boolean, boolean, "plain">;
179
243
  sharpen_switch: z<boolean, boolean, "plain">;
180
244
  sla_switch: z<boolean, boolean, "plain">;
181
245
  image_name: z<string, string, "plain">;
182
246
  }>>, Schemastery.ObjectT<NoInfer<{
183
- prompt: z<string, string, "plain">;
184
247
  image: z<string, string, "plain">;
185
248
  last_frame: z<string, string, "plain">;
186
249
  ref_images: z<string[], string[], "plain">;
187
250
  ref_videos: z<string[], string[], "plain">;
251
+ ref_video_trims: z<({
252
+ start_time?: number | null | undefined;
253
+ duration?: number | null | undefined;
254
+ } & import("@deepseek-ai/cosmokit").Dict)[], Schemastery.ObjectT<NoInfer<{
255
+ start_time: z<number, number, "defined">;
256
+ duration: z<number, number, "defined">;
257
+ }>>[], "plain">;
188
258
  ref_audios: z<string[], string[], "plain">;
259
+ ref_mods: z<string[], string[], "plain">;
260
+ refmod_mode: z<string, string, "defined">;
261
+ refmod_pool: z<number, number, "defined">;
262
+ refmod_identity: z<number, number, "defined">;
263
+ refmod_save: z<boolean, boolean, "defined">;
189
264
  duck_depth_db: z<number, number, "defined">;
190
265
  seed: z<number, number, "defined">;
191
266
  width: z<number, number, "defined">;
192
267
  height: z<number, number, "defined">;
193
268
  length: z<number, number, "defined">;
269
+ fps: z<number, number, "defined">;
194
270
  steps: z<number, number, "defined">;
195
271
  second_pass_enabled: z<boolean, boolean, "defined">;
196
272
  sharpen_enabled: z<boolean, boolean, "defined">;
@@ -202,6 +278,9 @@ export declare const carrier: z<Schemastery.ObjectS<NoInfer<{
202
278
  refine_lora: z<string, string, "defined">;
203
279
  refine_strength: z<number, number, "plain">;
204
280
  refine_steps: z<number, number, "plain">;
281
+ refine_denoise: z<number, number, "defined">;
282
+ upscale_route: z<string, string, "defined">;
283
+ upscale_model: z<string, string, "defined">;
205
284
  attention_backend: z<string, string, "defined">;
206
285
  interp_model: z<string, string, "defined">;
207
286
  interp_multiplier: z<number, number, "defined">;
@@ -222,13 +301,13 @@ export declare const carrier: z<Schemastery.ObjectS<NoInfer<{
222
301
  sla_protect_audio: z<boolean, boolean, "defined">;
223
302
  sla_stabilize_motion: z<boolean, boolean, "plain">;
224
303
  sla_disable_fp16_accum: z<boolean, boolean, "defined">;
225
- sharpen_method: z<string, string, "plain">;
304
+ sharpen_method: z<string, string, "defined">;
226
305
  sharpen_radius: z<number, number, "plain">;
227
306
  sharpen_threshold: z<number, number, "plain">;
228
307
  sharpen_iterations: z<number, number, "plain">;
229
308
  k: z<number, number, "plain">;
230
309
  noise_seed: z<number, number, "plain">;
231
- fps_seconds: z<number, number, "defined">;
310
+ fps_seconds: z<number, number, "plain">;
232
311
  interp_switch: z<boolean, boolean, "plain">;
233
312
  sharpen_switch: z<boolean, boolean, "plain">;
234
313
  sla_switch: z<boolean, boolean, "plain">;