Nodes/ComfyUI-batching-nodes/Get Prompt From Batch
ComfyUI Node

Get Prompt From Batch

The 'just give me prompt #3' node

By Hahihula·Created 8 months ago·Updated 5 months ago· 14
Get Prompt From Batch
    • prompt
    prompts_list
    index0

    Batch Text is the node that runs all your prompts; Get Prompt From Batch is the one that runs one of them, on purpose. It's the small companion node you reach for when firing off the whole list is wrong - you want to re-queue prompt #3 that came out great, A/B two prompts against each other, or step through a list one queue press at a time. Same pack, same zero-dependency setup, opposite job.

    How it works

    While Batch Text pushes a list out, this node pulls one item back out. It marks its input as list-aware (INPUT_IS_LIST), so it receives the entire prompt list in a single call, then grabs the entry at index. Two behaviors matter here:

    • It's 0-based. Index 0 is the first prompt. This trips up people more than it should.
    • It wraps around: the actual index used is index % len(prompts_list). Ask for index 99 on a three-prompt list and you quietly get prompt 0. That's a deliberate safety net - no out-of-range crash mid-workflow - but it can look like a bug if you're not expecting it.

    Inputs and outputs

    Only two inputs, and only one you'll actually touch:

    • prompts_list - wire this to the prompts_list output of Batch Text (the "Batch Text (Prompt Loop)" node in the same pack).
    • index - an INT, default 0. Set it as a widget to pick a prompt, or drive it from another node if you're building something clever.

    The single output, prompt, is a plain STRING - connect it anywhere you'd connect a prompt, which is usually CLIP Text Encode.

    Why you'd actually use it

    The honest use case is manual control. Add it to a batch workflow, expose the index widget, and you get a "pick which prompt to run" dial without duplicating text everywhere. It also pairs naturally with the pack's image-side counterpart, Get Image From Batch, using the same index value on both - now you're looking at exactly one prompt×image combination, which is great for debugging a matrix workflow before you let the full 3×5 loose. Drive that index from a simple INT widget and you've got a poor-man's iteration rig: bump the index, queue, bump, queue.

    Installing it

    It's bundled with the rest of ComfyUI-batching-nodes (MIT, by Hahihula). ComfyUI Manager: search "ComfyUI Batching Nodes" and install. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Hahihula/ComfyUI-batching-nodes
    

    Restart ComfyUI after either path. There's no pip dependency to install and no model file to fetch - the pack only uses what ComfyUI already ships, so this node appears the moment the pack loads.

    Gotchas worth knowing

    • The wrap-around behavior means an out-of-range index never errors - which is nice for robustness, infuriating if you expected "prompt 99" and got prompt 0.
    • An empty or missing list returns an empty string rather than failing, so check the count from Batch Text if you're seeing blank prompts.
    • It's a picker, not a scheduler. If your goal is "run each prompt automatically in sequence," you don't need this node at all - just wire the list straight through and let ComfyUI fan it out. Use this node when you want fewer than all of them.
    Categorytext

    Inputs (2)

    NameTypeDefaultDescription
    prompts_listSTRING
    indexINT00–10000

    Outputs (1)

    NameTypeDescription
    promptSTRING