ComfyUI Node

Prompt Batch Generator

Stop repeating the same prompt every 81 frames — tell a story instead

By Ltamann·Created about a year ago·Updated 7 months ago· 20
Prompt Batch Generator
    • prompt_string
    total_frames_in_seconds81
    frames_per_batch81
    text_input_1
    text_input_2
    text_input_3
    text_input_4
    text_input_5
    strength_15
    strength_25
    strength_35
    strength_45
    strength_55

    If you've generated AI video in ComfyUI - Wan, LTX, Hunyuan, any of them - you've met the 81-frame wall: your video is actually a sequence of fixed-length batches, and most workflows feed the same prompt to every batch, so the model holds a static pose and repeats itself until the clip ends. The author of this node felt that pain specifically, and his fix is simple: let each batch get its own prompt, chosen randomly from a set you provide, weighted by how much you want each one to show up. Pipe the result into your video pipeline and you get a clip that changes behavior over time instead of looping in place.

    How it works

    You give it up to five prompts (text_input_1 through text_input_5) and a strength_1strength_5 for each (1–10, default 5). Empty text inputs are ignored, so you can use one prompt or five. Then:

    • total_frames_in_seconds - your clip's total length (default 81).
    • frames_per_batch - the model's batch size (default 81, the classic Wan/LTX batch).

    It divides total frames by batch size (rounding up) to get the number of batches, then for each batch it randomly picks a prompt, weighted by its strength - strength 10 appears twice as often as strength 5. All the picks get joined with | into one string, which is the output: prompt_string.

    That pipe-separated string is the format ComfyUI video workflows already use to vary prompts per batch, so the output drops straight into your text-encode / conditioning node. The weighting is the clever part: it's not a rigid "prompt A for 3 batches, then B" script - it's a probability distribution, so sequences come out natural and slightly different every run, and it always fills the exact length of your clip.

    What to watch

    • frames_per_batch is capped at 120 in the UI, which matches typical video batch sizes - fine for Wan-style models, but if your pipeline uses bigger batches you'll want to check the math.
    • The randomness is seed-free: you can't reproduce a given prompt sequence run-to-run with this alone. If you need a fixed sequence, this isn't the tool (it's a generator, not a scheduler).

    Install

    Manager → search TBG Takeaways → install, restart:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Ltamann/ComfyUI-TBG-Takeaways
    

    Under TBG/Takeaways after restart. No deps, no model downloads.

    Reach for this the moment your video clips start feeling repetitive - "same smile for 81 frames" is a real, widely-hit annoyance, and this is a zero-friction fix: five prompts, five strengths, one pipe-separated output. It won't give you a plotted story arc, just variety with a weighted bias, which is honestly the right amount of control for most people. It's a small node from a Patreon-backed experimental pack, but for this specific pain it does exactly one job and does it cleanly.

    CategoryTBG/Takeaways

    Inputs (12)

    NameTypeDefaultDescription
    total_frames_in_secondsINT811–30000
    frames_per_batchINT811–120
    text_input_1STRING
    text_input_2STRING
    text_input_3STRING
    text_input_4STRING
    text_input_5STRING
    strength_1INT51–10
    strength_2INT51–10
    strength_3INT51–10
    strength_4INT51–10
    strength_5INT51–10

    Outputs (1)

    NameTypeDescription
    prompt_stringSTRING