ComfyUI Node

String Batch

Batch a handful of prompts into one clean output

By mickmumpitz·Created 8 months ago·Updated 10 days ago· 47
String Batch
    • string_batch
    num_fields4
    string_1
    string_2
    string_3
    string_4
    string_5
    string_6
    string_7
    string_8
    string_9
    string_10
    string_11
    string_12
    string_13
    string_14
    string_15
    string_16
    string_17
    string_18
    string_19
    string_20
    string_21
    string_22
    string_23
    string_24

    ComfyUI's core nodes will happily take one prompt. They won't take twenty, one per shot, and switch between them. String Batch is the node that fixes that gap: you type up to 24 prompts into string_1 through string_24, and it hands them out as a single string_batch - a tuple the rest of the pack's batch machinery (and ComfyUI's batch-aware samplers) can consume.

    It's the foundation of the String Batch family in Mickmumpitz-Nodes. Almost everything else in that category builds on this output type: String Selector pulls one prompt out by number, Iter String Selector pulls one out per video iteration, PromptStitcher appends a style suffix to every prompt in the batch. This is the input side of all of it.

    How it works

    num_fields (1–24, default 4) controls how many string_N text boxes are visible. Fill them, and the node returns them in order as a STRING_BATCH tuple - positions 1 through num_fields, exactly. That's the entire mechanism: no hidden handlers, no JS, no state. It's a plain list-of-strings in, tuple-of-strings out.

    The small detail that matters: num_fields is what gets batched. Strings beyond num_fields are ignored, and if you raise num_fields later, the new slots start empty. The batch is positional, so downstream index-based selection (String Selector's select, or iteration-based selection) maps straight onto the order you typed.

    Inputs and output

    • num_fields (INT) - how many prompt slots to show and batch.
    • string_1string_24 (STRING, multiline) - the actual prompts.
    • Output: string_batch (STRING_BATCH).

    Where it fits

    The classic use is multi-prompt generation: a batch of one prompt per scene or variation, then a sampler that processes the whole batch (or a selector that picks one at a time). It's also the backbone of the pack's storyboard approach - pair it with Story & Style Selector for the story index and String Selector to feed that story's prompt to the sampler. For video iteration, Iter Prompt Builder is a more specialized sibling that batches prompts and extracts per-iteration start frames.

    Installing

    Part of Mickmumpitz-Nodes - ComfyUI Manager → search "Mickmumpitz" → install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mickmumpitz/ComfyUI-Mickmumpitz-Nodes
    

    Just numpy, Pillow, opencv-python - nothing to download. The pack is by Mickmumpitz, a YouTuber whose consistent-character and iterative-video workflows lean on this kind of prompt-batching plumbing.

    Gotchas

    Two habits to avoid. First, leave num_fields at the default 4 and you silently drop prompts 5–24 - set it to your real count. Second, remember STRING_BATCH is its own type: a bare string won't connect where a batch is expected, and a batch won't drop into a plain string input. If the wire won't connect, you're missing the selector node in between. That type mismatch is the one thing that confuses people on the first day, and it's exactly what the selectors exist to bridge.

    CategoryMickmumpitz/String Batch

    Inputs (25)

    NameTypeDefaultDescription
    num_fieldsINT41–24
    string_1optSTRING
    string_2optSTRING
    string_3optSTRING
    string_4optSTRING
    string_5optSTRING
    string_6optSTRING
    string_7optSTRING
    string_8optSTRING
    string_9optSTRING
    string_10optSTRING
    string_11optSTRING
    string_12optSTRING
    string_13optSTRING
    string_14optSTRING
    string_15optSTRING
    string_16optSTRING
    string_17optSTRING
    string_18optSTRING
    string_19optSTRING
    string_20optSTRING
    string_21optSTRING
    string_22optSTRING
    string_23optSTRING
    string_24optSTRING

    Outputs (1)

    NameTypeDescription
    string_batchSTRING_BATCH