@melite/models-h3 0.2.0-alpha → 0.2.2-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 CHANGED
@@ -87,16 +87,62 @@ export const RESHOOT_DIAL_BOUNDS = {
87
87
  dolly: [0.1, 3],
88
88
  zoom: [20, 120],
89
89
  pan: [-1, 1],
90
- strength: [0.5, 1],
90
+
91
+ // floor — under 0.8 the warp is followed less and the model's prior
92
+ // rebuilds the frame (the F33 anime drift); the old 0.5 floor left the
93
+ // drift reachable from [0.5, 0.8).)
94
+ strength: [0.8, 1],
91
95
  depth_ratio: [1.5, 1000],
92
96
  };
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`);
97
+ /** The dial defaults (the OFFICIAL app's own slider posture — the
98
+ * identity camera is not a re-shoot, so absent dials never fall to
99
+ * zero). */
100
+ const DIAL_DEFAULTS = {
101
+ orbit: RESHOOT_DEFAULT_POSE.orbit,
102
+ tilt: RESHOOT_DEFAULT_POSE.tilt,
103
+ dolly: 1.0,
104
+ zoom: 50,
105
+ pan: 0,
106
+ strength: 0.8,
107
+ depth_ratio: 6,
108
+ };
109
+
110
+
111
+
112
+
113
+
114
+ const DIAL_UNITS = {
115
+ orbit: 'degrees of orbit (negative orbits left, positive right; ±45 tested)',
116
+ tilt: 'degrees of elevation (positive looks down; below −20 is the weak direction)',
117
+ dolly: 'camera distance where 1.0 keeps the source distance (below 1 dollies in)',
118
+ zoom: 'lens field of view in degrees (50 = a normal lens; NOT a multiplier)',
119
+ pan: 'vertical framing shift as a fraction of frame height (the camera does not move)',
120
+ strength: 'CrossView LoRA strength (the official tested band; under 0.8 the prior rebuilds the frame)',
121
+ depth_ratio: 'scene depth as a far/near ratio (2.5–4 close-ups, 4–8 mid, 8–16 wide)',
122
+ };
123
+ /** THE ALL-DIALS REFUSAL (the F13 cure): the compose iterates every
124
+ * dial anyway — the refusal reports them the same way, each with its
125
+ * band AND its unit, so ONE round trip states the whole camera. The
126
+ * old per-dial throw burned five presses on one bag entry (zoom,
127
+ * dolly, pan, strength, depth_ratio — each refusal naming exactly
128
+ * one dial and nothing else).
129
+ * @param e the bag's entry (the dial seat values, loose)
130
+ * @returns every dial's in-band value, keyed by wire name */
131
+ const bandedAll = (e) => {
132
+ const bad = [];
133
+ const dials = {};
134
+ for (const key of Object.keys(RESHOOT_DIAL_BOUNDS)) {
135
+ const v = num(e, key, DIAL_DEFAULTS[key]);
136
+ dials[key] = v;
137
+ const [lo, hi] = RESHOOT_DIAL_BOUNDS[key];
138
+ if (v < lo || v > hi) {
139
+ bad.push(`${key} ${v} is outside the camera band [${lo}, ${hi}] — ${DIAL_UNITS[key]}`);
140
+ }
141
+ }
142
+ if (bad.length > 0) {
143
+ throw new Error(`h3 re-shoot: the bag's camera dials are out of band — ${bad.join('; ')} (the card's Reshoot rows state the same bounds; refused ahead of the engine, never a widget 400 — every offender named in one pass)`);
98
144
  }
99
- return v;
145
+ return dials;
100
146
  };
101
147
  /** The bag's first (and only — max_stack 1) entry, typed loose. */
102
148
  const bagEntry = (p) => {
@@ -123,14 +169,15 @@ const bagEntry = (p) => {
123
169
  * band is 0.5–1, served default 0.8). */
124
170
  export function readReshootKnobs(p) {
125
171
  const e = bagEntry(p) ?? {};
172
+ const dials = bandedAll(e);
126
173
  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),
174
+ orbit: dials.orbit,
175
+ tilt: dials.tilt,
176
+ dolly: dials.dolly,
177
+ zoom: dials.zoom,
178
+ pan: dials.pan,
179
+ strength: dials.strength,
180
+ depthRatio: dials.depth_ratio,
134
181
  smoothDepth: e.smooth_depth === true,
135
182
  invertDepth: e.invert_depth === true,
136
183
  };
package/lib/schema.d.ts CHANGED
@@ -5,6 +5,16 @@ 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
7
  export declare const JSON_ARRAY_PARAMS: readonly ["calls", "audio_clips", "keyframes"];
8
+ /** The fps rail's own bounds, one home: the row declares them and the
9
+ * internal seconds rail derives its own bounds from them (see
10
+ * fps_seconds) — a second rail must never invent a rival bound. */
11
+ export declare const FPS_RAIL_MIN = 1;
12
+ export declare const FPS_RAIL_MAX = 120;
13
+ /** The refinement window's DECLARED default — one home for the seat,
14
+ * the schema walk, and every wall/receipt that judges the unstated
15
+ * rider (the SOTA plan's researched 0.30–0.35 band; 1.0 is the
16
+ * taomate full-denoise mechanic, opt-in). */
17
+ export declare const REFINE_DENOISE_DEFAULT = 0.35;
8
18
  export declare const paramSchema: z<Schemastery.ObjectS<NoInfer<{
9
19
  image: z<string, string, "plain">;
10
20
  last_frame: z<string, string, "plain">;
package/lib/schema.js CHANGED
@@ -9,7 +9,7 @@ import { vocabulary } from '@melite/comfyui-card-kit/vocab';
9
9
  import { samplingExtra } from '@melite/comfyui-card-kit/fields';
10
10
  import { bag } from '@melite/contracts/extraKeys';
11
11
  import { coerceWireArrays } from '@melite/comfyui-card-kit';
12
- import { CALL_KEYS, DOC_FPS_DEFAULT, FILM_ONLY_KEYS, GRID_BASE_FRAMES, GRID_MAX_FRAMES, GRID_STEP_FRAMES, REF_CAPS, T4_ONLY_KEYS, assertGridLength, assertSpanGrid, deriveWindowFamily, isMediaRef, normalizeDeclaredRefs, transitionOverlap } from './timelineContract.js';
12
+ import { CALL_KEYS, DOC_FPS_DEFAULT, FILM_ONLY_KEYS, GRID_BASE_FRAMES, GRID_MAX_FRAMES, GRID_STEP_FRAMES, REF_CAPS, bookSeconds, assertGridLength, assertSpanGrid, deriveWindowFamily, isMediaRef, normalizeDeclaredRefs, transitionOverlap } from './timelineContract.js';
13
13
  // the window families this renderer builds (three shapes:
14
14
  // t4r opener / t4_open window / t4_chain window).
15
15
  export const FAMILIES = ['t4r', 't4_open', 't4_chain'];
@@ -26,6 +26,16 @@ export const H3_RECOMMENDED_SAMPLERS = [
26
26
  "res_multistep", "res_multistep_cfg_pp", "er_sde", "seeds_2", "seeds_3",
27
27
  ];
28
28
  export const JSON_ARRAY_PARAMS = ['calls', 'audio_clips', 'keyframes'];
29
+ /** The fps rail's own bounds, one home: the row declares them and the
30
+ * internal seconds rail derives its own bounds from them (see
31
+ * fps_seconds) — a second rail must never invent a rival bound. */
32
+ export const FPS_RAIL_MIN = 1;
33
+ export const FPS_RAIL_MAX = 120;
34
+ /** The refinement window's DECLARED default — one home for the seat,
35
+ * the schema walk, and every wall/receipt that judges the unstated
36
+ * rider (the SOTA plan's researched 0.30–0.35 band; 1.0 is the
37
+ * taomate full-denoise mechanic, opt-in). */
38
+ export const REFINE_DENOISE_DEFAULT = 0.35;
29
39
  // ── the params schema — H3TimelineCard mirrored 1:1 ─────────────────────────
30
40
  // the declared field order and defaults. Bare (defaultless) keys are the
31
41
  // ABSENT / required surface (prompt required=True; image
@@ -178,7 +188,7 @@ export const paramSchema = z.object({
178
188
  // the walk fills it, the lawful declared kind, never a silent ??
179
189
  // in the compose). The old hardcoded 24 in both render arms played
180
190
  // a 90-frame window at 3.75s under a 5.6s bar.
181
- fps: z.number().description("Playback fps").min(1).max(120).default(DOC_FPS_DEFAULT).extra('extra', bag({ hidden: true })),
191
+ fps: z.number().description("Playback fps").min(FPS_RAIL_MIN).max(FPS_RAIL_MAX).default(DOC_FPS_DEFAULT).extra('extra', bag({ hidden: true })),
182
192
  steps: z.number().description("Steps").min(4).max(30).default(6).extra('extra', samplingExtra('steps', { tooltip: "6 for draft — the engine kernel's own calibrated count (its H3SLAAttention tooltip: use 6 steps rather than lowering sparsity; PARITY-pinned with plaguekind v7 — the 12 carried no receipt and matched neither his v7=6 nor v9=8; regolded by the 2026-10-16 upstream-parity audit); 30 standard; a boarded distill lora applies its own steps (edit them on the lora entry)" })),
183
193
 
184
194
  // needs an on/off switch, it is very unclear if it is on or off"):
@@ -260,18 +270,19 @@ export const paramSchema = z.object({
260
270
  // full-denoise mechanic). 1.0 stays STATEABLE for that mechanic;
261
271
  // the ARM 36 band arm outlaws an out-of-window default.
262
272
  // (0.05, 1]; 0 is a dead pass and refuses.
263
- refine_denoise: z.number().description("Refine denoise").min(0.05).max(1).step(0.05).default(0.35).extra('extra', bag({ order: null, group: 'second_pass', visible_when: "second_pass_enabled=true", wtype: 'number', tooltip: "The refinement window (the researched 0.30–0.35 band): pass 1's structure stays, the second pass polishes texture. Default 0.35. 1.0 = full re-denoise (the taomate full pass, opt-in). Rides on the refine rider when refine_lora is set — and as the handoff's own window when the latent-upscale route is on." })),
273
+ refine_denoise: z.number().description("Refine denoise").min(0.05).max(1).step(0.05).default(REFINE_DENOISE_DEFAULT).extra('extra', bag({ order: null, group: 'second_pass', visible_when: "second_pass_enabled=true", wtype: 'number', tooltip: "The refinement window (the researched 0.30–0.35 band): pass 1's structure stays, the second pass polishes texture. Default 0.35. 1.0 = full re-denoise (the taomate full pass, opt-in). Rides on the refine rider when refine_lora is set — and as the handoff's own window when the latent-upscale route is on." })),
264
274
 
265
275
  // the learned-latent alternative to the SeedVR2 pixel route: the
266
276
  // vendored xmarre pack's MinimaxH3LatentUpscaler3DRefineHandoff
267
277
  // rides IN-BAND on the pass-1 joint AV latent (upscale + the
268
278
  // low-sigma refinement inside the 3D-conv kernel, audio preserved
269
- // under lock_audio). The sub-gate: route latents halve the r2v head
270
- // (1344×768 → 672×384) so pass 1 composes the quarter the kernel
271
- // was distilled on; the rider (when set) mounts in-band on the
272
- // upscaled latent. Route off (default) = the graph is byte-stable
273
- // with the pre-route estate (ARM 41).
274
- upscale_route: vocabulary(["off", "latent_2x"]).description("Latent upscale route").default("off").extra('extra', bag({ order: null, group: 'second_pass', visible_when: "second_pass_enabled=true", wtype: 'select', tooltip: "Upscale between the passes: off (default — the second pass works at full size) or latent_2x (pass 1 renders at half size, the learned upscaler doubles the latent in-band before the second pass)." })),
279
+ // under lock_audio). Pass 1 composes the STATED geometry and the
280
+ // handoff doubles ON TOP of it — armed, the render lands at 2× the
281
+ // stated grid (the half-grid stamp that rendered base tier died
282
+
283
+ // set) mounts in-band on the upscaled latent. Route off (default)
284
+ // = the graph is byte-stable with the pre-route estate (ARM 41).
285
+ upscale_route: vocabulary(["off", "latent_2x"]).description("Latent upscale route").default("off").extra('extra', bag({ order: null, group: 'second_pass', visible_when: "second_pass_enabled=true", wtype: 'select', tooltip: "Upscale between the passes: off (default — the render stays at the stated size) or latent_2x (pass 1 renders the stated size and the learned upscaler doubles the latent in-band — the render lands at 2× the stated size)." })),
275
286
  // CLOSED FILE SURFACE (the operator's dropdown law — the sr_model
276
287
  // precedent above): the ONE file the estate runs — the on-disk LBH
277
288
  // v1 3D-conv bf16 checkpoint (the h3 latent weight, verified
@@ -290,7 +301,16 @@ export const paramSchema = z.object({
290
301
  interp_model: vocabulary(["film_net_fp16.safetensors", "rife47.pth"]).description("Interp model").default("film_net_fp16.safetensors").extra('extra', bag({ order: null, group: 'second_pass', visible_when: "second_pass_enabled=true&interpolate_enabled=true", wtype: 'select', tooltip: "FILM or RIFE frame-interpolation weights." })),
291
302
  interp_multiplier: z.number().description("Interp multiplier").min(2).max(4).step(1).default(2).extra('extra', bag({ order: null, group: 'second_pass', visible_when: "second_pass_enabled=true&interpolate_enabled=true", wtype: 'number', tooltip: "Frame multiple (2 = double the frame rate)." })),
292
303
  sr_switch: z.boolean().description("Super-Res (SeedVR2)").default(false).extra('extra', bag({ order: null, group: 'second_pass', visible_when: "second_pass_enabled=true", tooltip: "Upscale the final film through SeedVR2 before saving." })),
293
- sr_resolution: z.number().description("Super-Res target").min(720).max(2160).step(360).default(1080).extra('extra', bag({ order: null, group: 'second_pass', visible_when: "second_pass_enabled=true&sr_switch=true", wtype: 'number', tooltip: "The SeedVR2 output height in px." })),
304
+
305
+ // BELOW the film's own 768 native canvas (the F34 plan geometry,
306
+ // 1344×768) — a super-res target below the rendered height is a
307
+ // downscale wearing the upscale seat. The floor IS the native
308
+ // height (768); the step is 24, the coarsest step that keeps
309
+
310
+ // grid from the new floor, so the served ladder survives the
311
+ // floor move byte-stable — the walk's step is the served
312
+ // quantization, never the instrument's law.
313
+ sr_resolution: z.number().description("Super-Res target").min(768).max(2160).step(24).default(1080).extra('extra', bag({ order: null, group: 'second_pass', visible_when: "second_pass_enabled=true&sr_switch=true", wtype: 'number', tooltip: "The SeedVR2 output height in px (never below the film's own 768 native canvas)." })),
294
314
  // CLOSED FILE SURFACE (the operator's dropdown law — a free-text
295
315
  // weights row is a guess box): the two SeedVR2 DiT files the estate
296
316
  // actually runs (both proven in shipped _flow.json receipts: the fp16
@@ -298,7 +318,7 @@ export const paramSchema = z.object({
298
318
  // dropdown AND the membership refusal (an off-set value fails at the
299
319
  // schema door, never as a ComfyUI 400). Gated behind sr_switch like
300
320
  // every other post leaf.
301
- sr_model: vocabulary(["seedvr2_ema_3b_fp16.safetensors", "seedvr2_ema_3b_fp8_e4m3fn.safetensors"]).description("Super-Res model").default("seedvr2_ema_3b_fp16.safetensors").extra('extra', bag({ order: null, group: 'second_pass', visible_when: "second_pass_enabled=true&sr_switch=true", wtype: 'select', tooltip: "SeedVR2 weights (models/upscale_models/): fp16 3B default, fp8_e4m3fn 3B leaner." })),
321
+ sr_model: vocabulary(["seedvr2_ema_3b_fp16.safetensors", "seedvr2_ema_3b_fp8_e4m3fn.safetensors"]).description("Super-Res model").default("seedvr2_ema_3b_fp8_e4m3fn.safetensors").extra('extra', bag({ order: null, group: 'second_pass', visible_when: "second_pass_enabled=true&sr_switch=true", wtype: 'select', tooltip: "SeedVR2 weights (models/upscale_models/): fp8_e4m3fn 3B default (the leaner row — a 24GB card cannot hold the fp16 3B model beside a 90-frame 1080p decode), fp16 for cards with more headroom." })),
302
322
  // the R2V COMBO size mode — the engine's own vocabulary is the
303
323
 
304
324
  // ref_image_size "704x1280" against comfy_extras.nodes_minimax_h3
@@ -374,8 +394,10 @@ export const paramSchema = z.object({
374
394
  sla_stabilize_motion: z.boolean().description("SLA stabilize motion").extra('extra', bag({ order: null, group: "sla", visible_when: "sla_enabled=true", tooltip: "Untouched, this turns on for every model except the t4r openers — those run with it off." })),
375
395
  sla_disable_fp16_accum: z.boolean().description("SLA full-precision accum").default(true).extra('extra', bag({ order: null, group: "sla", visible_when: "sla_enabled=true", tooltip: "Full-precision accumulation inside the sparse kernel." })),
376
396
  // ── the sharpen leaves (compose: only EXPLICITLY-set leaves patch
377
- // ImageSharpenKJ's grouped dict — bare emission defaults do NOT
378
- // change a run that never sets them). VISIBILITY rides the
397
+ // the installed node's V3 combo wires (GAPS-1/F9 cure — the old
398
+ // flat grouped dict matched no option key, so the finalize dropped
399
+ // `method` outright); bare emission defaults do NOT change a run
400
+ // that never sets them). VISIBILITY rides the
379
401
  // declaration's own visible_when grammar (&-ANDed guards, |-SET
380
402
  // values) — no hand-rolled predicates anywhere.
381
403
  sharpen_method: vocabulary(["rcas", "adaptive_usm", "high_pass", "deconvolution"]).default("rcas").description("Sharpen Method").extra('extra', bag({ order: null, group: 'second_pass', visible_when: "second_pass_enabled=true&sharpen_enabled=true", wtype: 'select' })),
@@ -410,7 +432,18 @@ export const paramSchema = z.object({
410
432
  // 10 seconds of mush. No default, no user face: hidden; the
411
433
  // compose owns the derivation (render loop restates it
412
434
  // unconditionally from the actual window length).
413
- fps_seconds: z.number().description("Clip seconds (fps rail — internal, derived from the window length at compose)").min(1).max(60).extra('extra', bag({ hidden: true })),
435
+
436
+ // burn: `$.fps_seconds expected number >= 1 but got 0.917`). The old
437
+ // .min(1).max(60) was a hand-picked second-count laid over two laws
438
+ // that already bound this quotient: the grid's 22..362 frames and the
439
+ // fps rail's 1..120. The grid's own SHORTEST window is 22f = 0.917s at
440
+ // the doc default 24fps, so the floor refused every grid-legal opener;
441
+ // the ceiling refused a grid-legal 362f window on a 1fps doc (362s).
442
+ // The bounds below are DERIVED from those two laws (never authored
443
+ // numbers): they refuse only what the laws already make impossible —
444
+ // the 400-class guard against a zero/negative clock on the wire —
445
+ // while every grid-legal window at every legal fps passes.
446
+ fps_seconds: z.number().description("Clip seconds (fps rail — internal, derived from the window length at compose)").min(bookSeconds(GRID_BASE_FRAMES, FPS_RAIL_MAX)).max(bookSeconds(GRID_MAX_FRAMES, FPS_RAIL_MIN)).extra('extra', bag({ hidden: true })),
414
447
  // THE LEGACY ALIASES (renderer-era spellings of the mod switches)
415
448
  // — gate-admitted for old drafts, never user surface: the MODS
416
449
 
@@ -731,33 +764,18 @@ export function schema(v) {
731
764
  // inert for multi-call chains — spans own the film)
732
765
  }
733
766
  const bad = (keys) => keys.filter((kk) => explicit.has(kk)).sort();
734
- if (variant === 't4r') {
735
- const b = bad(T4_ONLY_KEYS);
736
- if (b.length) {
737
-
738
- // §CURES-OWED 6 / timeline-calls-burn §CURES-OWED 7) THE
739
- // HONEST-VOICE RIDER, per the cured unknownQuantVoice precedent
740
- // (web-kit/contracts laneRelations: a refusal names the SEAM
741
- // and the repair, not just the fact). The spine
742
- // `h3_window(t4r): unsanctioned inject keys: <keys>` stays
743
- // byte-identical — the B5 admission clause and the pick verdict
744
- // quote it verbatim, the walls grep it — the tail only extends
745
- // it. The writer: the keys were staged lawfully on the doc's
746
- // Layer-A plane (the serializer's emit dialects or a recipe
747
- // stamp) and the guide seats re-derived t4r under them. The
748
- // repair is one gesture: a stating commit through the studio
749
- // re-derives the family and unstamps the residue in the same
750
- // save (the B2 flip writer), or the named keys null-delete at
751
- // the bench patch door. The film-only sibling below keeps its
752
- // own voice — its writer is a stale duck row, not this emit
753
- // (follow-up, not this scope).
754
- throw new Error(`h3_window(t4r): unsanctioned inject keys: ${b.join(', ')}`
755
- + ` — the studio's Layer-A emit carries lane-dead post keys (the family re-derived t4r under a legal stamp);`
756
- + ` the repair is one gesture: restate the doc through the studio`
757
- + ` (the commit re-derives the family and unstamps the residue)`
758
- + ` or null the named keys at the patch door`);
759
- }
760
- }
767
+
768
+ // gate-11 burn: the compose gate refused a lawful Final-Cut doc
769
+ // with four unactionable lines, because the t4r render arm wired
770
+ // no pixel post chain). The arm now mounts the chain
771
+ // (actions.ts renderH3Window hoists it above the family branch),
772
+ // so every finish key fires on every lane and the walk has no
773
+ // lane-conditional refusal to speak. The old T4_ONLY_KEYS set and
774
+ // its t4rInjectRefusal spine are deleted from timelineContract.ts
775
+ // — do not reintroduce a lane dead-letter gate here; cure the
776
+ // renderer instead, and let THIS walk's own gates judge what a
777
+ // doc shape can honor (the film-only gate below, the route-master
778
+ // gate, the guide seats).
761
779
  // (B6, timeline-calls-burn §CURES-OWED 5 / ui-truth-gap #4's walk
