track-gate: prompt_override minimized to the parser's real contract - parse_minimax_prompt_override requires ONLY type+prompts; version is read by nothing (validator no longer demands it); duration/generation_type/continuity_mode/locks emitted only when non-default (code defaults: '10' SECONDS, r2v, shot, 0); proven with the pack's own code: minimal 3-key Sam payload builds byte-identical TRACKS_INFO vs the old 9-key one; schema doc rewritten around the minimal form, no frame fields

This commit is contained in:
Z User 2026-11-01 20:52:57 +00:00
parent 20143da60e
commit 1473abcbd2
6 changed files with 75 additions and 54 deletions

View File

@ -302,8 +302,10 @@ attaches the wrong image), and the track locks.
### 5A — Default: the `prompt_override` paste ### 5A — Default: the `prompt_override` paste
`prompt_override.json` is what the user pastes into the **multitrack editor node's `prompt_override.json` is what the user pastes into the **multitrack editor node's
`prompt_override` input** (`easy multiTrackEditor`). It is self-contained: one prompt per `prompt_override` input** (`easy multiTrackEditor`). It is minimal by design — the parser
clip, per-clip durations and continuity modes, media reference tokens inside the prompts. requires only `type` and `prompts`; optional keys appear only when non-default (duration is
SECONDS, `generation_type` defaults to `r2v` in the pack's code). It is self-contained: one
prompt per clip, media reference tokens inside the prompts, and no frame fields anywhere.
Deliver it with these instructions: Deliver it with these instructions:
1. In the editor node set `format` to `MiniMax` (the payload is parsed as MiniMax only in 1. In the editor node set `format` to `MiniMax` (the payload is parsed as MiniMax only in

View File

@ -10,9 +10,11 @@ then assembles TWO deliverables from it:
1. `prompt_override.json` — the PRIMARY paste payload for the `easy multiTrackEditor` 1. `prompt_override.json` — the PRIMARY paste payload for the `easy multiTrackEditor`
node's `prompt_override` input (format MiniMax): {"type": "minimax_prompt_override", node's `prompt_override` input (format MiniMax): {"type": "minimax_prompt_override",
...} with one prompt per segment, per-segment durations and continuity modes. Paste it "prompts": [...]} with one prompt per segment. The parser requires ONLY those two keys
into the widget and queue; wire the inventory's media into the editor's image/audio/ (utils/prompt_override.py); duration (SECONDS), generation_type, continuity_mode and
video inputs in inventory order so the <Picture N>/<Audio N>/<Video N> tokens resolve. track locks are emitted only when non-default. Paste it into the widget and queue;
wire the inventory's media into the editor's image/audio/video inputs in inventory
order so the <Picture N>/<Audio N>/<Video N> tokens resolve.
2. `plan.json` — the patch plan the node pack's `patch_workflow.py apply` consumes 2. `plan.json` — the patch plan the node pack's `patch_workflow.py apply` consumes
({"editor": {..., "track_data": {...}}, "project": {...}}) for patching a whole ({"editor": {..., "track_data": {...}}, "project": {...}}) for patching a whole
workflow file, plus `track_data.json` (pretty, for inspection). workflow file, plus `track_data.json` (pretty, for inspection).
@ -219,7 +221,7 @@ def _main(argv: list[str]) -> int:
encoding="utf-8") encoding="utf-8")
prompts = len(override["prompts"]) prompts = len(override["prompts"])
total_s = sum(float(row["duration_seconds"]) for row in outline["rows"]) total_s = sum(float(row["duration_seconds"]) for row in outline["rows"])
print(f"OVERRIDE OK: {prompts} prompts, duration {override['duration']}, " print(f"OVERRIDE OK: {prompts} prompts, duration {override.get('duration', '10 (default)')}, "
f"total {total_s:.2f}s; wrote {override_path} " f"total {total_s:.2f}s; wrote {override_path} "
f"({override_path.stat().st_size} chars, one line)") f"({override_path.stat().st_size} chars, one line)")
print(f"PLAN OK: {_summary(plan)}") print(f"PLAN OK: {_summary(plan)}")

View File

