String Prepender (Prefix)
Stick a prefix onto your prompt (great for LoRA triggers)
- STRING
LoRA trigger words want to be up front. Most character and style LoRAs respond best when their trigger phrase leads the prompt, and if your base prompt is generated or stored elsewhere, hand-editing it every time is a chore. String Prepender (Prefix) is the sibling of String Appender with the order reversed: text_to_prepend + separator + input_text.
The source code even says it outright - "Good for LoRA Triggers" - which is the whole use case in one line.
Inputs
- input_text - the string you're prefixing, from a wire (marked
forceInput). - separator - default
,, which is the sensible choice for prompt tags:trigger, your prompt. Type\nfor a real newline. - text_to_prepend - the prefix.
Output: a single STRING.
Where it fits
- Dropping a LoRA trigger word in front of every prompt in a batch: split, prepend, re-feed.
- Adding a global style prefix ("masterpiece, best quality" or a camera signature) to prompts coming from a file or another node.
- Keeping your actual prompt text untouched while the same prefix gets applied - the node is a pure transform, so the base string stays intact upstream and you can swap prefixes without touching the prompt.
The small print
It's one string in, one string out. Feed it a list (say, from String Splitter) and ComfyUI will run it once per element, which is exactly the batch behavior you want. The default separator here is , , while the Appender defaults to a space - set both explicitly when you're building a matched prefix/suffix pair, or your joins will look different on each side.
Installing this node
One of the 16 nodes in the lzits Nodes pack (Lior Zitser, MIT). Install via ComfyUI Manager (search "lzits Nodes") or:
cd ComfyUI/custom_nodes
git clone https://github.com/lzitser23/lzits-nodes.git
Restart ComfyUI. No dependencies.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| input_text | STRING | — | |
| separator | STRING | , | — |
| text_to_prepend | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |