Nodes/ComfyUI_Yvann-Nodes/Audio Prompt Schedule
ComfyUI Node

Audio Prompt Schedule

A different prompt for every beat

By yvann-ba·Created 2 years ago·Updated 6 months ago· 708
Audio Prompt Schedule
    • prompt_schedule
    peaks_index
    prompts

    Text-to-video is fun; text-to-video where the subject changes on the beat is a whole different thing. Audio Prompt Schedule is the node that takes your detected beats and attaches a different prompt to each one, producing a schedule string that a batch prompt scheduler can consume. One prompt for the verse, another for the chorus, another for the drop - switching at exactly the frames the music demands.

    How it works

    Two inputs, one output.

    • peaks_index - the comma-separated frame list straight from Audio Peaks Detection's peaks_index output ("0, 24, 53, 91").
    • prompts - a multiline string, one prompt per line.

    The node pairs them up: frame 0 gets prompt 1, frame 24 gets prompt 2, frame 53 gets prompt 3, and so on. Fewer prompts than peaks? They cycle - prompt 1, 2, 3, then back to 1. Blank lines are stripped, so just write one prompt per line and don't worry about spacing.

    The output prompt_schedule is a formatted string that maps each frame index to its prompt:

    "0": "a lone dancer in a spotlight, dark stage",
    "24": "the same dancer, neon lights flashing",
    "53": "an explosion of confetti, close up",
    

    That format is what the batch prompt schedule nodes from Fizz Nodes (and similar schedulers) expect, so you wire prompt_schedule straight into one of those, and it handles the frame-by-frame conditioning.

    Why it's useful

    Most music videos don't want one prompt for the whole clip - they want the imagery to shift with the song structure. This node is the cheapest way to get that: no manual keyframing, no frame-by-frame editing. You write a prompt per section, the peaks decide where the sections are, and the scheduler does the interpolation. For a 16–32 frame clip it's often enough to change the prompt alone to sell the "reactive" feel, before you even add IPAdapter or ControlNet.

    Gotchas

    The schedule only switches at detected peaks, so the output is only as good as your peaks. If Audio Peaks Detection is set too aggressively, prompts will flip multiple times per second - again, raise the threshold upstream until each prompt gets a real musical phrase to live in.

    Also note the peaks list includes the prepended 0 (Audio Peaks Detection adds it), so your first prompt lands on frame 0 automatically - that's expected, not a bug.

    One more: the output is a string, not a special node type. It's meant to plug into a scheduler's text input. If you drop it somewhere expecting a different format, you'll get nothing visible and a confusing failure. Read the target node's docs for its exact schedule syntax, then shape your prompts accordingly.

    Install

    Same as the whole pack - ComfyUI Manager → search ComfyUI_Yvann-Nodes, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yvann-ba/ComfyUI_Yvann-Nodes
    

    Restart, and if you don't already have Fizz Nodes installed, grab it from Manager too - this node's output is only as useful as the scheduler you plug it into.

    Category👁️ Yvann Nodes/🔊 Audio

    Inputs (2)

    NameTypeDefaultDescription
    peaks_indexSTRINGComma-separated frame indices from Audio Peaks Detection
    promptsSTRINGOne prompt per line, loops if fewer prompts than peaks

    Outputs (1)

    NameTypeDescription
    prompt_scheduleSTRING