@ -1 +1 @@
{"type":"minimax_prompt_override","version":1,"prompts":["<Picture 1> <Audio 1> Dawn light spills across an empty rooftop terrace above a hushed city. A young woman with a brown ponytail, cream cardigan over a white tee and blue jeans stands at the steel rail, matching the pose reference image for her identity only. She cradles a matte-black kettle in her right hand and tips it in one slow arc; a thread of steam rises as coffee fills the white cup in her left hand, her wrist rotating smoothly, elbow dropping as the kettle empties. She sets the kettle on the rail with a soft clink, lifts the cup, and brings it halfway to her lips as the sun's first rim crests the skyline and warms her cheek. The camera holds one slow push-in toward her profile, never cutting, while pigeon wings clap once somewhere below and the kettle's metal ticks as it cools.","<Picture 1> <Audio 1> The camera holds the same framing it arrived with, and she keeps the pose, motion and light it arrived with: the cup still traveling toward her lips, steam bending in the same breeze. Her chest rises with one slow breath, weight easing onto her left hip as the cardigan's hem starts to lift. Around the two-second mark the wind strengthens into a gust that ruffles her ponytail and snaps the cardigan open a finger's width; her fingers reclose it while she turns her face slowly into the light, eyelids narrowing. Steam tears off the cup in ribbons. The camera keeps its single slow drift leftward with no cut, the city below sharpening frame by frame, traffic swelling from hum to roar, a rooftop antenna creaking softly, her cardigan snapping in steady wind as the turn continues.","<Picture 1> <Audio 1> The join keeps everything it is handed: same framing, same breeze, the tail of her turn still in motion as her face comes level with the camera. She continues the turn until her eyes find the skyline, then lowers the cup in one unhurried arc to the rail, her shoulder rolling with the descent. Below, windows begin to light up floor by floor, a slow tide of warm rectangles climbing the tower across the street while a bus door hisses open. She exhales a long breath, steam curling off the cup in the same wind, ponytail still lifting, cardigan snapping softly. The camera keeps its slow lateral drift and never cuts; the city's morning roar builds under the song as her chest keeps rising and falling mid-breath."],"duration":"10","generation_type":"r2v","continuity_mode":"shot,context,context","system_prompt":"","video_track_lock":0,"audio_track_lock":1} {"type":"minimax_prompt_override","prompts":["<Picture 1> <Audio 1> Dawn light spills across an empty rooftop terrace above a hushed city. A young woman with a brown ponytail, cream cardigan over a white tee and blue jeans stands at the steel rail, matching the pose reference image for her identity only. She cradles a matte-black kettle in her right hand and tips it in one slow arc; a thread of steam rises as coffee fills the white cup in her left hand, her wrist rotating smoothly, elbow dropping as the kettle empties. She sets the kettle on the rail with a soft clink, lifts the cup, and brings it halfway to her lips as the sun's first rim crests the skyline and warms her cheek. The camera holds one slow push-in toward her profile, never cutting, while pigeon wings clap once somewhere below and the kettle's metal ticks as it cools.","<Picture 1> <Audio 1> The camera holds the same framing it arrived with, and she keeps the pose, motion and light it arrived with: the cup still traveling toward her lips, steam bending in the same breeze. Her chest rises with one slow breath, weight easing onto her left hip as the cardigan's hem starts to lift. Around the two-second mark the wind strengthens into a gust that ruffles her ponytail and snaps the cardigan open a finger's width; her fingers reclose it while she turns her face slowly into the light, eyelids narrowing. Steam tears off the cup in ribbons. The camera keeps its single slow drift leftward with no cut, the city below sharpening frame by frame, traffic swelling from hum to roar, a rooftop antenna creaking softly, her cardigan snapping in steady wind as the turn continues.","<Picture 1> <Audio 1> The join keeps everything it is handed: same framing, same breeze, the tail of her turn still in motion as her face comes level with the camera. She continues the turn until her eyes find the skyline, then lowers the cup in one unhurried arc to the rail, her shoulder rolling with the descent. Below, windows begin to light up floor by floor, a slow tide of warm rectangles climbing the tower across the street while a bus door hisses open. She exhales a long breath, steam curling off the cup in the same wind, ponytail still lifting, cardigan snapping softly. The camera keeps its slow lateral drift and never cuts; the city's morning roar builds under the song as her chest keeps rising and falling mid-breath."],"continuity_mode":"shot,context,context","audio_track_lock":1}