762
780
  // leg) THE FILM-ONLY GATE, the t4r gate's sibling: FILM_ONLY_KEYS
763
781
  // are read in exactly one seat — computeFilmMix's manifest, inside
@@ -772,6 +790,28 @@ export function schema(v) {
772
790
  if (b.length)
773
791
  throw new Error(`h3_window(${variant}): film-only inject keys: ${b.join(', ')}`);
774
792
  }
793
+
794
+ // run-d96317409da9: the doc stated the sub-gate alone, the ledger's
795
+ // own graph_receipt dropped `upscale_route`, the handoff never
796
+ // composed, and the film rendered the plain 1344×768 pass). The
797
+ // latent-upscale route is a SUB-GATE: its one consumer (the
798
+ // MinimaxH3LatentUpscaler3DRefineHandoff mount, actions.ts
799
+ // upscaleOn) reads it only behind the second-pass master, so a
800
+ // stated latent_2x beside an absent or false master composes into
801
+ // NO node — the inert-knob admission the misconfiguration law
802
+ // bans. Self-contained judge (two walked keys, zero engine truth),
803
+ // so it rides the walk beside the t4r and film-only gates; the
804
+ // upscale BAG's engine-side referent (the chain store) stays at the
805
+
806
+ // gate is the SAME shape on every lane — a t4r doc that states the
807
+ // route without its master is refused here exactly like an open
808
+ // or film doc, because the t4r arm mounts the same handoff.
809
+ if (explicit.has('upscale_route') && out.upscale_route === 'latent_2x' && out.second_pass_enabled !== true) {
810
+ throw new Error(`h3_window(${variant}): upscale_route 'latent_2x' fires nothing without its master — the latent handoff `
811
+ + `(MinimaxH3LatentUpscaler3DRefineHandoff) composes only behind second_pass_enabled=true; the sub-gate alone `
812
+ + `rode the doc, armed no node, and rendered the plain pass (run-d96317409da9's burn). `
813
+ + `Arm the master beside the route, or turn the route off`);
814
+ }
775
815
  // THE STEPS-PIN STAMP (007-H3-LoRA-PLANE L3): whether the caller
