Repository navigation
Description
Idea, not approved work. Recorded from a comparative review; needs a decision before any implementation.
Gap
workflows/templates/minimax/music-video.json cuts every shot at one fixed num_frames (124), from a start_frame set by hand for each shot. transcribe_audio returns word timestamps, but nothing turns timestamps or beats into a shots list, and analyze_audio has no beat analysis.
Idea
A CPU-only timing stack for music videos, in four stages. Each stage ships on its own.
analyze_beatstask.- Beat tracking (librosa
beat_track+onset_backtrack) returns beat times and BPM, with an RMS-peak fallback. - Calibration corrects offset and drift: either warp detected beats through a few user anchors, or build an even BPM grid from one anchor.
- Beat tracking (librosa
- Cut planner task (e.g.
plan_cuts).- Takes transcript chunks plus optional reference lyrics and keeps the user's exact text and line order.
- Segments by line, stanza or beat.
- Options:
include_instrumental_gapswithmin_gap_seconds(intro, break and outro scenes), min/max scene length, a vocal tail pad, andsnap_to_beats. - Emits
shotsentries (start_frame,num_frames,lyric,kind) that plug straight intofor_each.
- Variable-length shots with pad-then-trim.
- Render warm-up/cool-down handles, rounded up to the model grid (H3: 17n+5). Grid rounding comes from the workflow's
variable_constraints, not engine code. - Trim video and audio back to the exact timeline range, using absolute rounded boundaries so drift does not accumulate.
- Leading frames hide the stiff opening, and the shot ends exactly on the cut.
- Render warm-up/cool-down handles, rounded up to the model grid (H3: 17n+5). Grid rounding comes from the workflow's
- Per-shot
kind: vocal | instrumental | brollandsinger.- B-roll and instrumental shots drop the audio conditioning, the singer references and any singing direction.
singerselects which cast references (one or more) a vocal shot uses, which makes duets possible.- The minimax-h3 skill states how to write a B-roll prompt.
Possible value
Music videos cut on the lyrics and the beat, with exact durations, instead of fixed 124-frame shots placed by hand.
Related
htdemucsvocal-stem separation (separate issue) improves Whisper alignment on sung lyrics.- The H3 audio-hold (separate issue) tightens lip sync on vocal shots.
Their files: VRGDG_MusicVideoBuilderNodes.py (beat functions around line 3367; Line Mapping), VRGDG_MiniMaxH3Timing.py, Workflows/LTX-2_Workflows/Video_Builder/readme.md.
Source: concept observed in vrgamegirl19/comfyui-vrgamedevgirl (assessed 2026-10-05). That repo is under a source-available license that is incompatible with our Apache-2.0: re-implement from the concept only, do not copy code, prompt text, or presets verbatim. File references below are to their repo, for understanding the mechanism.
Activity
dkackman commentedon Oct 5, 2026
Related: stems #604, H3 audio-hold #598.
dkackman commentedon Oct 5, 2026
Approved by Don (2026-10-05) at priority:2. Plan it as four stages that ship separately, with analyze_beats first. Model grid rounding stays in the workflow's variable_constraints, never in engine code. Handing to the feature lead for a plan.
dkackman commentedon Oct 5, 2026
Plan v4: music-video timing stack (#600)
Feature lead:
claude-opus-5-5viaanthropic. v1 was the design session ondevelop@ 21cd845, and v2 recorded Don's approval of v1. v3 is a design session ondevelop@ c3fc366. It folds in Don's decision on #627 (2026-10-06): no engine change, everyshotsentry carries all three length fields, and the three smaller gaps are closed. Only stage C changes. Stages A (#625) and B (#626) are built and verified, and they stand. v4 records Don's approval of v3 (2026-10-06): Q6 and Q7 decided as their defaults; no scope change.Verdict: build smaller (unchanged)
Approved scope (Don, 2026-10-05; v3 approved 2026-10-06): stages A–C. Stage D is not approved. After stage C ships and has cut a real music video, D goes back to Don with its Q4 mechanism and with what that run showed about B-roll and per-shot singers. If C closes out first, the feature closes at C and D is filed as its own idea.
The three cuts from the proposal stand:
for_each. Planning is its own run. The agent reads the cut list, writes one prompt per shot and passes the list asshots.dw/dsp.py, and that has shipped in A.music-videolays the whole unbroken song back over the edit withpair_audio. (trim_videostill trims a clip's own audio, so the task is correct when used alone.)Value
shedding-skin-quartet,encanto-uprising,acts-of-chronos,inner-spaceandacorn-wars.transcribe_audiotimestamps that nothing consumed until B.Build cost
slice_audioargument and its preflight, plus the snap carve-out and its test.Inertia
analyze_beatsandplan_cutshave shipped.trim_video, plus one optionallead_framesargument onslice_audio.music-video-cutshas shipped.music-videoentry contract:{name, prompt, start_frame, num_frames, lead_frames, cut_frames}, all required. This is abreaking-change.music-videostops snappingnum_frames. It becomes the one MiniMax template that refuses an off-grid length instead of rounding it. This is deliberate: a snap would silently stretch a render under an explicitcut_frames.tests/test_variable_constraints.py:485gains a named exception for it.Reversibility
trim_videoandslice_audio'slead_framesare additive.breaking-changeeither way. Callers that passnum_frames=get an unknown-variable refusal. Hand-written lists without the three fields are refused with the missing field named.Cheaper alternatives
Overlap
music-video-cutsonce it lands.attribute_voices: feeds stage D'ssingerfield, if D is approved.Problem and non-goals
Problem: cut a music video on its lyric lines and beats, and make each shot exactly as long as its timeline span, from data the server computes.
Non-goals:
kindandsinger(stage D);for_eachentry fields, or entry defaults of any kind. That is Q4, and stage C must not settle it.Design
Corrections (v1's sweep, still true)
for_eachtakes onlyvariable:, so planning is a separate run.plan_cutsas arguments copied from the template's ownvariable_constraints, and the engine holds no H3 number.trim_videois new and writes shots metadata.plan_cutsreturns a dict, which has shipped.New corrections in v3 (from #627's build sweep and this session's sweep)
dw/for_each.py_item(:231-252) refuses anitem:<field>that the entry lacks. Decided (Don, 2026-10-06): every entry carriesnum_frames,lead_framesandcut_frames.plan_cutsemits all three, and the stored default list spells them out. No engine change.dw/references.py:19-28). The slice can't start atstart_frame - lead_framesin the template alone, soslice_audiogainslead_frames(Q6, decided)."snap": "up",music-video.json:84-93), so an off-grid entry is rounded with a notice instead of being refused. Decided: drop the snap inmusic-video.task.pyis at 1192 lines.trim_videogoes in a new module,dw/tasks/trim.py, which registers itself the waycuts.pydoes.for_each.py:345-384). This answers the tester's C-F223 note.plan_cuts'slyricandkindaren't read bymusic-video. A plan passed with only apromptadded validates, with an unread-field warning that names them.lead_framesandcut_framesare read by the trim step, so they don't warn.cut_frames.pair_audio(fit: "video") cuts the song to that length.plan_cutsalready makes Σcut_frames=round(duration_s × fps), rounded once. This answers the tester's C-F224 note.plan_cutssays to runtranscribe_audiowith'timestamps': "segment"and mentionsreturn_timestampsonly as Whisper's name (cuts.py:70-76). Nothing changes here.Surfaces, decided here once (stage C)
plan_cutsgrid arguments:modulus,remainder,min_frames,max_framesandlead_s, all optional. With none of them given, B's behaviour is unchanged.lead_frames = min(round(lead_s × fps), start_frame). The first shot's lead is therefore clamped to 0.num_frames = max(min_frames, smallest modulus·n + remainder ≥ lead_frames + cut_frames). The slack past the cut is a tail handle that gets trimmed.max_framesis split, preferring a beat, and the split is warned about.render_frames, the sum ofnum_frames, so the cost can be quoted.start_frameandcut_frameskeep B's meaning: the timeline cut start and the timeline span.slice_audiolead_frames: optional, default 0, frame form only.start_frame - lead_framesand runsnum_frames.dw/slice_preflight.py,task_domains.pyslice_region) and otherwise at run time.lead_framesgiven together withstart_secondsis refused.trim_video(video, start_frame, num_frames):[start_frame, start_frame + num_frames);dw/shots.py(trimmed_shots), and is added to the constructor list intests/test_shots.py;music-videotemplate:song:{from_previous_result: write_song}, the waysinger_referenceworks.sliceandbalancedread it.num_framesis removed.{name, prompt, start_frame, num_frames, lead_frames, cut_frames}, all required. The stored four-shot default gives each onenum_frames: 124, lead_frames: 0, cut_frames: 124and renders as today.num_framesconstraint (17, 5, 124, 345) stays, withoutsnap. It applies per entry throughitem:num_frames, as indialogue-short, and an off-grid entry is refused atarguments.shots[i].num_frames.cost_driversandvoxel_variablesfollowdialogue-short.slice:lead_frames: item:lead_frames,num_frames: item:num_frames.shot:num_frames: item:num_frames.trim:trim_videoon the member's shot, withstart_frame: item:lead_framesandnum_frames: item:cut_frames.editgatherstrim.pair_audiostays the singlefinalstep.music-video-cuts: passes H3's grid (17, 5, 124, 345) and alead_svariable (default 0.5 s) toplan_cuts. Its description names the new entry contract.Stages
A —
analyze_beats(#625): built and verified.B —
plan_cutsandmusic-video-cuts(#626): built and verified.C — pad-then-trim shots (#627; server deploy, about $7,
breaking-change)trim_video: frame and sample counts, refusals, shots metadata.slice_audiolead_frames: the offset, the negative-start refusal (static and at run time), and the refusal alongsidestart_seconds.plan_cutsgrid arithmetic: a cut undermin_frames, the lead clamp, the split pastmax_frames, andrender_frames.test_for_each.py:618-716: step order, thetrimgroup,editgatherstrim,song, and the per-entrynum_frames;test_plugin_skills.py:345(the six entry keys),:594-603and:638-656;test_variable_constraints.py:485(the namedmusic-videoexception) and:589-600;test_result.py:2320,2345-2350;test_pair_audio_fit.py:188-199;test_step_cache.py:774-781(regenerate theshot@*hashes);test_catalog_structure.py:425,764(description budget and cost).music-videoandmusic-video-cutsdescriptions;minimax-h3SKILL.mdandreferences/cuts.md(the six fields, droppinglyric/kind, and "plan, read, prompt, render");minimax-music3,series-episodesandscript-to-video;trim_video,slice_audiolead_frames, theplan_cutsgrid, and the music-video passage at:2087-2090;WORKFLOW_GUIDE.md:635,784,1632;RECIPES_24GB.md:125;ARCHITECTURE.md:75;num_frames(dw/vram_estimate.py:30).lead_s0.5 at 24 fps,plan_cutsmakes a 2.0 s line intocut_frames48,lead_frames12 (0 for the first shot) andnum_frames124. Everynum_framesis 17n+5 and at least 124. A span that needs more than 345 frames is split and warned about.render_framesis Σnum_frames.start_frameis the previous shot'sstart_frameplus itscut_frames. Σcut_frames=round(duration × fps).slice_audio:start_frame48 withlead_frames12 returns audio starting at frame 36.start_frame0 withlead_frames12 is refused byvalidate_workflow.lead_frameswithstart_secondsis refused.trim_video:music-video:num_frames=at the top level is refused as an unknown variable.lead_frames(or either of the other two) is refused, and the refusal names the field.num_framesof 130 is refused atarguments.shots[i].num_frames, not snapped.song: "asset:…"replaceswrite_song.music-video-cuts'sshots, with apromptadded to each entry, validate asmusic-video'sshots. The only notice is the unread-field warning naminglyric/kind.get_gallery_metadataorassess_output) are exactly thecut_frames.cut_frames.plan.estimateand gets Don's go-ahead first.D —
kindandsingerper shot: not approved, deferred (unchanged from v2).castmap and thekind/singerfields onmusic-video, plus the skill's B-roll section.Order: C is the only stage left. It is #627, re-scoped to this plan. No other feature blocks it.
Risks
cut_frames.render_framesmakes the cost quotable before a run.Questions
num_framesis removed (breaking-change).slice_audiogains an optionallead_framesargument.start_framekeeps meaning the cut start everywhere, and hand-written entries get no fourth field.plan_cuts-emittedslice_framefield per entry.lead_sdefault inmusic-video-cuts. Decided (Don, 2026-10-06): 0.5 s, which is 12 frames at 24 fps and enough to hide H3's stiff opening.45 remaining items
dkackman commentedon Oct 7, 2026
Close-out: back from the final check. Feature lead:
claude-opus-5-5viaanthropic. One case failed, C-F328's render-rule bullet: a docs gap in stage C's skill text, which is a build miss and not a gap in the plan. I filed fix-forward stage #665 for it; its acceptance is C-F328 itself. The design record stands. The parent comes back for its last close-out turn once #665 closes.docs(proposals): #600 - record the #665 fix-forward in the design record
Merge branch 'docs/600-record-fix-forward' into develop (#600)
dkackman commentedon Oct 7, 2026
Close-out: fix-forward done. Feature lead:
claude-opus-5-5viaanthropic.Closed: fix-forward stage #665, which added the render rule (C-F328) to
minimax-h3SKILL.mdandreferences/cuts.md. It was verified. Every stage (#625, #626, #627, #665) is now closed.Design record:
docs/proposals/complete/music-video-timing-complete.mdnow has a Fix-forward: #665 section and a row in the bounces table. Commitbcd84d66, merged todevelopas7f524c4c. These are docs only, so there is no deploy.verify: run every case whose
source:names one of this feature's stages, and close the parent if they all pass.dkackman commentedon Oct 7, 2026
Close-out verify of #600: PASS, closing. Tester: claude-opus-5-5 via anthropic, lem on develop @ 7f524c4.
The last close-out record had one failure: C-F328's render-rule bullet. Every runtime case and every other docs case passed in that record and the two sessions before it (C-F205–C-F218, C-F220, C-F221, C-F323–C-F326; C-F327 was verified in #627). Since then, only #665 has merged (
7f524c4c), and it touches docs only. So in this session I re-ran C-F328:dw:minimax-h3SKILL.md, music-video bullet (loaded with Skill): "an entry'snum_framesismax(124, next 17n+5 ≥ lead + cut), the smallest17n + 5at or abovelead_frames + cut_frames, at least 124; past 345, split the span."references/cuts.md(lines 43–48) states the same rule, with examples: 12 + 48 renders 124, and a 130-frame span renders 141. It also saysmusic-videodoes not snap. The order "Plan, read, prompt, render",music-video-cuts/plan_cuts,lead_sdefault 0.5 s, and droppinglyric/kindare all still there.get_guide("workflows", section="for_each"): namesmusic-videoas a one-shots-list shape. It does not mention a top-levelnum_framesor a shared length.get_guide("recipes", section="MiniMax-H3")(the 24 GB recipes): the grid is17n+5with 345 as the maximum, and nothing contradicts the six-field contract.get_task("trim_video")). It passed in the previous record, and stage C fix-forward: state the music-video render rule in minimax-h3 SKILL.md and cuts.md (C-F328) #665 changed neither the server nor those texts.No case in the suites is marked
pending:for #625/#626/#627/#665. I added no new regression case, because C-F328 already covers this.docs(proposals): dkackman#600 - music-video timing design record, tod…