View File

@ -479,24 +479,42 @@ python3 scripts/patch_workflow.py inspect RESULT.json
The `easy multiTrackEditor` node has an optional `prompt_override` input. When the editor's The `easy multiTrackEditor` node has an optional `prompt_override` input. When the editor's
`format` is `MiniMax` and the pasted value is a `minimax_prompt_override` JSON payload, the `format` is `MiniMax` and the pasted value is a `minimax_prompt_override` JSON payload, the
editor rebuilds its whole task track from that payload: one task segment per `prompts` editor rebuilds its whole task track from that payload: one task segment per `prompts`
entry, laid back-to-back, each with its own duration. `total_length` becomes the sum of the entry, laid back-to-back on a cursor, each spanning `round(seconds × frame_rate)` frames
durations, so a 3-prompt payload at 10s each renders as THREE chained ~10-second clips. derived from its duration. **The payload has no frame fields and needs none** — never put
`start_frame`/`end_frame` in it. `total_length` becomes the sum of the durations, so a
3-prompt payload at the default 10s each renders as THREE chained ~10-second clips.
**The parser requires exactly two keys** (`parse_minimax_prompt_override`,
`utils/prompt_override.py`: it checks `type` and that `prompts` is a list — nothing else):
```json ```json
{"type":"minimax_prompt_override","version":1, {"type":"minimax_prompt_override","prompts":["prompt for segment one ...","prompt for segment two ..."]}
"prompts":["<Picture 1> <Audio 1> prompt for segment one ...",
"<Picture 1> <Audio 1> prompt for segment two ..."],
"duration":"10","generation_type":"r2v","continuity_mode":"shot,context,context",
"system_prompt":"","video_track_lock":0,"audio_track_lock":1}
``` ```
Field rules (mirrors `utils/prompt_override.py` in the node pack): Every other field is OPTIONAL with a code default — write a key only when the story needs
a non-default value:
| key | default | meaning |
| --- | --- | --- |
| `duration` | `"10"` | SECONDS per clip (never frames), 2–15 enforced at parse time; single value or comma list with tail reuse |
| `generation_type` | `"r2v"` | per clip, same single/comma rule: `r2v` (task_mode ref) / `l2v` / `t2v`,`i2v`,`v2v` (default-mode tasks). TaskOutput's TYPE echoes this string verbatim |
| `continuity_mode` | `"shot"` | per clip: `shot` / `context` / `context_drift` (legacy `context_swap` is normalized to `context_drift`) |
| `system_prompt` | `""` | written into every clip's content when non-empty |
| `video_track_lock` | `0` | 1-based index of the video track to lock (0 = none) |
| `audio_track_lock` | `0` | 1-based index of the audio track to lock (0 = none) |
- `version` — the pack's own `easy minimaxPromptOverride` builder node writes
`"version": 1`, but **nothing in the pack reads it**; the parser never touches it.
Do not emit it.
- The code default for `generation_type` is **`r2v`** (reference mode) — a bare minimal
payload already renders as r2v/reference tasks with no key at all, which is why the
gate's refmod guidance needs no explicit generation_type.
Fallback warning (unchanged): **any other JSON pasted here is not rejected — it falls back
to the generic text parser that splits on `|`.** A JSON blob contains no `|`, so it becomes
ONE task segment spanning the whole timeline with the JSON dump as its prompt: the classic
"rendered the whole story as a single clip" failure.
- `type` must be exactly `minimax_prompt_override` and `version` `1`. **Any other JSON
pasted here is not rejected — it falls back to the generic text parser that splits on
`|`.** A JSON blob contains no `|`, so it becomes ONE task segment spanning the whole
timeline with the JSON dump as its prompt: the classic "rendered the whole story as a
single 10 second clip" failure.
- `prompts` — one entry per clip, in timeline order. The prompt text is the clip's full - `prompts` — one entry per clip, in timeline order. The prompt text is the clip's full
generation prompt (same standalone composition rules as task segments: no cross-segment generation prompt (same standalone composition rules as task segments: no cross-segment
references, context joins keep-then-change, only the last clip may come to rest). references, context joins keep-then-change, only the last clip may come to rest).
@ -506,19 +524,6 @@ Field rules (mirrors `utils/prompt_override.py` in the node pack):
editor's matching `image` / `audio` / `video` input list — wire the media inventory into editor's matching `image` / `audio` / `video` input list — wire the media inventory into
those inputs in inventory order. A prompt with no token renders with no reference media. those inputs in inventory order. A prompt with no token renders with no reference media.
The runtime renumbers tokens compactly for display, but slots are wired from the raw N. The runtime renumbers tokens compactly for display, but slots are wired from the raw N.
- `duration` — seconds per clip, single value ("10" applies to every clip) or comma list
("10,5,10") with tail reuse; each value must be 2–15, enforced at parse time.
- `generation_type` — per clip, same single/comma-list rule. `r2v` = reference-image task
(task_mode ref), `l2v` = last-frame task, `t2v`/`i2v`/`v2v` land as default/edit tasks.
This gate emits `r2v` for ref rows, `l2v` for l2v rows, `t2v` for default rows.
- `continuity_mode` — per clip: `shot`, `context`, `context_drift` (legacy `context_swap`
is normalized to `context_drift`). Matches the task-segment semantics.
- `system_prompt` — written into every clip when non-empty; an empty string lets the H3
runtime auto-append its reference rules for context joins (the gate's default).
- `video_track_lock` / `audio_track_lock` — 1-based index of the video/audio track to lock
(0 = none). With a locked master-audio inventory row, every prompt carries
`<Audio 1>` and `audio_track_lock` is 1; with a locked reference video, `<Video 1>` and
`video_track_lock` are 1.
The paste replaces the editor's existing task track (and derives its audio/video tracks The paste replaces the editor's existing task track (and derives its audio/video tracks
from the tokens), so the payload is self-contained: prompts, durations, modes and media from the tokens), so the payload is self-contained: prompts, durations, modes and media

