Nodes/VRGameDevGirl Video Enhancement Nodes/VRGDG_IndexedPromptChunker
ComfyUI Node

VRGDG_IndexedPromptChunker

One Giant Prompt, Fifty Scene-Sized Prompts, Zero Copy-Paste

By vrgamegirl19·Created about a year ago·Updated about 7 hours ago· 718
VRGDG_IndexedPromptChunker
    • text_output_1
    • text_output_2
    • text_output_3
    • text_output_4
    • text_output_5
    • text_output_6
    • text_output_7
    • text_output_8
    • text_output_9
    • text_output_10
    • text_output_11
    • text_output_12
    • text_output_13
    • text_output_14
    • text_output_15
    • text_output_16
    • text_output_17
    • text_output_18
    • text_output_19
    • text_output_20
    • text_output_21
    • text_output_22
    • text_output_23
    • text_output_24
    • text_output_25
    • text_output_26
    • text_output_27
    • text_output_28
    • text_output_29
    • text_output_30
    • text_output_31
    • text_output_32
    • text_output_33
    • text_output_34
    • text_output_35
    • text_output_36
    • text_output_37
    • text_output_38
    • text_output_39
    • text_output_40
    • text_output_41
    • text_output_42
    • text_output_43
    • text_output_44
    • text_output_45
    • text_output_46
    • text_output_47
    • text_output_48
    • text_output_49
    • text_output_50
    prompt_text
    scene_count16
    index0
    total_sets1

    VRGDG_IndexedPromptChunker takes one big multiline prompt and carves it into scene_count smaller chunks, exposing each chunk on its own output socket. It's the node that turns a single LLM-generated "here's the whole music video" prompt into the per-scene prompts your sampler actually consumes.

    Here's the shape of the problem. A video model like LTX works best on short, focused prompts, and the modern way to write them is to have an LLM draft the entire video as one structured text - every scene, every camera move, every lighting change. But a sampler can't eat 2,000 words at once, and you don't want to hand-copy each scene into its own node. This node is the seam: paste the whole thing into prompt_text, tell it how many scenes exist, and the scene prompts come out the other side ready to wire into per-chunk conditioning.

    Inputs that matter

    • prompt_text - the full multi-scene prompt, one scene per logical block.
    • scene_count - how many chunks to split into (1–50, default 16).
    • index - which "set" of scenes this run processes.
    • total_sets - how many sets the whole video is divided into.

    Those last two are the interesting part, and they're what make this node scalable. If your video is 48 scenes but you want to generate in three runs of 16, you set total_sets = 3 and feed index = 0, then 1, then 2 across runs - each run's chunker hands you the matching 16 scene prompts instead of always starting from scene one. It's a poor-man's batching system for long videos.

    The output layout

    You get 50 text_output_1 through text_output_50 sockets, and the node fills as many as scene_count needs. In practice you wire text_output_1 into the first scene's CLIP encoder or conditioning block, text_output_2 into the second, and so on. The sockets exist whether or not they're populated, so unused ones just sit empty - wire only what you need.

    Why it matters here

    This is the connective tissue of the VRGameDevGirl music-video workflow: VRGDG_MusicVideoPromptCreatorV3 generates the full run, this chunker splits it into scene prompts, and each chunk feeds an LTX generation. Without it you'd be rebuilding the per-scene plumbing every time the LLM decided the video should have a different number of scenes.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl
    

    Restart ComfyUI; it's under VRGDG. ComfyUI Manager users search vrgamedev. No extra models or downloads - the pack's requirements.txt (kornia, librosa, imageio) covers the heavier nodes, and this one is pure string splitting.

    Honest note

    The chunking is deterministic and dumb - it splits by scene block and trusts your formatting. If your LLM doesn't separate scenes cleanly (blank lines, numbered markers, whatever you prompt it to use), the chunks come out misaligned and the whole downstream graph inherits the mess. Keep the prompt format consistent and this node is invisible; break the format and it's the first place to check.

    CategoryVRGDG

    Inputs (4)

    NameTypeDefaultDescription
    prompt_textSTRING
    scene_countINT161–50
    indexINT00–999
    total_setsINT11–999

    Outputs (50)

    NameTypeDescription
    text_output_1STRING
    text_output_2STRING
    text_output_3STRING
    text_output_4STRING
    text_output_5STRING
    text_output_6STRING
    text_output_7STRING
    text_output_8STRING
    text_output_9STRING
    text_output_10STRING
    text_output_11STRING
    text_output_12STRING
    text_output_13STRING
    text_output_14STRING
    text_output_15STRING
    text_output_16STRING
    text_output_17STRING
    text_output_18STRING
    text_output_19STRING
    text_output_20STRING
    text_output_21STRING
    text_output_22STRING
    text_output_23STRING
    text_output_24STRING
    text_output_25STRING
    text_output_26STRING
    text_output_27STRING
    text_output_28STRING
    text_output_29STRING
    text_output_30STRING
    text_output_31STRING
    text_output_32STRING
    text_output_33STRING
    text_output_34STRING
    text_output_35STRING
    text_output_36STRING
    text_output_37STRING
    text_output_38STRING
    text_output_39STRING
    text_output_40STRING
    text_output_41STRING
    text_output_42STRING
    text_output_43STRING
    text_output_44STRING
    text_output_45STRING
    text_output_46STRING
    text_output_47STRING
    text_output_48STRING
    text_output_49STRING
    text_output_50STRING