Set Text
The least surprising text node in the pack
- str
Set Text does exactly what the name says: you type text, it outputs that text. There's no hidden behavior, no randomization, no file I/O. It's the boring workhorse of the Sage Utils text family, and in a node graph, boring is a feature - it's the reliable way to define a string once and wire it to several places.
What you get
One required input, str (multiline, so you can paste a full prompt or paragraph), and two optional ones: prefix and suffix. The output, also called str, is simply prefix + str + suffix. Prefix and suffix are force-input, meaning they're designed to be wired from other nodes, not just typed - so you can build strings compositionally: a base prompt from one node, a quality tag prepended from another.
One detail worth knowing: the str input has dynamic prompts disabled, unlike some other text inputs in the pack. That means __wildcards__ and {random} syntax in your text will pass through literally instead of being expanded. If you want wildcard expansion, that's the "Text w/ Dynamic Prompts" node's job (SageSetWildcardText); this one is for text you want taken exactly as written.
When you'd use it
- Defining a negative prompt once and wiring it to a few conditioning paths.
- Setting a fixed string (a filename prefix, a caption, a style block) that several nodes consume.
- As a test source - if you're debugging string wiring, Set Text gives you a known input to trace through the graph.
It's one of those nodes you won't think about, but once it's in your palette you'll use it constantly for no drama.
Installing it
It's part of the Sage Utils pack. ComfyUI Manager (search Sage Utils) or:
cd ComfyUI/custom_nodes
git clone https://github.com/arcum42/ComfyUI_SageUtils
cd ComfyUI_SageUtils
pip install -r requirements.txt
Restart ComfyUI. The pack's only pip dependency is dynamicprompts, and there are no model downloads.
The one thing to remember
Order matters in the output: prefix comes first, then your text, then suffix. If you expect "text, prefix" you'll get "prefix, text" and spend a confusing minute in the preview. Also, unlike its sibling "Set Text Without Comments," this node does no cleaning - spaces, commas, stray newlines all pass through untouched. That's by design; if you want cleanup, there's a node for that too.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| str | STRING | Text to set or modify. | |
| prefixopt | STRING | Text to prepend to the main string. | |
| suffixopt | STRING | Text to append to the main string. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| str | STRING | Output value for str_out. |