View File

@ -40,12 +40,14 @@ no ForLoop, one sampler pass, all scenes in one generation. It renders, but only
when the WHOLE timeline fits in one pass — the OOM ceiling at the end of this when the WHOLE timeline fits in one pass — the OOM ceiling at the end of this
section is a hard limit: section is a hard limit:
1. Node 186 (String → `prompt_override`): the compact payload WITH `type` field. 1. Node 186 (String → `prompt_override`): the minimal payload — `type` + `prompts` are
the only required keys (`track-schema.md`); optional keys only when non-default.
2. `easy multiTrackTaskOutput`: `task_index = -1` AND `prompt_format = "promptRelay"`. 2. `easy multiTrackTaskOutput`: `task_index = -1` AND `prompt_format = "promptRelay"`.
3. Everything else stays as-is: TYPE output stays the first task's task_type 3. Everything else stays as-is: TYPE output is the payload's `generation_type` string
(`t2v` for the pure-t2v payload; `r2v` since the ref flip → matchLine → verbatim (`task_type` is set from it in the override path, and the parser's code
`multi_frames`), LENGTH output becomes 719, one SamplerCustomAdvanced pass default is `r2v` — so even the minimal 2-key payload renders TYPE `r2v` → matchLine →
renders the whole timeline. `multi_frames`), LENGTH output becomes 719, one SamplerCustomAdvanced pass renders the
whole timeline.
With `promptRelay` + full-timeline mode, TaskOutput builds the prompt from ALL With `promptRelay` + full-timeline mode, TaskOutput builds the prompt from ALL
task segments (`_format_marker_task_prompt_relay`), each scene suffixed with its task segments (`_format_marker_task_prompt_relay`), each scene suffixed with its

View File