776
816
  // pinned steps is a fact only this walk owns (the raw keys —
777
817
  // defaults materialize downstream and the film build can no
@@ -67,7 +67,9 @@ export declare const DOC_FPS_DEFAULT: 24;
67
67
 
68
68
 
69
69
 
70
- export declare const T4_ONLY_KEYS: readonly ["sharpen_switch", "sharpen_method", "sharpen_strength", "sharpen_radius", "sharpen_threshold", "sharpen_iterations", "interp_switch", "interp_multiplier", "interp_model", "sr_switch", "sr_model", "sr_resolution", "second_pass_enabled", "sharpen_enabled", "interpolate_enabled", "attention_backend"];
70
+
71
+
72
+
71
73
 
72
74
 
73
75
 
@@ -102,6 +104,7 @@ export declare const FILM_ONLY_KEYS: readonly ["duck_depth_db"];
102
104
 
103
105
 
104
106
 
107
+
105
108
 
106
109
 
107
110
  export declare const FAMILY_LAW: {
@@ -115,9 +118,7 @@ export declare const FAMILY_LAW: {
115
118
  }, {
116
119
  readonly lane: "t4_open";
117
120
  }];
118
- readonly deadKeys: {
119
- readonly t4r: readonly ["sharpen_switch", "sharpen_method", "sharpen_strength", "sharpen_radius", "sharpen_threshold", "sharpen_iterations", "interp_switch", "interp_multiplier", "interp_model", "sr_switch", "sr_model", "sr_resolution", "second_pass_enabled", "sharpen_enabled", "interpolate_enabled", "attention_backend"];
120
- };
121
+ readonly deadKeys: {};
121
122
  };
