@melite/models-h3 0.1.5-pre-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/LICENSE +561 -457
- package/README.md +1 -1
- package/lib/actions.d.ts +91 -17
- package/lib/actions.js +1235 -210
- package/lib/chainEdit.d.ts +187 -0
- package/lib/chainEdit.js +330 -0
- package/lib/chainUpscale.d.ts +25 -0
- package/lib/chainUpscale.js +134 -0
- package/lib/extend.d.ts +17 -0
- package/lib/extend.js +174 -0
- package/lib/filmMix.d.ts +24 -10
- package/lib/filmMix.js +30 -14
- package/lib/index.d.ts +12 -0
- package/lib/index.js +245 -66
- package/lib/mods/loras.d.ts +18 -95
- package/lib/mods/loras.js +21 -10
- package/lib/refine.d.ts +123 -0
- package/lib/refine.js +301 -0
- package/lib/repair.d.ts +15 -0
- package/lib/repair.js +164 -0
- package/lib/reshoot.d.ts +201 -0
- package/lib/reshoot.js +352 -0
- package/lib/schema.d.ts +60 -13
- package/lib/schema.js +296 -54
- package/lib/swap.d.ts +14 -0
- package/lib/swap.js +95 -0
- package/lib/timelineContract.d.ts +163 -0
- package/lib/timelineContract.js +216 -1
- package/lib/windowSpec.d.ts +23 -0
- package/lib/windowSpec.js +49 -0
- package/package.json +7 -7
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,9 +4,8 @@ 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">;
|
|
@@ -20,11 +19,16 @@ export declare const paramSchema: z<Schemastery.ObjectS<NoInfer<{
|
|
|
20
19
|
}>>[], "plain">;
|
|
21
20
|
ref_audios: z<string[], string[], "plain">;
|
|
22
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">;
|
|
23
26
|
duck_depth_db: z<number, number, "defined">;
|
|
24
27
|
seed: z<number, number, "defined">;
|
|
25
28
|
width: z<number, number, "defined">;
|
|
26
29
|
height: z<number, number, "defined">;
|
|
27
30
|
length: z<number, number, "defined">;
|
|
31
|
+
fps: z<number, number, "defined">;
|
|
28
32
|
steps: z<number, number, "defined">;
|
|
29
33
|
second_pass_enabled: z<boolean, boolean, "defined">;
|
|
30
34
|
sharpen_enabled: z<boolean, boolean, "defined">;
|
|
@@ -36,6 +40,9 @@ export declare const paramSchema: z<Schemastery.ObjectS<NoInfer<{
|
|
|
36
40
|
refine_lora: z<string, string, "defined">;
|
|
37
41
|
refine_strength: z<number, number, "plain">;
|
|
38
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">;
|
|
39
46
|
attention_backend: z<string, string, "defined">;
|
|
40
47
|
interp_model: z<string, string, "defined">;
|
|
41
48
|
interp_multiplier: z<number, number, "defined">;
|
|
@@ -56,19 +63,18 @@ export declare const paramSchema: z<Schemastery.ObjectS<NoInfer<{
|
|
|
56
63
|
sla_protect_audio: z<boolean, boolean, "defined">;
|
|
57
64
|
sla_stabilize_motion: z<boolean, boolean, "plain">;
|
|
58
65
|
sla_disable_fp16_accum: z<boolean, boolean, "defined">;
|
|
59
|
-
sharpen_method: z<string, string, "
|
|
66
|
+
sharpen_method: z<string, string, "defined">;
|
|
60
67
|
sharpen_radius: z<number, number, "plain">;
|
|
61
68
|
sharpen_threshold: z<number, number, "plain">;
|
|
62
69
|
sharpen_iterations: z<number, number, "plain">;
|
|
63
70
|
k: z<number, number, "plain">;
|
|
64
71
|
noise_seed: z<number, number, "plain">;
|
|
65
|
-
fps_seconds: z<number, number, "
|
|
72
|
+
fps_seconds: z<number, number, "plain">;
|
|
66
73
|
interp_switch: z<boolean, boolean, "plain">;
|
|
67
74
|
sharpen_switch: z<boolean, boolean, "plain">;
|
|
68
75
|
sla_switch: z<boolean, boolean, "plain">;
|
|
69
76
|
image_name: z<string, string, "plain">;
|
|
70
77
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
71
|
-
prompt: z<string, string, "plain">;
|
|
72
78
|
image: z<string, string, "plain">;
|
|
73
79
|
last_frame: z<string, string, "plain">;
|
|
74
80
|
ref_images: z<string[], string[], "plain">;
|
|
@@ -82,11 +88,16 @@ export declare const paramSchema: z<Schemastery.ObjectS<NoInfer<{
|
|
|
82
88
|
}>>[], "plain">;
|
|
83
89
|
ref_audios: z<string[], string[], "plain">;
|
|
84
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">;
|
|
85
95
|
duck_depth_db: z<number, number, "defined">;
|
|
86
96
|
seed: z<number, number, "defined">;
|
|
87
97
|
width: z<number, number, "defined">;
|
|
88
98
|
height: z<number, number, "defined">;
|
|
89
99
|
length: z<number, number, "defined">;
|
|
100
|
+
fps: z<number, number, "defined">;
|
|
90
101
|
steps: z<number, number, "defined">;
|
|
91
102
|
second_pass_enabled: z<boolean, boolean, "defined">;
|
|
92
103
|
sharpen_enabled: z<boolean, boolean, "defined">;
|
|
@@ -98,6 +109,9 @@ export declare const paramSchema: z<Schemastery.ObjectS<NoInfer<{
|
|
|
98
109
|
refine_lora: z<string, string, "defined">;
|
|
99
110
|
refine_strength: z<number, number, "plain">;
|
|
100
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">;
|
|
101
115
|
attention_backend: z<string, string, "defined">;
|
|
102
116
|
interp_model: z<string, string, "defined">;
|
|
103
117
|
interp_multiplier: z<number, number, "defined">;
|
|
@@ -118,13 +132,13 @@ export declare const paramSchema: z<Schemastery.ObjectS<NoInfer<{
|
|
|
118
132
|
sla_protect_audio: z<boolean, boolean, "defined">;
|
|
119
133
|
sla_stabilize_motion: z<boolean, boolean, "plain">;
|
|
120
134
|
sla_disable_fp16_accum: z<boolean, boolean, "defined">;
|
|
121
|
-
sharpen_method: z<string, string, "
|
|
135
|
+
sharpen_method: z<string, string, "defined">;
|
|
122
136
|
sharpen_radius: z<number, number, "plain">;
|
|
123
137
|
sharpen_threshold: z<number, number, "plain">;
|
|
124
138
|
sharpen_iterations: z<number, number, "plain">;
|
|
125
139
|
k: z<number, number, "plain">;
|
|
126
140
|
noise_seed: z<number, number, "plain">;
|
|
127
|
-
fps_seconds: z<number, number, "
|
|
141
|
+
fps_seconds: z<number, number, "plain">;
|
|
128
142
|
interp_switch: z<boolean, boolean, "plain">;
|
|
129
143
|
sharpen_switch: z<boolean, boolean, "plain">;
|
|
130
144
|
sla_switch: z<boolean, boolean, "plain">;
|
|
@@ -139,10 +153,28 @@ export declare const paramSchema: z<Schemastery.ObjectS<NoInfer<{
|
|
|
139
153
|
* declared knobs — old drafts keep working because the schema admits
|
|
140
154
|
* them and the compose door overlays explicit params last (the
|
|
141
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">;
|
|
142
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;
|
|
143
176
|
export declare function schema(v: unknown): Record<string, unknown>;
|
|
144
177
|
export declare const carrier: z<Schemastery.ObjectS<NoInfer<{
|
|
145
|
-
prompt: z<string, string, "plain">;
|
|
146
178
|
image: z<string, string, "plain">;
|
|
147
179
|
last_frame: z<string, string, "plain">;
|
|
148
180
|
ref_images: z<string[], string[], "plain">;
|
|
@@ -156,11 +188,16 @@ export declare const carrier: z<Schemastery.ObjectS<NoInfer<{
|
|
|
156
188
|
}>>[], "plain">;
|
|
157
189
|
ref_audios: z<string[], string[], "plain">;
|
|
158
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">;
|
|
159
195
|
duck_depth_db: z<number, number, "defined">;
|
|
160
196
|
seed: z<number, number, "defined">;
|
|
161
197
|
width: z<number, number, "defined">;
|
|
162
198
|
height: z<number, number, "defined">;
|
|
163
199
|
length: z<number, number, "defined">;
|
|
200
|
+
fps: z<number, number, "defined">;
|
|
164
201
|
steps: z<number, number, "defined">;
|
|
165
202
|
second_pass_enabled: z<boolean, boolean, "defined">;
|
|
166
203
|
sharpen_enabled: z<boolean, boolean, "defined">;
|
|
@@ -172,6 +209,9 @@ export declare const carrier: z<Schemastery.ObjectS<NoInfer<{
|
|
|
172
209
|
refine_lora: z<string, string, "defined">;
|
|
173
210
|
refine_strength: z<number, number, "plain">;
|
|
174
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">;
|
|
175
215
|
attention_backend: z<string, string, "defined">;
|
|
176
216
|
interp_model: z<string, string, "defined">;
|
|
177
217
|
interp_multiplier: z<number, number, "defined">;
|
|
@@ -192,19 +232,18 @@ export declare const carrier: z<Schemastery.ObjectS<NoInfer<{
|
|
|
192
232
|
sla_protect_audio: z<boolean, boolean, "defined">;
|
|
193
233
|
sla_stabilize_motion: z<boolean, boolean, "plain">;
|
|
194
234
|
sla_disable_fp16_accum: z<boolean, boolean, "defined">;
|
|
195
|
-
sharpen_method: z<string, string, "
|
|
235
|
+
sharpen_method: z<string, string, "defined">;
|
|
196
236
|
sharpen_radius: z<number, number, "plain">;
|
|
197
237
|
sharpen_threshold: z<number, number, "plain">;
|
|
198
238
|
sharpen_iterations: z<number, number, "plain">;
|
|
199
239
|
k: z<number, number, "plain">;
|
|
200
240
|
noise_seed: z<number, number, "plain">;
|
|
201
|
-
fps_seconds: z<number, number, "
|
|
241
|
+
fps_seconds: z<number, number, "plain">;
|
|
202
242
|
interp_switch: z<boolean, boolean, "plain">;
|
|
203
243
|
sharpen_switch: z<boolean, boolean, "plain">;
|
|
204
244
|
sla_switch: z<boolean, boolean, "plain">;
|
|
205
245
|
image_name: z<string, string, "plain">;
|
|
206
246
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
207
|
-
prompt: z<string, string, "plain">;
|
|
208
247
|
image: z<string, string, "plain">;
|
|
209
248
|
last_frame: z<string, string, "plain">;
|
|
210
249
|
ref_images: z<string[], string[], "plain">;
|
|
@@ -218,11 +257,16 @@ export declare const carrier: z<Schemastery.ObjectS<NoInfer<{
|
|
|
218
257
|
}>>[], "plain">;
|
|
219
258
|
ref_audios: z<string[], string[], "plain">;
|
|
220
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">;
|
|
221
264
|
duck_depth_db: z<number, number, "defined">;
|
|
222
265
|
seed: z<number, number, "defined">;
|
|
223
266
|
width: z<number, number, "defined">;
|
|
224
267
|
height: z<number, number, "defined">;
|
|
225
268
|
length: z<number, number, "defined">;
|
|
269
|
+
fps: z<number, number, "defined">;
|
|
226
270
|
steps: z<number, number, "defined">;
|
|
227
271
|
second_pass_enabled: z<boolean, boolean, "defined">;
|
|
228
272
|
sharpen_enabled: z<boolean, boolean, "defined">;
|
|
@@ -234,6 +278,9 @@ export declare const carrier: z<Schemastery.ObjectS<NoInfer<{
|
|
|
234
278
|
refine_lora: z<string, string, "defined">;
|
|
235
279
|
refine_strength: z<number, number, "plain">;
|
|
236
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">;
|
|
237
284
|
attention_backend: z<string, string, "defined">;
|
|
238
285
|
interp_model: z<string, string, "defined">;
|
|
239
286
|
interp_multiplier: z<number, number, "defined">;
|
|
@@ -254,13 +301,13 @@ export declare const carrier: z<Schemastery.ObjectS<NoInfer<{
|
|
|
254
301
|
sla_protect_audio: z<boolean, boolean, "defined">;
|
|
255
302
|
sla_stabilize_motion: z<boolean, boolean, "plain">;
|
|
256
303
|
sla_disable_fp16_accum: z<boolean, boolean, "defined">;
|
|
257
|
-
sharpen_method: z<string, string, "
|
|
304
|
+
sharpen_method: z<string, string, "defined">;
|
|
258
305
|
sharpen_radius: z<number, number, "plain">;
|
|
259
306
|
sharpen_threshold: z<number, number, "plain">;
|
|
260
307
|
sharpen_iterations: z<number, number, "plain">;
|
|
261
308
|
k: z<number, number, "plain">;
|
|
262
309
|
noise_seed: z<number, number, "plain">;
|
|
263
|
-
fps_seconds: z<number, number, "
|
|
310
|
+
fps_seconds: z<number, number, "plain">;
|
|
264
311
|
interp_switch: z<boolean, boolean, "plain">;
|
|
265
312
|
sharpen_switch: z<boolean, boolean, "plain">;
|
|
266
313
|
sla_switch: z<boolean, boolean, "plain">;
|