StringConstant_clh
One piece of text, reused everywhere
- value
The text version of a constant node. You type a string into it once and wire that string out to as many places as you want - a style suffix that goes on every prompt, a trigger word your LoRA needs, a stock negative-prompt fragment, a filename prefix. When the same bit of text has to show up in several nodes, this gives you one place to hold it instead of retyping it into each one and hoping they stay in sync.
Unglamorous, and that's the job. It's the same idea as INTConstant clh but for text, and the same pattern you'll recognize from KJNodes or rgthree's constant/primitive nodes.
Why you'd bother
Prompts get built from parts, and some of those parts repeat. Say every image in a project should end with the same quality tail and the same style phrase. Type that into three different CLIP Text Encodes and you've made three copies that will drift the moment you tweak one and forget the others. Promote it to a StringConstant clh, wire the one output everywhere it's needed, and there's a single source of truth. Change the phrasing once and every prompt that reads from it updates together. For LoRA trigger words especially - the thing that silently kills a LoRA's effect when it's missing or misspelled - having exactly one authoritative copy is worth a lot.
The inputs and outputs that matter
One field, which is the point:
value(multiline, default a single space) - the text you're storing. Multi-line, so a whole block (a full negative prompt, a multi-line style preamble) works, not just a word.
Output is value, a STRING. Fan it out to any text socket: CLIP Text Encode, a JoinStringMulti clh that assembles your full prompt, a save node's filename prefix, anywhere text is wanted.
Installing it
ComfyUI Manager: search Clh Tool for ComfyUI, install, restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/clhui/ComfyUi-clh-Tool
then restart ComfyUI. If a manual clone doesn't surface the node, the startup console names any missing dependency for you to pip install - Manager handles that automatically, a bare clone doesn't. (A plain constant node like this almost certainly needs nothing extra.)
Common issues
There's not much to break, but two habits matter. First, whitespace is invisible and it counts. The default value is a single space, and stray leading or trailing spaces in your text carry straight into every prompt that reads it - usually harmless, occasionally the reason a tag doesn't parse the way you expected. If something's off, check for spaces you can't see; parking a Show Text clh on the output makes them visible.
Second, the payoff only exists if you actually route the constant to every place that text is used. Keep the phrase typed locally in two nodes and centralized in a third and you've rebuilt the drift problem you installed this to solve. Commit to the pattern: one string, one node, wired everywhere. Pair it with JoinStringMulti clh to stitch several constants and prompt fragments into one clean prompt, and you've got a tidy, maintainable setup where every reusable piece of text lives in exactly one spot.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | STRING | — |