122
123
 
123
124
 
@@ -150,6 +151,12 @@ export interface CarriedSpanGrid {
150
151
  }
151
152
  export declare function carriedSpanGrid(span: TimelineSpan, carry?: number): CarriedSpanGrid;
152
153
  export declare function assertCarriedSpanGrid(span: TimelineSpan, where: string, carry?: number): number;
154
+ /** The booked render clock, one home: the seconds seat rounds its
155
+ * quotient to milliseconds before it rides the wire, so every
156
+ * consumer that needs the value the graph will actually carry (the
157
+ * schema's own rail bounds, the mix ledger) books through here —
158
+ * never a second copy of the rounding. */
159
+ export declare function bookSeconds(lengthFrames: number, fps: number): number;
153
160
  export declare function gridSnap(length: number): number;
154
161
  /** THE GRID PREDICATE, one owner: a length the engine can render is
155
162
  * 22+17k inside [22,362]. Every refusal door asks this question, so
@@ -65,13 +65,9 @@ export const DOC_FPS_DEFAULT = 24;
65
65
 
66
66
 
67
67
 
68
- export const T4_ONLY_KEYS = [
69
- 'sharpen_switch', 'sharpen_method', 'sharpen_strength', 'sharpen_radius',
70
- 'sharpen_threshold', 'sharpen_iterations', 'interp_switch',
71
- 'interp_multiplier', 'interp_model', 'sr_switch', 'sr_model', 'sr_resolution',
72
- 'second_pass_enabled', 'sharpen_enabled', 'interpolate_enabled',
73
- 'attention_backend',
74
- ];
68
+
69
+
70
+
75
71
 
76
72
 
77
73
 
@@ -106,6 +102,7 @@ export const FILM_ONLY_KEYS = ['duck_depth_db'];
106
102
 
107
103
 
108
104
 
105
+
109
106
 
110
107
 
111
108
  export const FAMILY_LAW = {
@@ -118,7 +115,13 @@ export const FAMILY_LAW = {
118
115
  },
119
116
  { lane: 't4_open' },
120
117
  ],
121
- deadKeys: { t4r: T4_ONLY_KEYS },
118
+
119
+ // The post chain mounts on every arm (actions.ts), so a finish
120
+ // knob stated on a t4r doc fires there like it does on the open
121
+ // and chain lanes. The empty map keeps the served shape
122
+ // FormSpecDoc.familyLaw declares; the generic dead-key clause in
123
+ // card-base's composeValidate stays for other families' laws.
124
+ deadKeys: {},
122
125
  };
123
126
 
124
127
 
@@ -190,6 +193,14 @@ export function assertCarriedSpanGrid(span, where, carry = SEAM_OVERLAP_FRAMES)
190
193
  }
191
194
  return grid.length;
192
195
  }
196
+ /** The booked render clock, one home: the seconds seat rounds its
197
+ * quotient to milliseconds before it rides the wire, so every
198
+ * consumer that needs the value the graph will actually carry (the
199
+ * schema's own rail bounds, the mix ledger) books through here —
200
+ * never a second copy of the rounding. */
201
+ export function bookSeconds(lengthFrames, fps) {
202
+ return Math.round((lengthFrames / fps) * 1000) / 1000;
203
+ }
193
204
  export function gridSnap(length) {
194
205
  const k = Math.round((length - GRID_BASE_FRAMES) / GRID_STEP_FRAMES);
195
206
  return Math.min(GRID_MAX_FRAMES, Math.max(GRID_BASE_FRAMES, GRID_BASE_FRAMES + GRID_STEP_FRAMES * k));
@@ -359,7 +370,17 @@ export function refGenreOf(name, url) {
359
370
  return 'image';
360
371
  return 'video';
361
372
  }
362
- const source = `${lowerName} ${url ? url.toLowerCase().split('?')[0] : ''}`;
373
+ let urlFace = url?.toLowerCase() ?? '';
374
+ const pathMatch = /(?:^|[?&])path=([^&]+)/.exec(urlFace);
375
+ if (pathMatch !== null) {
376
+ try {
377
+ urlFace = decodeURIComponent(pathMatch[1]);
378
+ }
379
+ catch {
380
+ urlFace = pathMatch[1];
381
+ }
382
+ }
383
+ const source = `${lowerName} ${urlFace.split('?')[0]}`;
363
384
  const extension = source.split('.').pop().split(/[^a-z0-9]/)[0];
364
385
  if (['png', 'jpg', 'jpeg', 'webp', 'gif', 'bmp', 'avif'].includes(extension))
365
386
  return 'image';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melite/models-h3",
3
- "version": "0.2.0-alpha",
3
+ "version": "0.2.2-alpha",
4
4
  "license": "AGPL-3.0-or-later",
5
5
  "type": "module",
6
6
  "exports": {
@@ -32,14 +32,8 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@deepseek-ai/schemastery": "^3.18.5",
35
- "@melite/contracts": "0.2.0-alpha",
36
- "@melite/comfyui-card-kit": "0.2.0-alpha"
37
- },
38
- "devDependencies": {
39
- "@types/node": "^22.20.0",
40
- "typescript": "^5.9.3",
41
- "@deepseek-ai/cordis": "^4.0.5",
42
- "@deepseek-ai/cosmokit": "~1.8.5"
35
+ "@melite/comfyui-card-kit": "0.2.2-alpha",
36
+ "@melite/contracts": "0.2.2-alpha"
43
37
  },
44
38
  "files": [
45
39
  "lib/index.js",
@@ -50,10 +44,27 @@
50
44
  "@deepseek-ai/cordis": "^4.0.5",
51
45
  "@deepseek-ai/cosmokit": "~1.8.5"
52
46
  },
47
+ "description": "MiniMax H3 family, joint video and audio generation across timeline, single-shot, and keyframe lanes.",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "https://github.com/JayDataEngineer/melite.git",
51
+ "directory": "packages/models/h3"
52
+ },
53
+ "keywords": [
54
+ "melite",
55
+ "comfyui",
56
+ "cordis",
57
+ "agent",
58
+ "media-generation",
59
+ "library"
60
+ ],
53
61
  "scripts": {
54
62
  "build": "tsc -p tsconfig.build-mods.json && tsc -p tsconfig.build.json",
55
63
  "typecheck": "tsc --noEmit"
56
64
  },
65
+ "engines": {
66
+ "node": ">=22.18.0"
67
+ },
57
68
  "publishConfig": {
58
69
  "access": "public"
59
70
  }