ComfyUI Node

String to List

Turn a handful of prompt fields into one list for batch runs

By creativeself-kim·Created 10 months ago·Updated 6 months ago· 1
String to List
    • strings
    count4
    prompt_1
    prompt_2
    prompt_3
    prompt_4
    prompt_5
    prompt_6
    prompt_7
    prompt_8

    The simplest way to run a batch in ComfyUI is a list: hand a sampler a list of prompts and it works through them. The annoying part is making the list - core ComfyUI doesn't have a "type eight prompts, get one list" node with any ergonomics. UtilStringToList is that node: up to eight multiline prompt fields, a count to control how many show up, and one STRING list out the other end. It's the string twin of this pack's UtilImageToList, and it's the difference between one batch run and eight manual runs.

    How it works

    You set count (1 to 8) and the node displays that many prompt text boxes - the dynamic show/hide comes from the pack's JS. On execution it collects the first count fields, strips whitespace, and drops empty ones, so if you leave a slot blank it doesn't inject an empty string into your batch. If every slot is empty, it returns a list containing one empty string - a blank prompt that's easier to spot than a zero-length list. What you get out is a proper OUTPUT_IS_LIST STRING list, which is exactly the shape list-aware samplers and batch loops expect.

    The inputs and output

    • count (INT, default 4, 1–8) - how many prompt fields to show.
    • prompt_1 (STRING, multiline, required) - the first prompt.
    • prompt_2 through prompt_8 (STRING, multiline, optional) - the rest of your batch.
    • strings (STRING list) - the collected prompts, empties stripped.

    One input is required by the schema, so the node always has at least one field - convenient, because it means the node is usable as a "single string → list" adapter when you only need to feed one prompt into a list-consuming pipeline.

    Where it fits

    Batch generation is the headline use: type your variations, wire the list into a sampler that accepts list input, and get N images in one queue. It also plays well with this pack's batch-oriented storyboard pipeline - SBJsonParser emits aligned string lists, and anything that needs to merge or reorder them can take this node's output as a compatible list type. For dynamic prompts or wildcards, keep in mind this is a static batch builder - the prompts are whatever's in the boxes when you run. If you want generated variations, pair the output with a list-iterating workflow.

    Install

    Part of the IXIWORKS pack - ComfyUI Manager → search ComfyUI-VideoDescription → Install, restart, or clone into custom_nodes/. No extra dependencies. The JS-driven field count is a web-UI feature, so save workflows from the UI or the fields won't match your count setting on reload.

    CategoryIXIWORKS/Utils

    Inputs (9)

    NameTypeDefaultDescription
    countINT41–8
    prompt_1STRING
    prompt_2optSTRING
    prompt_3optSTRING
    prompt_4optSTRING
    prompt_5optSTRING
    prompt_6optSTRING
    prompt_7optSTRING
    prompt_8optSTRING

    Outputs (1)

    NameTypeDescription
    stringsSTRING