ComfyUI Node

VRGDG Cycling Text Picker

One text list, five ways to pick from it

By vrgamegirl19·Created about a year ago·Updated about 7 hours ago· 718
VRGDG Cycling Text Picker
    • formatted_text
    • selected_item
    • selected_items
    • wrapped_index
    • item_count
    index0
    itemsslow push in wide orbit handheld follow low angle reveal crane up
    labelCamera Motion
    max_items0
    split_mode
    selection_mode
    seed0
    multi_format
    two_item_templatestart with {item1} then follow with {item2}
    keep_emptyfalse
    pick_count1

    You've got a list of camera moves - "slow push in, orbit left, handheld follow" - and you want them to rotate through your video, one per scene, with no manual work and no 20-node spaghetti. That's the whole job of VRGDG Cycling Text Picker. It's the little machine that powers the camera-motion lines in VRGameDevGirl's music video workflows, and once you've used it you'll start dropping it into everything.

    How it works. The node parses your items string into a list, then picks one (or more) based on an index you feed in. The clever part is the index is a step, not a static selection - so you wire in the current frame/scene number and the picker hands you a different text entry every step. In index mode it wraps: with five items, index 4 is item 5 and index 5 rolls back to item 1, so a long run cycles the list forever without you pre-computing anything.

    There are two seeded random modes worth knowing. random gives each index a seeded-random item. random no repeat is the one you actually want for camera moves: it shuffles the list once, walks through every item, then reshuffles - so with five moves you'll see all five before any repeats. Same seed plus same index gives the same result, which is what keeps a workflow reproducible run to run.

    The inputs that matter. Honestly, only a handful:

    • index - the step number that drives selection. Feed it from your frame counter or scene index.
    • items - your list. One per line works, but it also swallows comma/pipe-separated text, JSON arrays, and JSON objects with an items/values key.
    • selection_mode - index, random, or random no repeat.
    • pick_count - how many items to select at once. Set it to 2 and the two_item_template ("start with {item1} then follow with {item2}") builds a natural transition sentence.
    • seed - matters only in the random modes.

    The rest (split_mode, max_items, keep_empty, multi_format) are fine on their defaults. label is nice though: a label of "Camera Motion" turns the output into Camera Motion = slow push in, which reads great when it lands in a prompt.

    The outputs. formatted_text is the one you'll wire into a prompt - label plus selected text, or just the text if you leave label blank. You also get selected_item, selected_items (for pick_count > 1), plus wrapped_index and item_count if you need to chain the logic downstream.

    Installing. The pack shows up in ComfyUI Manager - search vrgamedev - or clone it manually:

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

    This node itself is pure text logic, but the pack drags in a long requirements.txt (kornia, librosa, llama-cpp-python and friends), so let Manager install it rather than fighting the deps.

    Where people get burned: the parsing. A stray blank line in your items list becomes an empty selectable entry unless you leave keep_empty off (the default). And if you paste a Python-style list that has a typo, split_mode: auto will fall back to line-splitting and treat the whole thing as one giant item. When something looks wrong, check the item_count output - if it says 1, your list didn't parse the way you thought.

    CategoryVRGDG/General

    Inputs (11)

    NameTypeDefaultDescription
    indexINT0-999999–999999The step number used to choose from the list. In index mode this wraps around automatically: with 5 items, index 0 selects item 1, index 4 selects item 5, and index 5 starts over at item 1. In random modes, this still acts like the current step so each frame/batch/index can pick a different item.
    itemsSTRINGslow push in wide orbit handheld follow low angle reveal crane upThe list of text choices to pick from. Works with one item per line, blank-line-separated chunks, comma-separated text, pipe-separated text, JSON arrays like ["push in", "orbit left"], Python-style lists/sets, or JSON objects with an items/values/motions key. Example: slow push in, orbit left, handheld follow.
    labelSTRINGCamera MotionOptional name placed before the selected text in the formatted output. Example label Camera Motion outputs: Camera Motion = slow push in. Leave blank if you only want the selected text with no prefix.
    max_itemsINT00–999999Optional limit for how many parsed list items are used. Leave at 0 to use the full list automatically. Example: if the list has 20 items and max_items is 5, only the first 5 items are used and the index loops through those 5.
    split_modeCOMBOHow to split the items text into a list. Auto tries JSON/Python first, then detects blank lines, commas, pipes, or normal lines. Use line for one item per line, blank line for paragraph/chunk lists, comma for a,b,c, pipe for a|b|c, or json/python for structured input only.
    selection_modeCOMBOHow items are chosen. index selects by index and wraps around the list. random picks a seeded random item for each index. random no repeat creates a seeded shuffled order, walks through every item once, then reshuffles for the next cycle. Example with 5 items: indexes 0-4 use all 5 in random order before any item repeats.
    seedINT0-18446744073709550000–18446744073709550000Controls the random order for random and random no repeat modes. Same seed plus same index gives the same result, which makes workflows repeatable. Change the seed to get a different random order. Ignored by normal index mode.
    multi_formatCOMBOHow multiple selected items are combined in formatted_text. auto uses the two_item_template when pick_count is 2, otherwise it uses commas. lines outputs each selected item on its own line. comma outputs item1, item2, item3. sentence uses the two_item_template for exactly 2 items.
    two_item_templateSTRINGstart with {item1} then follow with {item2}Editable sentence template used when pick_count is 2 and multi_format is auto or sentence. Keep {item1} and {item2} where you want the selected items inserted. You can also use {items} for both items joined by commas. Example: begin with {item1}, then transition into {item2}.
    keep_emptyBOOLEANfalseWhether blank entries count as selectable items. Usually leave this off. If off, blank lines are ignored. If on, blank lines can be selected and may output an empty value, for example: Camera Motion = .
    pick_countINT11–50How many items to select at once. Use 1 for a single motion. Use 2 to combine two motions, such as: Camera Motion = start with slow push in then follow with orbit left. For more than 2, the selected items can be output as lines or comma-separated text.

    Outputs (5)

    NameTypeDescription
    formatted_textSTRING
    selected_itemSTRING
    selected_itemsSTRING
    wrapped_indexINT
    item_countINT