Nodes/MiniMax H3 Audio T8/MiniMax H3 Duration Planner (T8)
ComfyUI Node

MiniMax H3 Duration Planner (T8)

Turn seconds into valid H3 frame counts (22, 124, 362…)

By T8mars·Created 20 days ago·Updated a day ago· 807
MiniMax H3 Duration Planner (T8)
    • length
    • render_duration_seconds
    • source_slice_start_seconds
    • source_slice_duration_seconds
    • final_trim_start_seconds
    • final_duration_seconds
    • prompt_timing_note
    • report_json
    scene_start_seconds0.00
    scene_duration_seconds5.00
    warmup_seconds0.00
    cooldown_seconds0.00
    ensure_minimum_contexttrue
    source_duration_seconds0.00

    Here's a sentence that will save you a crashed ComfyUI session: you cannot pick any number of frames for H3. The model's latent grid accepts specific frame counts - the README calls out 22, 124, 362 - and "5 seconds sounds right" is exactly how you get an OOM or a refused latent. MiniMaxH3DurationPlannerT8 is the pack's translator: you give it a scene's start time, duration, and optional warmup/cooldown padding, and it hands back the valid length plus the exact slice-and-trim bookkeeping you need to render that window. It's pure math - no sampling, no audio loaded, just a timing plan.

    How it works

    The key insight is that H3 runs video at 24fps on a grid and audio at 40Hz, so a scene that "is 5 seconds" needs a render length that snaps to a valid frame count, then a final trim to the real duration. The planner separates three things so you don't have to:

    • render duration - what you actually sample (the padded, grid-aligned window),
    • source slice - where in the source audio/video to pull from (source_slice_start_seconds / source_slice_duration_seconds),
    • final trim - what you cut after the fact to land exactly on the scene (final_trim_start_seconds / final_duration_seconds).

    Inputs: scene_start_seconds and scene_duration_seconds are the scene; warmup_seconds / cooldown_seconds add context padding before and after (great for a beat of room tone); ensure_minimum_context (default true) refuses to produce a render window too small for H3 to work with; source_duration_seconds defaults to 0 = "unknown" - the sibling MiniMaxH3AudioWindowT8 reads it straight from your AUDIO if you need that.

    Outputs you'll actually wire up

    length (the INT frame count - this is what goes into your sampler's length/frame input), render_duration_seconds, the source-slice pair, the final-trim pair, prompt_timing_note (a string hint like "render includes 0.5s cooldown, trim to 5.0s"), and report_json. In an audio-driven workflow this feeds the Conditioning and the Audio Window so your prompt's timing note and the rendered frames agree on paper before you spend a minute sampling.

    Installing it

    From the MiniMax H3 Audio T8 pack (T8mars/T8star, GPL-3.0). Manager search MiniMax H3 Audio T8, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/T8mars/comfyui-minimax-h3-audio-T8
    

    restart. No forced pip deps; models are yours to place. H3 weights' Community License excludes the US, EU, UK, South Korea.

    The gotcha

    The most common mistake is treating scene_duration_seconds as the output length. It isn't - it's the scene duration, and the planner may render longer and trim, or snap up/down to a valid grid count. Read the prompt_timing_note and the final-trim outputs before you assume your render is exactly 5.000 seconds. And if you're feeding this into an audio window, remember source_duration_seconds = 0 means "unknown," so the plan assumes you'll connect a real source or it stays conservative about context. This node is a planner, not a magician - but it's the difference between "why did that OOM" and "why did that trim perfectly."

    CategoryT8/MiniMax H3/Audio

    Inputs (6)

    NameTypeDefaultDescription
    scene_start_secondsFLOAT0.000–86400
    scene_duration_secondsFLOAT5.000.04–900
    warmup_secondsFLOAT0.000–60
    cooldown_secondsFLOAT0.000–60
    ensure_minimum_contextBOOLEANtrue
    source_duration_secondsFLOAT0.000–864000 means unknown; the Audio Window node reads it from AUDIO.

    Outputs (8)

    NameTypeDescription
    lengthINT
    render_duration_secondsFLOAT
    source_slice_start_secondsFLOAT
    source_slice_duration_secondsFLOAT
    final_trim_start_secondsFLOAT
    final_duration_secondsFLOAT
    prompt_timing_noteSTRING
    report_jsonSTRING