Nodes/RUI-Nodes/镜头分词器 / Shot Splitter
ComfyUI Node

镜头分词器 / Shot Splitter

Slice a storyboard script into individual shots

By rui40000·Created 3 years ago·Updated 13 days ago· 17
镜头分词器 / Shot Splitter
    • shot_descriptions
    • summary
    input_text
    start_shot_num0
    shot_count0

    If your workflow involves turning a written storyboard into actual frames, you've probably felt the pain this node removes. You ask an LLM to write a scene-by-scene script, it hands you one giant blob of text, and now you need to break that blob into individual shot descriptions before you can generate one image per shot. Shot Splitter does exactly that: it takes a multi-shot script and outputs a proper list, one entry per shot, ready to feed a batch-generation loop.

    It's one of the text-tooling nodes in RUI-Nodes - the pack's author clearly builds comic and animation pipelines, because this node plus Dialogue Extractor and Page Narration Remover form a little storyboard-to-render assembly line. The workflow shape is: LLM writes the script → Shot Splitter breaks it up → the list feeds an image-generation batch → Dialogue Extractor pulls the voiceover lines. If you're doing anything like that, these three nodes are why the pack is worth installing.

    How it works

    The input text is expected to wrap each shot in explicit tags:

    <SHOT_1>
    the first shot's description
    </SHOT_1>
    <SHOT_2>
    the second shot's description
    </SHOT_2>
    

    The node splits on those tags and returns shot_descriptions as a LIST - one string per shot, in order. Then two optional knobs let you pull a slice instead of the whole thing: start_shot_num (0 = start at the first shot) and shot_count (0 = take everything through the end). Want shots 3 through 5? start_shot_num = 3, shot_count = 3. The summary output is a plain string with an overview of what was extracted - handy for logging or feeding a display node.

    The inputs you'll set:

    • input_text - the multi-line script, with <SHOT_XXX> tags.
    • start_shot_num / shot_count - optional range slicing.

    Outputs: shot_descriptions (LIST) and summary (STRING).

    Installing it

    Part of the RUI-Nodes pack ("Rui-Node🐶"). Install once via ComfyUI Manager (search "RUI-Nodes") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/rui40000/RUI-Nodes
    cd RUI-Nodes
    pip install -r requirements.txt
    

    Restart after. Pure Python text processing - no extra dependencies.

    Where people get burned

    The format requirement is the whole game. If your LLM outputs shots with markdown headers or arbitrary separators instead of the <SHOT_N> tags, the node has nothing to split on and you'll get one giant entry. The fix is in the prompt: tell the model to emit the tags. Also worth noting the node recognizes a few spellings of the tag ("镜头1", "分镜2", "Shot 3" are mentioned in the tooltip), so it's more forgiving than strict XML - but your best bet is still to make the source script well-formed. And since shot_descriptions is a list, it feeds list-consuming batch nodes directly; if your target wants single strings, wire in a list-to-string step.

    CategoryRui-Node🐶/文本处理📝

    Inputs (3)

    NameTypeDefaultDescription
    input_textSTRING多分镜脚本原文。节点会识别「镜头1 / 分镜2 / Shot 3」 这类编号标记,把整段脚本拆成一条条独立的分镜描述。
    start_shot_numoptINT00–100从第几号镜头开始取,0 表示从头开始。 用于跳过前面已经出过图的镜头。
    shot_countoptINT00–100取多少个镜头,0 表示一直取到结尾。 与上面的起始号配合,可以分批处理长脚本。

    Outputs (2)

    NameTypeDescription
    shot_descriptionsLIST
    summarySTRING