@ -1007,8 +1007,13 @@ def _override_durations(raw: Any, count: int) -> list[float]:
def build_prompt_override(outline: dict[str, Any], fragments: list[dict[str, Any]]) -> dict[str, Any]: def build_prompt_override(outline: dict[str, Any], fragments: list[dict[str, Any]]) -> dict[str, Any]:
"""Assemble the multitrack editor's paste payload from validated fragments. """Assemble the multitrack editor's paste payload from validated fragments.
One prompt per outline row (variant b honored), media reference tokens prepended, One prompt per outline row (variant b honored), media reference tokens prepended.
per-segment duration / generation_type / continuity_mode lists with tail reuse. Minimal by construction: the node's parser (utils/prompt_override.py,
parse_minimax_prompt_override) checks ONLY `type` and `prompts`; every other key has
a code default (duration "10" seconds, generation_type "r2v", continuity_mode
"shot", both track locks 0, no system_prompt) and `version` is written by the pack's
builder node but read by nothing. A key is emitted only when the story needs a
non-default value.
""" """
rows = outline["rows"] rows = outline["rows"]
if len(fragments) != len(rows): if len(fragments) != len(rows):
@ -1051,17 +1056,21 @@ def build_prompt_override(outline: dict[str, Any], fragments: list[dict[str, Any
def _compact(values: list[str]) -> str: def _compact(values: list[str]) -> str:
return ",".join(values) if len(set(values)) > 1 else values[0] return ",".join(values) if len(set(values)) > 1 else values[0]
return { override: dict[str, Any] = {"type": OVERRIDE_TYPE, "prompts": prompts}
"type": OVERRIDE_TYPE, duration = _compact(durations)
"version": OVERRIDE_VERSION, if duration != "10":
"prompts": prompts, override["duration"] = duration
"duration": _compact(durations), generation_type = _compact(gen_types)
"generation_type": _compact(gen_types), if generation_type != "r2v":
"continuity_mode": _compact(cont_modes), override["generation_type"] = generation_type
"system_prompt": "", continuity_mode = _compact(cont_modes)
"video_track_lock": 1 if video_pos is not None else 0, if continuity_mode != "shot":
"audio_track_lock": 1 if audio_pos is not None else 0, override["continuity_mode"] = continuity_mode
} if video_pos is not None:
override["video_track_lock"] = 1
if audio_pos is not None:
override["audio_track_lock"] = 1
return override
def _check_override_refs(prompt: str, row: dict[str, Any], outline: dict[str, Any], where: str) -> None: def _check_override_refs(prompt: str, row: dict[str, Any], outline: dict[str, Any], where: str) -> None:
@ -1107,8 +1116,9 @@ def validate_prompt_override(payload: Any, outline: dict[str, Any]) -> dict[str,
f"prompt_override.type must be {OVERRIDE_TYPE!r}; got {payload.get('type')!r}. " f"prompt_override.type must be {OVERRIDE_TYPE!r}; got {payload.get('type')!r}. "
"Any other JSON pasted into the multitrack editor's prompt_override falls back to " "Any other JSON pasted into the multitrack editor's prompt_override falls back to "
"the '|'-separated text parser and renders ONE clip over the whole timeline") "the '|'-separated text parser and renders ONE clip over the whole timeline")
if payload.get("version") != OVERRIDE_VERSION: # `version` is NOT required and NOT checked: parse_minimax_prompt_override never
raise Fail(f"prompt_override.version must be {OVERRIDE_VERSION}") # reads it. It stays in OVERRIDE_FIELDS so payloads from the pack's own builder
# node (which writes it) still validate here.
unknown = sorted(set(payload) - OVERRIDE_FIELDS) unknown = sorted(set(payload) - OVERRIDE_FIELDS)
if unknown: if unknown:
raise Fail(f"prompt_override has unsupported fields {unknown}") raise Fail(f"prompt_override has unsupported fields {unknown}")
@ -1596,7 +1606,7 @@ def _main(argv: list[str]) -> int:
validate_outline(outline) validate_outline(outline)
validate_prompt_override(payload, outline) validate_prompt_override(payload, outline)
total_s = sum(float(r["duration_seconds"]) for r in outline["rows"]) total_s = sum(float(r["duration_seconds"]) for r in outline["rows"])
print(f"OVERRIDE OK: {len(payload['prompts'])} prompts, duration {payload['duration']}, " print(f"OVERRIDE OK: {len(payload['prompts'])} prompts, duration {payload.get('duration', '10 (default)')}, "
f"total {total_s:.2f}s at {outline['defaults']['frame_rate']} fps — paste into " f"total {total_s:.2f}s at {outline['defaults']['frame_rate']} fps — paste into "
f"the multitrack editor's prompt_override input (format {outline['editor']['format']!r})") f"the multitrack editor's prompt_override input (format {outline['editor']['format']!r})")
return 0 return 0