Prompt Preview
See your LLM's prompt, negative prompt and raw output on one panel — and pass all three through
- prompt
- negative_prompt
- raw_text
Prompt Preview is the debugging seatbelt for the LLM-in-the-graph workflow. If you've got a text-generation node writing prompts and you're feeding the result straight into a CLIPTextEncode, you have a real problem you can't see: LLMs rarely emit a clean prompt. They wrap it in "Here is your enhanced prompt:" preamble, throw in role delimiters, or hand you a blob of JSON. The KB's own notes on this job call dirty, non-structured output the number-one failure mode of local prompt enhancement - and until you look at what the model actually produced, you're debugging blind.
This node from TakkunRed's ComfyUI-String-Function pack shows you the extracted prompt, the negative prompt, and the raw LLM output side by side in one read-only text panel. And because it's a pass-through, you don't have to rewire your graph to get that visibility - the same three strings come out the other side, ready to keep flowing downstream.
How it works
All three inputs (prompt, negative_prompt, raw_text) are optional strings with forced inputs, so it accepts whatever's upstream without fuss. When it runs, it formats a monospace panel - [ Prompt ], [ Negative Prompt ], [ Raw LLM Output ], with empty values shown as (empty) - and displays it in a widget that a small JS extension adds to the node after the first execution. Crucially, it's an output node (OUTPUT_NODE = True), which means ComfyUI treats it as a terminal: it always executes, and it's the perfect place to park and inspect.
The pass-through is exact: the outputs are literally the same three strings you put in, unchanged. So you can drop it into the middle of the graph and keep wiring prompt → CLIPTextEncode positive, negative_prompt → CLIPTextEncode negative, without the node getting in the way.
Inputs and outputs
There are no required inputs and nothing to configure. Wire in:
prompt(STRING) - the extracted positive prompt, e.g. from String Extract Prompt.negative_prompt(STRING) - the extracted negative prompt.raw_text(STRING) - the LLM's unprocessed output, so you can compare what the model said against what the extractor kept.
Outputs are the same three: prompt, negative_prompt, raw_text - pass-throughs you wire into your encoders.
The README's reference workflow uses it exactly this way: two String Extract Prompt nodes (one for the positive, one for mode=json / json_key=negative_prompt for the negative) feed this node, and it relays both into CLIPTextEncode. You get the full picture of what's about to hit conditioning before the sampler ever runs.
Installing it
Same pack, same trivial install - pure stdlib, no dependencies, no models:
cd ComfyUI/custom_nodes
git clone https://github.com/TakkunRed/ComfyUI-String-Function
Or search "ComfyUI-String-Function" in ComfyUI Manager, then restart ComfyUI. It lives under String Function.
Where people get burned
- The preview widget only appears after the first run. The JS extension adds the read-only panel on
onExecuted, so a freshly-placed node looks empty until you queue the graph once. That's normal, not a bug. - It shows what you fed it, not what the sampler used. If you're editing widgets downstream of this node, this preview won't reflect those edits.
- The
(empty)placeholder is honest - an empty string shown as(empty)is exactly the signal you need when the extraction fell over and an empty prompt is about to reach the encoder. If you see that, check your extractor'ssuccessoutput and itsfallback_to_rawsetting before blaming the sampler.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| promptopt | STRING | — | |
| negative_promptopt | STRING | — | |
| raw_textopt | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| negative_prompt | STRING | — |
| raw_text | STRING | — |