Nodes/Symbiotica/Hypereel Duration Parse (script to prompt + seconds)
ComfyUI Node

Hypereel Duration Parse (script to prompt + seconds)

Strip the DURATION line off your LLM script so the video node doesn't choke

By symbiotica-ai·Created 6 months ago·Updated about 12 hours ago· 2
Hypereel Duration Parse (script to prompt + seconds)
    • prompt
    • seconds
    • seconds_float
    script

    This is a small node with an unglamorous job, and it's exactly the kind of thing that saves you ten minutes of wiring and one regex you'll never get right. In the Hypereel pipeline (symbiotica-ai/comfyui-nodes), the script LLM doesn't just write your reel's voiceover - it also ends its output with a trailing DURATION: N line telling you how long the video should be. Hypereel Duration Parse reads that raw output, strips the duration line, and hands you two things: the clean prompt and the number.

    Why it exists

    If you fed the raw LLM output into the video generation node, the DURATION: N line would ride along as part of the prompt - and you'd get whatever the model does with "and make it 12 seconds, thanks" appended to a UGC script. Probably not nothing, but definitely not reliable. Splitting it cleanly means the prompt stays prompt and the number feeds the video node's duration input. That's the whole point of a parse node in an LLM chain: take the model's structured output and turn it into distinct wires.

    The mechanism

    It reads the script, strips the trailing DURATION: N line, and clamps the number to the 4–15 second range. Missing line? Defaults to 12 seconds rather than erroring. That clamp and default are the two details worth knowing, because an LLM will happily say DURATION: 3 or DURATION: 30 and the node refuses to let either one through to a video API that can't handle it.

    Inputs and outputs

    One input: script - the script LLM's raw output. That's it.

    Three outputs:

    • prompt - the clean script with the duration line removed. Wire it onward into whatever builds the final video prompt.
    • seconds - the clamped duration as an INT (4–15, default 12).
    • seconds_float - the same value as a FLOAT, for nodes whose duration input wants a float.

    Wire seconds (or seconds_float, matching the target's type) into the video node's duration input. In Hypereel's intended flow that's a Seedance-class video node, but this works with anything that takes a duration.

    Install

    Part of symbiotica-ai/comfyui-nodes - ComfyUI Manager search "Symbiotica", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/symbiotica-ai/comfyui-nodes.git symbiotica
    pip install -r symbiotica/requirements.txt
    

    Restart ComfyUI. No API key, no model download - this is pure string handling.

    Gotchas

    The format is specific: it expects a line that reads DURATION: N (colon, number) at the end. If your script LLM decides to phrase it as "Duration should be around ten seconds" in prose, the node won't find the line and you'll get the 12-second default silently - which is fine, but know that's what's happening. If you're writing your own task prompt for the script step, keep the DURATION: N contract explicit so this node (and Hypereel Analysis Prompt, which sets up the same discipline for timestamps) has something to parse.

    CategorySymbiotica/Hypereel

    Inputs (1)

    NameTypeDefaultDescription
    scriptSTRINGThe script LLM's raw output.

    Outputs (3)

    NameTypeDescription
    promptSTRING
    secondsINT
    seconds_floatFLOAT