DiffusionGemma Audio-Aware H3 Multi-Shot Planner
Slices one long H3 prompt into up to four renderable generation lanes
- plan_json
- status
- ready
- effective_shot_count
- shot_1_prompt
- shot_1_start
- shot_1_duration
- shot_1_frames
- shot_1_ready
- shot_2_prompt
- shot_2_start
- shot_2_duration
- shot_2_frames
- shot_2_ready
- shot_3_prompt
- shot_3_start
- shot_3_duration
- shot_3_frames
- shot_3_ready
- shot_4_prompt
- shot_4_start
- shot_4_duration
- shot_4_frames
- shot_4_ready
MiniMax H3's native clips are 4–15 seconds. Your music video is 30, 60, 90. Somebody has to divide the one long validated Ref2VA prompt into multiple H3 generation passes - and if that "somebody" is a naive split at 15 seconds, you get cuts landing mid-shot, timestamps going stale, and continuity wrecked. DiffusionGemma Audio-Aware MultiShot Planner is the node that does this division deliberately: it breaks a validated Ref2VA prompt into one to four H3 generation segments, preferring native [Shot N] boundaries, and carries enough state across each seam that later native timestamps stay exact.
It's the planning heart of the music-video stack. A Project Master Contract upstream locks the approved song hash, excerpt, duration, and the hard lane ceiling; the planner respects that ceiling; downstream, the H3 Relay Reference Gate feeds each later lane the previous lane's tail for continuity, and the Shot Assembler joins the segments back into one master.
How it decides where to cut
The planner wants to cut at native shot boundaries with measured low-density recovery (regions where the camera isn't frenetic), then native-only and mixed native/recovery sequences. If no seam can obey every hard lane-duration limit, it falls back to deterministic duration-balanced seams - and crucially, it records each seam's literal provenance and carries the source shot already active at a non-native seam into the next lane, so a shot that starts in lane 2 and ends in lane 3 keeps its exact native timestamps. Timestamped sub-cues get the same treatment: the latest elapsed cue becomes explicit opening-state history, in-lane cues are rebased, future cues are deferred to the later lane rather than firing early or being dropped.
Inputs that matter
measured_audio_report_json- the decoded-audio measurements (from the selector) that make the plan audio-aware.base_h3_prompt- the validated Ref2VA prompt from the Director.performance_mode- defaultDance / music sync; Natural/Dance/Lyrics travel into each segment's local contract.excerpt_start_seconds/excerpt_duration_seconds- where in the soundtrack the plan lives.project_manifest_json- the Project Master manifest; its lane ceiling is authoritative.preferred_shot_seconds(12) - a legacy, non-binding hint, auto-limited to the active min/max range.min_shot_seconds(5) andmax_shot_seconds(15) are the legacy-named hard bounds for one H3 pass; multiple native[Shot N]blocks may remain inside a single pass.identity_picture_count-1preserves the legacy single-identity anchor;2dual-identity mode keeps Picture 1 as body/wardrobe/composition authority and Picture 2 as multi-panel evidence for the same semantic Subject.continuity_relay_mode-Previous lane tailpreserves the sequential relay;Offremoves the continuity Picture from prompts and conditioning so lanes run independently.reference_manifest- the exact host manifest used by the Ref2VA Director.timed_lyrics_report_json- optional hash-locked lyric alignment evidence. Missing, stale, weak, or invalid evidence safely falls back to Natural/audio-led sync; written lyrics are never treated as a timing schedule.
Outputs include plan_json, effective_shot_count, and per-shot prompt/start/duration/frames/ready for up to four lanes.
The honest edge cases
Lyrics mode accepts only a validated timed-lyrics report: verified events are clipped into each lane's local clock, fully instrumental lanes are marked non-vocal, and anything weak falls back to Natural rather than blocking the video or inventing singing. Structural errors - invalid clocks, duplicate/gapped/empty native shot blocks, out-of-range timestamps, stale audio locks, malformed identity manifests, impossible min/max limits, more than four required lanes - fail closed.
Installing it
One of the pack's prompt/diffusiongemma/production-planning nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/exportAnything/ComfyUI-DiffusionGemmaPromptBuilder
or ComfyUI Manager → DiffusionGemma Prompt Builder → restart. Pure planning logic over JSON - no model of its own. The DiffusionGemma model (ComfyUI/models/LLM/diffusiongemma-26B-A4B-it-NVFP4) runs upstream in the Director; H3 weights matter when you actually render the lanes.
Common issues
- Seams you didn't author. If native shot boundaries can't honor the hard cap, the planner uses deterministic duration-balanced seams and says so in
plan_json- check the boundary-policy revision and carry-in fragments before assuming clean shot-to-shot cuts. - Lane count confusion.
effective_shot_count/generation lanes are not the native[Shot N]count - one lane can hold several native shots. Don't feed lane counts back into a Target Profile'sshot_count. - Relay doing nothing. If continuity is off in the plan, the downstream relay gate returns nothing and later lanes run independent - that's configured behavior, not a bug.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| measured_audio_report_json | STRING | — | |
| base_h3_prompt | STRING | — | |
| performance_mode | STRING | Dance / music sync | — |
| excerpt_start_seconds | FLOAT | 0.00 | — |
| excerpt_duration_seconds | FLOAT | 15.000.1–60 | — |
| preferred_shot_seconds | FLOAT | 12.05–15 | Legacy non-binding hint for one H3 generation pass. It is automatically limited to the active minimum/maximum range and never overrides the Project Master ceiling. |
| min_shot_seconds | FLOAT | 5.01–15 | Legacy name: minimum duration of one separate H3 generation pass. |
| max_shot_seconds | FLOAT | 15.05–15 | Legacy name: hard maximum duration of one H3 generation pass. Multiple native [Shot N] blocks may remain inside. The planner prefers evidence-aligned seams but always honors this cap with a truthful deterministic fallback when needed. |
| project_manifest_json | STRING | — | |
| lyricsopt | STRING | — | |
| identity_picture_countopt | INT | 11–2 | 1 preserves the legacy Picture 1 identity anchor. 2 keeps Picture 1 as body/wardrobe/composition authority and uses Picture 2 only as multi-panel evidence for the same semantic Subject. |
| continuity_relay_modeopt | COMBO | Previous lane tail | Previous lane tail preserves the established sequential relay. Off removes the continuity Picture from both prompts and native conditioning so generation lanes may run independently. |
| reference_manifestopt | STRING | The exact host reference manifest used by the Ref2VA Director. Dual identity mode requires consecutive Picture 1/Picture 2 rows, each tagged [dg:identity,appearance]. | |
| timed_lyrics_report_jsonopt | STRING | Optional hash-locked lyric alignment evidence. Missing, stale, weak, or invalid evidence safely falls back to Natural / audio-led sync. |
Outputs (24)
| Name | Type | Description |
|---|---|---|
| plan_json | STRING | — |
| status | STRING | — |
| ready | BOOLEAN | — |
| effective_shot_count | INT | — |
| shot_1_prompt | STRING | — |
| shot_1_start | FLOAT | — |
| shot_1_duration | FLOAT | — |
| shot_1_frames | INT | — |
| shot_1_ready | BOOLEAN | — |
| shot_2_prompt | STRING | — |
| shot_2_start | FLOAT | — |
| shot_2_duration | FLOAT | — |
| shot_2_frames | INT | — |
| shot_2_ready | BOOLEAN | — |
| shot_3_prompt | STRING | — |
| shot_3_start | FLOAT | — |
| shot_3_duration | FLOAT | — |
| shot_3_frames | INT | — |
| shot_3_ready | BOOLEAN | — |
| shot_4_prompt | STRING | — |
| shot_4_start | FLOAT | — |
| shot_4_duration | FLOAT | — |
| shot_4_frames | INT | — |
| shot_4_ready | BOOLEAN | — |