Nodes/ComfyUI-TinyBee/Decorate List
ComfyUI Node

Decorate List

Bulk-Format Every Entry in One Go

By TinyBeeman·Created about a year ago·Updated about a month ago· 1
Decorate List
    • decorated_list
    string_list
    prefix
    postfix
    search_string
    replace_string

    Half of prompt engineering in ComfyUI is repetitive string surgery: prepend a quality tag to every line, append a style token, or fix a filename pattern across a hundred entries. Decorate List exists so you don't hand-edit a list item by item. You hand it a list of strings, it rewrites every one according to the same rules, and hands back a new list. Boring, useful, exactly the kind of node that disappears into a workflow and saves you ten minutes.

    How it works

    Four string inputs, applied to every item in your string_list in a fixed order:

    • prefix - stuck on the front of every entry.
    • postfix - stuck on the back.
    • search_string / replace_string - an optional find-and-replace that runs after prefix/postfix are applied. Both have to be non-empty for it to do anything; if only one is filled, the other is silently ignored.

    So the pipeline per item is: prefix + item + postfix, then item.replace(search, replace) on the result. Prefix and postfix are always applied; the replacement is a simple substring swap, not a regex.

    A concrete example: a list like

    portrait of a woman
    portrait of a man
    

    with prefix masterpiece, best quality, and postfix , cinematic lighting gives you

    masterpiece, best quality, portrait of a woman, cinematic lighting
    masterpiece, best quality, portrait of a man, cinematic lighting
    

    Where you'd actually use it

    • Prompt batch prep: load a list of base prompts (TinyBee's Get List From File pairs naturally with this), decorate every entry with your quality prefix, then feed the decorated list into a per-item sampler loop.
    • Filename/extension chores: run a search_string of .png.jpg, or normalize a list of paths before handing them to a file node.
    • Tag lists: add (worst quality, lowres) postfixes or wrap every entry in brackets.

    Because the output is a plain list of strings, it slots straight into any other list node - TinyBee's whole Lists category (Randomize List, Indexed Entry, etc.) or ComfyUI's core list utilities.

    Installing it

    Same as every node in this pack - it's part of ComfyUI-TinyBee:

    1. ComfyUI Manager → Install Custom Nodes → search "ComfyUI-TinyBee" → Install.
    2. Restart ComfyUI.

    Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TinyBeeman/ComfyUI-TinyBee
    

    No models, no heavy deps. The pack's requirements.txt lists pillow and jsonata; Decorate List itself is pure string handling and needs neither (Pillow ships with ComfyUI anyway).

    Gotchas

    The find-and-replace quirk is the main trap: if you set search_string but leave replace_string empty, nothing happens - no error, just no replacement. Set both or neither. Also note the replace runs on the decorated string (after prefix/postfix), so if your search term appears in the prefix you added, it gets swapped too. And worth repeating for this pack generally: the README only documents a handful of nodes, Decorate List not included. The code is what actually does the work; the README is mostly decoration of its own.

    Category🐝TinyBee/Lists

    Inputs (5)

    NameTypeDefaultDescription
    string_listSTRING
    prefixSTRING
    postfixSTRING
    search_stringSTRING
    replace_stringSTRING

    Outputs (1)

    NameTypeDescription
    decorated_listSTRING