Nodes/CoachBate/CoachBate Text Preview and Edit
ComfyUI Node

CoachBate Text Preview and Edit

See what your dynamic prompt actually was — and override it when muted

By CoachBate·Created 2 months ago·Updated 6 days ago· 0
CoachBate Text Preview and Edit
  • any
  • string
text

Dynamic prompts are great until you need to know what one actually produced. You build a prompt with wildcards, an LLM, or a list iterating node, hit Run, and the text that got encoded is a black box - especially later, when you're staring at a saved image and wondering what the heck generated it. CoachBate Text Preview and Edit is the window into that box: connect any value to its any input and it displays the resolved text, passes it through, and - the genuinely clever part - saves that resolved value into the workflow's own metadata. Reopen the saved PNG or video later and the exact prompt that ran is right there.

It's one of the pack's headline features, and it earns the billing.

How it works

The any input is a wildcard (*), so it accepts anything. When something is connected, the node converts it to a readable string and outputs that. Tensors become a summary like Tensor shape=(1, 4, 32, 32) dtype=float32 min=... max=...; latents become Latent shape=(...); anything else just becomes its str(). When nothing is connected, the node outputs whatever you've typed in the text widget instead.

That fallback is the "Edit" half of the name. Say the node is fed by a prompt builder that's muted or bypassed - instead of erroring or going blank, the node quietly uses your typed text. It's a built-in manual override that keeps the graph runnable mid-debugging.

The metadata trick: when a value flows in through any, the node writes the resolved string back into the saved workflow JSON's widget values. Since ComfyUI bakes the workflow into every PNG and video it saves, your final file carries the actual generated prompt, not the template that produced it. If you've ever tried to reverse-engineer a prompt from a generated image, you'll appreciate how much of a timesaver this is.

Inputs and output

  • text (multiline) - the editable widget text. Used as output when nothing is connected.
  • any (optional, *) - any value to display and pass through. Overrides the typed text when connected.
  • string (STRING) - the resolved output.

Where to put it

Drop it after your final prompt assembly - after a CLIP text encode, a dynamic-prompt chain, or the Shot Loader's video_prompt - and look at the node to see exactly what's about to be encoded. It's an output node, so it runs last; the string also rides into the saved file's metadata, which is where the real value accumulates over a long production run. There's also a Copy Text button on the node when you want the resolved prompt in your clipboard.

Common issues

  • You see "Tensor shape=..." instead of your prompt - that's expected. The node summarizes tensors and latents rather than passing their raw bytes; wire the original value directly to whatever needs the real tensor, and use this node only for display/editing.
  • The widget keeps changing when a batch runs - if something's connected, the node repaints with the incoming value. That's the display working, not a bug. Leave any unplugged if you just want a plain editable text node.
  • Resolved value not saved - the metadata write happens for values that flowed in through any; typed-text-only runs don't need it.

Installation

Install via ComfyUI Manager (search "CoachBate") or:

cd ComfyUI/custom_nodes
git clone https://github.com/CoachBate/ComfyUI-CoachBate.git

Restart ComfyUI; it appears under CoachBate in Add Node. No Python dependencies, no downloads. Alpha-stage pack, but this node is one of the more polished pieces - it's been rewritten specifically to survive the Nodes 2.0 frontend.

CategoryCoachBate

Inputs (2)

NameTypeDefaultDescription
textSTRINGEditable text shown in the node. Used as the output when nothing is connected to 'any'.
anyopt*Any value to display and pass through. Overrides the typed text when connected. Tensors and latents are converted to a readable summary.

Outputs (1)

NameTypeDescription
stringSTRING