mmprompt/easy-media-track-gate
2026-11-03 01:58:03 +00:00
..
examples track-gate: the txt IS the pipeline - segment fragments are now plain text (segment_NN.txt = the scene prompt verbatim + one '# handoff:' line; the approved outline row supplies id, frames, modes and images, so nothing is retyped and the old verbatim-copy failures cannot happen by construction) and the merge writes ONE file by default: prompt_override.txt for zero-media stories, prompt_override.json for stories with media (tokens are JSON-only); plan.json + track_data.json only behind --plan (the 5B patch path), prompt_override.json behind --json for zero-media continuity modes/locks. verify_track_rules gains fragment_from_text/load_text_fragment/load_fragment_any (reusing validate_fragment + prompt_rules + _check_override_refs stray-token logic on the synthesized fragment; rejects |, hand-written [start-end] markers, @, and zero-media <Picture N>) and the segment command takes .txt or .json in every position incl. --prev; 11 new suite cases, 57/57. SKILL.md/README flipped: outline.json is the only JSON the default flow ever writes; the full JSON fragment is demoted to the variant-b / custom-system-prompt escape hatch; examples/ swaps the three JSON segments + track_data.json for the Sam story's segment_01-03.txt. Proven end to end: outline_sam_park.json + the three txt fragments merge to ONE file byte-identical to the proven prompt_override_r2v_refmod.txt paste 2026-11-03 01:58:03 +00:00
references track-gate: plain text IS the deliverable - the skill told the agent to write JSON (goal line said 'PRIMARY deliverable is prompt_override.json'; smoke test, file lists, Step 4 and Step 5A all JSON-centric), so it kept writing the old format; now the paste is plain text end to end: verify_track_rules gains validate_prompt_override_text (mirror of the pack's parse_override_segments: split on |, strip, drop empties, trailing [s-e(,type)] marker lifted, @imageN/@audioN/@videoN refs vs inventory, <Picture N> and stray @ rejected, marker frames/types pinned to the approved rows, markerless form requires equal row lengths, markers all-or-nothing) + build_plain_text_override (fragment text VERBATIM - newlines survive, six-section structure intact - not the JSON's collapsed prompts; bare-| join, byte-identical to the user's proven node186 paste) and the override command takes .txt or .json; build_track_plan writes prompt_override.txt for EVERY zero-media story (markers auto-added for uneven lengths / non-t2v types), media stories keep JSON-only with an explicit note; SKILL.md/README/schema/wiring docs flipped: plain text default, JSON demoted to the <Picture N>/continuity/locks option; suite 46/46; merge output proven byte-identical to prompt_override_r2v_refmod.txt 2026-11-02 22:26:53 +00:00
build_track_plan.py track-gate: the txt IS the pipeline - segment fragments are now plain text (segment_NN.txt = the scene prompt verbatim + one '# handoff:' line; the approved outline row supplies id, frames, modes and images, so nothing is retyped and the old verbatim-copy failures cannot happen by construction) and the merge writes ONE file by default: prompt_override.txt for zero-media stories, prompt_override.json for stories with media (tokens are JSON-only); plan.json + track_data.json only behind --plan (the 5B patch path), prompt_override.json behind --json for zero-media continuity modes/locks. verify_track_rules gains fragment_from_text/load_text_fragment/load_fragment_any (reusing validate_fragment + prompt_rules + _check_override_refs stray-token logic on the synthesized fragment; rejects |, hand-written [start-end] markers, @, and zero-media <Picture N>) and the segment command takes .txt or .json in every position incl. --prev; 11 new suite cases, 57/57. SKILL.md/README flipped: outline.json is the only JSON the default flow ever writes; the full JSON fragment is demoted to the variant-b / custom-system-prompt escape hatch; examples/ swaps the three JSON segments + track_data.json for the Sam story's segment_01-03.txt. Proven end to end: outline_sam_park.json + the three txt fragments merge to ONE file byte-identical to the proven prompt_override_r2v_refmod.txt paste 2026-11-03 01:58:03 +00:00
README.md track-gate: the txt IS the pipeline - segment fragments are now plain text (segment_NN.txt = the scene prompt verbatim + one '# handoff:' line; the approved outline row supplies id, frames, modes and images, so nothing is retyped and the old verbatim-copy failures cannot happen by construction) and the merge writes ONE file by default: prompt_override.txt for zero-media stories, prompt_override.json for stories with media (tokens are JSON-only); plan.json + track_data.json only behind --plan (the 5B patch path), prompt_override.json behind --json for zero-media continuity modes/locks. verify_track_rules gains fragment_from_text/load_text_fragment/load_fragment_any (reusing validate_fragment + prompt_rules + _check_override_refs stray-token logic on the synthesized fragment; rejects |, hand-written [start-end] markers, @, and zero-media <Picture N>) and the segment command takes .txt or .json in every position incl. --prev; 11 new suite cases, 57/57. SKILL.md/README flipped: outline.json is the only JSON the default flow ever writes; the full JSON fragment is demoted to the variant-b / custom-system-prompt escape hatch; examples/ swaps the three JSON segments + track_data.json for the Sam story's segment_01-03.txt. Proven end to end: outline_sam_park.json + the three txt fragments merge to ONE file byte-identical to the proven prompt_override_r2v_refmod.txt paste 2026-11-03 01:58:03 +00:00
SKILL.md track-gate: the txt IS the pipeline - segment fragments are now plain text (segment_NN.txt = the scene prompt verbatim + one '# handoff:' line; the approved outline row supplies id, frames, modes and images, so nothing is retyped and the old verbatim-copy failures cannot happen by construction) and the merge writes ONE file by default: prompt_override.txt for zero-media stories, prompt_override.json for stories with media (tokens are JSON-only); plan.json + track_data.json only behind --plan (the 5B patch path), prompt_override.json behind --json for zero-media continuity modes/locks. verify_track_rules gains fragment_from_text/load_text_fragment/load_fragment_any (reusing validate_fragment + prompt_rules + _check_override_refs stray-token logic on the synthesized fragment; rejects |, hand-written [start-end] markers, @, and zero-media <Picture N>) and the segment command takes .txt or .json in every position incl. --prev; 11 new suite cases, 57/57. SKILL.md/README flipped: outline.json is the only JSON the default flow ever writes; the full JSON fragment is demoted to the variant-b / custom-system-prompt escape hatch; examples/ swaps the three JSON segments + track_data.json for the Sam story's segment_01-03.txt. Proven end to end: outline_sam_park.json + the three txt fragments merge to ONE file byte-identical to the proven prompt_override_r2v_refmod.txt paste 2026-11-03 01:58:03 +00:00
verify_track_rules.py track-gate: the txt IS the pipeline - segment fragments are now plain text (segment_NN.txt = the scene prompt verbatim + one '# handoff:' line; the approved outline row supplies id, frames, modes and images, so nothing is retyped and the old verbatim-copy failures cannot happen by construction) and the merge writes ONE file by default: prompt_override.txt for zero-media stories, prompt_override.json for stories with media (tokens are JSON-only); plan.json + track_data.json only behind --plan (the 5B patch path), prompt_override.json behind --json for zero-media continuity modes/locks. verify_track_rules gains fragment_from_text/load_text_fragment/load_fragment_any (reusing validate_fragment + prompt_rules + _check_override_refs stray-token logic on the synthesized fragment; rejects |, hand-written [start-end] markers, @, and zero-media <Picture N>) and the segment command takes .txt or .json in every position incl. --prev; 11 new suite cases, 57/57. SKILL.md/README flipped: outline.json is the only JSON the default flow ever writes; the full JSON fragment is demoted to the variant-b / custom-system-prompt escape hatch; examples/ swaps the three JSON segments + track_data.json for the Sam story's segment_01-03.txt. Proven end to end: outline_sam_park.json + the three txt fragments merge to ONE file byte-identical to the proven prompt_override_r2v_refmod.txt paste 2026-11-03 01:58:03 +00:00

Easy-Media Track Gate

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 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. 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 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, <Picture N> and stray @ rejected) and JSON payload (durations, generation/continuity modes, exact <Picture N> sets, track locks)
Fragment hygiene Plain-text segment files reject `

Folder

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 → 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 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.

Install (portable skills folder)

Copy the whole folder next to your other skills:

%USERPROFILE%\.agent\skills\easy-media-track-gate\

SKILL.md must sit directly in that folder (not nested one level deeper). Start a fresh agent task after installing so the skill list refreshes. The node pack's own easy-media-multitrack-workflow skill stays installed independently — this gate produces its plan input and defers execution to it.

Quick start

:: smoke test
py -3 "%USERPROFILE%\.agent\skills\easy-media-track-gate\verify_track_rules.py"

:: 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.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 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
py -3 "%USERPROFILE%\.agent\skills\easy-media-track-gate\verify_track_rules.py" override prompt_override.txt --outline outline.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 <ComfyUI>\custom_nodes\ComfyUI-Easy-Media\skills\easy-media-multitrack-workflow\scripts\patch_workflow.py apply WORKFLOW.json --plan plan.json --output RESULT.json --write

Provenance notes

  • The schema reference is a faithful English translation of ComfyUI-Easy-Media/skills/easy-media-multitrack-workflow/references/multitrack-schema.md (which is written in Chinese); field names, enums and limits were additionally cross-checked against the node pack's patch_workflow.py source, and the generated example plan was dry-run-applied to the bundled v1.3.0 blank template successfully.
  • Upstream leaves prompt quality, outline discipline and id/timing pins to discipline; this gate makes them machine-checked. Everything upstream checks mechanically is checked here with the same rules.
  • Upload (/upload/image) and queue (submit_workflow.py) remain the node pack's own flows and are only used on the user's explicit request.