Nodes/comfyui-lumi-tools/Lumi Wrap Text
ComfyUI Node

Lumi Wrap Text

Slam a prefix and suffix onto any prompt without retyping it

By illuminatianon·Created 9 months ago·Updated 4 months ago· 0
Lumi Wrap Text
    • text
    text
    prepend
    append

    Lumi Wrap Text does one thing: it takes a string, glues a prepend onto the front, an append onto the back, and outputs the result. prepend + text + append, full stop. It sounds almost insultingly simple, but it's the kind of node that quietly solves a problem you hit weekly: adding a fixed style block or quality boilerplate to a prompt you don't want to edit by hand.

    The classic use case is the quality-tag sandwich. You have a prompt that changes every run - a wildcard resolution, a shuffled prompt, an LLM rewrite - and you want it wrapped in a stable frame like masterpiece, best quality, <dynamic content>, highly detailed. Instead of editing the dynamic source, you wire the dynamic text into text, set the prepend and append once, and the wrapper follows whatever the upstream node produces. Same idea applies when you're feeding an LLM: wrap a generated description with "rewrite this as a detailed image prompt" boilerplate without touching the generator.

    The inputs that matter

    • text - the input to wrap (force-input, so it must come from another node's string output - a text box, a wildcard, an LLM).
    • prepend - text added before the input (multiline).
    • append - text added after the input (multiline).

    Output: text, the full concatenation as a single STRING. Chain it with other text nodes freely - it's just string math.

    One small implementation detail worth knowing: if an upstream node hands it a None (a failed or empty output), it raises a clear error instead of silently producing garbage - which makes it a surprisingly useful canary for "your upstream text node broke." The widget defaults are empty strings, so it's a no-op pass-through until you type something.

    Installing

    cd ComfyUI/custom_nodes
    git clone https://github.com/illuminatianon/comfyui-lumi-tools
    cd comfyui-lumi-tools
    uv sync
    

    Restart ComfyUI, or search "Lumi Tools" in ComfyUI Manager.

    The gotchas

    A couple of honest warnings. First, comma hygiene is on you: if you prepend masterpiece, you need to include the trailing comma and space, or you'll get masterpiece,a red car - syntactically fine, semantically sloppy. Second, remember the model-family caveat from modern prompting: quality-tag boilerplate is largely inert on LLM-encoded models, so if you're wrapping for those, the frame should be an instruction ("describe the following scene") rather than a stack of masterpiece tags. And finally, if your upstream text is huge, the wrap is cheap - this node doesn't care about length, so use it freely as glue between text stages.

    CategoryLumi/Text

    Inputs (3)

    NameTypeDefaultDescription
    textSTRINGInput text to wrap
    prependSTRINGText to add before the input
    appendSTRINGText to add after the input

    Outputs (1)

    NameTypeDescription
    textSTRING