Pt Show Text
Look inside a tensor without leaving the ComfyUI window
- tens
- STRING
Pt Show Text is the debugging node you'll reach for constantly once you're working with raw tensors in ComfyUI. When your graph is doing something unexpected - a scatter that put values in the wrong place, a subtraction that came out all wrong, a reshape that reordered data - the fastest way to figure out what happened is to look at the actual numbers. This node dumps a tensor's contents right into the ComfyUI UI, no terminal, no print statements, no Python.
What it actually does
It takes a TENSOR, converts it to its string representation, and displays it as text in the node. It's an output node: the display is the point. It's borrowed from pythongosssss's show_text in ComfyUI-Custom-Scripts (credited in the pack), and the mechanism is essentially str(tensor) with print options set so the output is manageable. The result also comes out as a STRING (list output) if you want to grab it for something else, but realistically you're here for the readout.
There's exactly one input:
- tens - any
TENSORin the pack's tensor format.
One genuinely useful detail in the implementation: big tensors get truncated. The node caps the display at 100 elements via torch.set_printoptions(threshold=100). A small tensor prints in full; a big one prints a summarized view with ... in the middle, which is how PyTorch shows large arrays by default. So for a 100k-element tensor you'll get the first and last elements plus the shape, not 100k lines of numbers. That's a feature, not a bug - trust me, you didn't want to scroll through all of it.
How to install it
It's one node in the ComfyUI-Pt-Wrapper pack. In ComfyUI Manager, search ComfyUI-Pt-Wrapper, install, restart. Or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Pt-Wrapper
Restart after. The pack drags in a heavy requirements.txt (transformers, datasets, accelerate, peft, gensim, sentencepiece, pandas, scikit-learn, scipy) - if you're only after a tensor inspector, that's a lot of baggage, but it comes with the pack.
Gotchas
Remember this is a terminal node: the output is the display, so it can't be fed back into more tensor math. Branch the wire if you need to inspect and keep processing.
The other gotcha is the truncation itself. It's easy to misread a truncated tensor as the full picture - if you see ..., the middle is collapsed, and whatever pattern you think you found might not hold across the whole tensor. Also note it shows the first tensor in its list input, so if you're feeding a batch, you're seeing element 0, not all of them.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| tens | TENSOR | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |