diff --git a/easy-media-track-gate/README.md b/easy-media-track-gate/README.md index c3e6035..9785e41 100644 --- a/easy-media-track-gate/README.md +++ b/easy-media-track-gate/README.md @@ -1,30 +1,33 @@ # Easy-Media Track Gate -A portable, self-contained agent skill that turns a video idea into a **validated MultiTrack -patch plan** for the ComfyUI-Easy-Media nodes (`easy multiTrackEditor` + -`easy multitrackProject`), built with the same outline → approval → one-segment-per-turn → -merge → gate flow as `h3-plan-gate`, adapted to the Easy-Media multitrack schema. +A portable, self-contained agent skill that turns a video idea into a **validated +`prompt_override` paste** for the ComfyUI-Easy-Media nodes (`easy multiTrackEditor`), +built with the same outline → approval → one-segment-per-turn → merge → gate flow as +`h3-plan-gate`, adapted to the Easy-Media multitrack schema. -The PRIMARY deliverable is a **plain-text `prompt_override` paste** (`prompt_override.txt`: -the scene prompts joined with `|` on one line, `[start-end(,type)]` markers where scene +The deliverable is a **plain-text `prompt_override` paste** (`prompt_override.txt`: the +scene prompts joined with `|` on one line, `[start-end(,type)]` markers where scene lengths differ or a scene is not t2v) for the `easy multiTrackEditor` node's `prompt_override` input (format `MiniMax`) — the editor splits on pipes and renders one -clip per scene, no JSON needed. `prompt_override.json` (a `minimax_prompt_override` -payload) is the option for what plain text cannot carry (`` media tokens, -continuity modes, track locks), and `plan.json` is the whole-workflow alternative applied -by the node pack's own `skills/easy-media-multitrack-workflow/scripts/patch_workflow.py -apply`. +clip per scene, no JSON needed. The segment files the agent writes on the way there are +plain text too (`segment_NN.txt`: the scene prompt verbatim + one `# handoff:` line; the +approved outline row supplies id, frames, modes and images). JSON appears only where plain +text cannot reach: `prompt_override.json` (a `minimax_prompt_override` payload — written +automatically for stories with media, or with `--json` for continuity modes / track +locks) and `plan.json` (`--plan`, the whole-workflow alternative applied by the node +pack's own `skills/easy-media-multitrack-workflow/scripts/patch_workflow.py apply`). ## What the gate enforces | Layer | Check | | --- | --- | | Schema | Mirrors every check of the node pack's `patch_workflow.py` at apply time: track/segment ids, sorting, overlap, frame ranges, media `source_type`↔field matching, ≤ 9 images per task, continuity enum, one locked audio + one locked video max, locked-media coverage of task ranges, shared-reference rules, DynamicCombo resolution tokens, project fields — so a plan that passes here cannot be rejected there for schema reasons | -| Outline pins | Each segment's id, start/end frames (`round(seconds × fps)`), `task_mode`, `continuity_mode` and reference-image set are diffed against the approved guide at the segment turn AND again at the merge | -| Verbatim media contract | Every `file_path` in fragments and locked tracks must be a character-for-character copy of the outline's `media_inventory` entry (the same discipline `h3-plan-gate` applies to refmods; a retyped path fails with a closest-match hint) | +| Outline pins | Each segment's id, start/end frames (`round(seconds × fps)`), `task_mode`, `continuity_mode` and reference-image set come FROM the approved guide row when a plain-text fragment is loaded — nothing is retyped, so they cannot drift; JSON fragments are diffed against the row at the segment turn AND again at the merge | +| Verbatim media contract | Media paths are typed only in the outline's `media_inventory`: plain-text fragments cannot carry paths at all, and locked tracks are built straight from the outline (a retyped JSON-fragment path fails with a closest-match hint) | | Context prompt rules | Self-contained prompts in every mode (no "same as before"); context/context_drift joins must open by keeping the delivered tail and must not open with a new composition; a join followed by another join must not end at rest | | Drift discipline | `context_drift` is all-or-nothing across the task range (first segment included), with the consecutive 10-second split unless the user pinned lengths | | Paste payload | `prompt_override` re-checked against the guide in BOTH forms: plain text (scene count/order, `[s-e,type]` markers vs the approved row frames and task types, `@imageN/@audioN/@videoN` refs vs the inventory, `` and stray `@` rejected) and JSON payload (durations, generation/continuity modes, exact `` sets, track locks) | +| Fragment hygiene | Plain-text segment files reject `|` (would split the paste), hand-written `[start-end]` markers (the merge appends them), `@` (the editor strips it) and, on zero-media stories, `` tokens (JSON-only); the `# handoff:` line must describe the real final frame (15+ words) | ## Folder @@ -33,13 +36,16 @@ easy-media-track-gate/ ├── SKILL.md agent procedure (the entry point) ├── README.md this file ├── verify_track_rules.py the gate: outline / segment / trackdata / plan / override / suite -├── build_track_plan.py merge fragments → prompt_override.txt/.json + TRACK_DATA + patch plan.json +├── build_track_plan.py merge fragments → the paste (prompt_override.txt, or .json for +│ media stories); --plan adds plan.json + track_data.json ├── references/ │ └── track-schema.md English translation of the node pack's Chinese │ multitrack-schema.md (all field names preserved) -└── examples/ worked 3-segment example: outline, segments, plan, track_data, - paste payloads (prompt_override.json + the plain-text - prompt_override_r2v_refmod.txt with its outline_sam_park.json) +└── examples/ worked 3-segment r2v example: outline_sam_park.json, the + plain-text segment_01–03.txt fragments, and the paste they + merge into (prompt_override_r2v_refmod.txt); plus a media-story + guide (outline.json), its JSON payload (prompt_override.json) + and the patch-plan shape (plan.json) ``` Standard library only; Windows-first (`py -3`), runs anywhere Python 3.8+ lives. @@ -63,20 +69,20 @@ its plan input and defers execution to it. :: smoke test py -3 "%USERPROFILE%\.agent\skills\easy-media-track-gate\verify_track_rules.py" -:: validate a guide / one segment / the merged plan +:: validate a guide / one plain-text segment py -3 "%USERPROFILE%\.agent\skills\easy-media-track-gate\verify_track_rules.py" outline outline.json -py -3 "%USERPROFILE%\.agent\skills\easy-media-track-gate\verify_track_rules.py" segment segment_01.json --index 1 --outline outline.json -py -3 "%USERPROFILE%\.agent\skills\easy-media-track-gate\verify_track_rules.py" segment segment_02.json --index 2 --prev segment_01.json --outline outline.json +py -3 "%USERPROFILE%\.agent\skills\easy-media-track-gate\verify_track_rules.py" segment segment_01.txt --index 1 --outline outline.json +py -3 "%USERPROFILE%\.agent\skills\easy-media-track-gate\verify_track_rules.py" segment segment_02.txt --index 2 --prev segment_01.txt --outline outline.json -:: merge everything (writes prompt_override.txt + prompt_override.json + plan.json + track_data.json) -py -3 "%USERPROFILE%\.agent\skills\easy-media-track-gate\build_track_plan.py" outline.json segment_01.json segment_02.json segment_03.json -o plan.json +:: merge to the deliverable (writes ONLY the paste: prompt_override.txt for zero-media +:: stories, prompt_override.json when the story has media; --json / --plan add the rest) +py -3 "%USERPROFILE%\.agent\skills\easy-media-track-gate\build_track_plan.py" outline.json segment_01.txt segment_02.txt segment_03.txt -:: validate the paste payloads (plain text is the default form; JSON the option) +:: validate the paste py -3 "%USERPROFILE%\.agent\skills\easy-media-track-gate\verify_track_rules.py" override prompt_override.txt --outline outline.json -py -3 "%USERPROFILE%\.agent\skills\easy-media-track-gate\verify_track_rules.py" override prompt_override.json --outline outline.json -:: apply with the node pack's own script (dry-run, then write) -py -3 \custom_nodes\ComfyUI-Easy-Media\skills\easy-media-multitrack-workflow\scripts\patch_workflow.py apply WORKFLOW.json --plan plan.json +:: optional: patch plan for the node pack's own script (dry-run, then write) +py -3 "%USERPROFILE%\.agent\skills\easy-media-track-gate\build_track_plan.py" outline.json segment_01.txt segment_02.txt segment_03.txt --plan plan.json py -3 \custom_nodes\ComfyUI-Easy-Media\skills\easy-media-multitrack-workflow\scripts\patch_workflow.py apply WORKFLOW.json --plan plan.json --output RESULT.json --write ``` diff --git a/easy-media-track-gate/SKILL.md b/easy-media-track-gate/SKILL.md index 4523c83..bdc6603 100755 --- a/easy-media-track-gate/SKILL.md +++ b/easy-media-track-gate/SKILL.md @@ -13,23 +13,26 @@ description: Turn a video idea into a validated MultiTrack plan for ComfyUI-Easy # Easy-Media Track Gate — agent procedure -Goal: produce a validated plan for the `easy multiTrackEditor` node in five moves: the user -gives a video idea and a segment count (or an existing workflow to edit) → you build a -timeline guide (`outline.json`) and show it for **approval** → with the approved guide you -compose the task segments one at a time (about 10 seconds each), each turn existing so that -ONE segment gets a complete prompt, the right references and the right continuity mode → -the scripts verify schema, timing and continuity across the whole chain → -`build_track_plan.py` assembles the deliverables at the end. The PRIMARY deliverable is +Goal: produce the `prompt_override` paste for the `easy multiTrackEditor` node in five +moves: the user gives a video idea and a segment count (or an existing workflow to edit) → +you build a timeline guide (`outline.json` — the ONLY JSON the default flow ever writes) +and show it for **approval** → with the approved guide you compose the task segments one +at a time (about 10 seconds each) as PLAIN TEXT files (`segment_01.txt`, …): each file is +ONE scene's complete prompt plus a one-line `# handoff:` note — no ids, no frames, no +media paths, no JSON, because the approved outline row supplies all of that → the scripts +verify timing, continuity and prompt craft across the whole chain → +`build_track_plan.py` merges the fragments and writes the deliverable. The deliverable is `prompt_override.txt` — PLAIN TEXT, the scene prompts joined with `|` on one line (the editor splits on pipes; no JSON), which the user pastes into the multitrack editor node's `prompt_override` input (format `MiniMax`) — the editor then renders one clip per scene, chained back-to-back. The merge adds `[start-end]` / `[start-end,type]` markers per scene when the story needs them (unequal lengths, or a scene that is not the plain-text default -t2v — e.g. r2v). `prompt_override.json` (a `minimax_prompt_override` payload) is the -OPTION for what plain text cannot carry: ``/`