Simple LLM: String Viewer
Inspect a string, wrap it in prefix/suffix, pass it along
- text
The middle ground between the two display nodes in this pack. Simple LLM: Display Text just shows a string. Simple LLM: Text Output just shows it and drops it. Simple LLM: String Viewer shows the string, lets you wrap it with a prefix and suffix, and hands it back out the other side so the chain continues. For debugging LLM output, it's the one with the most teeth.
It's part of the SimpleLLM family in ComfyUI-NS-Util, the LLM corner of NakamuraShippo's utility pack (marked "Implementing the tests now" in the README - new stuff). The prefix/suffix trick is the reason to pick this over the other viewers: you can dress a raw LLM response before it goes somewhere else, like framing a model's answer inside a template before you display or pass it along.
How it works
The node takes your text, prepends prefix and appends suffix, and shows the result. Console gets a [SimpleLLM StringViewer] line with the length and first 200 chars; the UI widget shows the string (capped around 1000 characters with a trailing ... for long ones - the displayed copy is truncated, but the full value still comes out the other side). It also implements IS_CHANGED, hashing the text so the preview actually refreshes when the input changes instead of being skipped as "unchanged."
The pass-through returns the wrapped string, so prefix/suffix aren't just cosmetics - they're applied to the value downstream.
The inputs that matter
- text - forceInput string from upstream (the LLM response, a merged prompt, etc.). Not typeable.
- prefix - text added to the front. Default empty. Use it for labels like
"Result: "or an opening tag. - suffix - text added to the end. Default empty.
Output: text - the full string with prefix and suffix applied, ready to continue down the graph.
Installing the pack
# ComfyUI Manager → Install via Git URL:
https://github.com/NakamuraShippo/ComfyUI-NS-Util
# or:
cd ComfyUI/custom_nodes
git clone https://github.com/NakamuraShippo/ComfyUI-NS-Util
pip install pyyaml watchdog
Restart ComfyUI. No model files, no network, pure string plumbing.
Common issues
The two things that trip people up: the ~1000-character UI truncation looks like data loss but isn't - the output wire carries the whole string, so check downstream, not the preview. And the wrapping is literal: if you set prefix to [START] and the model output already contains [START], you'll end up with nested markers. Otherwise it's about as trouble-free as nodes get. If you just need a bare viewer with no wrapping, Display Text is the simpler sibling.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| prefix | STRING | — | |
| suffix | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |