Pt Gt
Strict greater-than, as a node
- tens_a
- tens_b
- TENSOR
Pt Gt is the "greater than" comparison in the HowToSD/ComfyUI-Pt-Wrapper pack - a one-to-one wrapper around torch.gt. Two tensors in, one boolean tensor out, True wherever tens_a > tens_b. It's the strict cousin of Pt Ge (which uses >=), and the "Gt" is straight from PyTorch's function name. If you need "strictly above this threshold, ties don't count," this is your node.
Why you'd use it
Thresholding shows up everywhere once you're building ML pipelines in the graph instead of in a script. Say your model outputs probabilities and you want to keep only samples that beat a confidence cutoff: compare the prediction tensor against a constant (make the constant with Pt Full), get a boolean mask, then steer the flow with Pt Where or filter with Pt Masked Select. For a classifier being trained in this pack, "did we beat the bar" is usually a strict comparison, and picking Gt vs Ge is the difference between counting a tie as a pass or not. It's also a decent debugging probe: compare an intermediate tensor against zero to see where values cross the axis, then dump the result with Pt Show Text.
How it works
Element-wise, broadcast-friendly. tens_a and tens_b must be the same shape or broadcast-compatible; PyTorch handles the comparison on whatever device the tensors live on. The output is a boolean TENSOR. Because bools behave as 1/0, you can sum the result to count how many elements passed, which makes "what fraction cleared the threshold" a two-node operation.
The inputs
- tens_a - left side of the comparison.
- tens_b - right side.
Output is a single TENSOR of booleans. There are no knobs, no dropdowns - this node is deliberately tiny.
Installing the pack
Pt Gt ships with the whole Pt-Wrapper pack in its "Data Analysis" (tensor math) category. Install through ComfyUI Manager by searching "ComfyUI-Pt-Wrapper", or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Pt-Wrapper
Restart ComfyUI. The pack's requirements.txt is the heavy part - transformers, datasets, peft, accelerate, gensim, scikit-learn and friends - so expect the first install to take a while. No model downloads are needed for comparison nodes.
Common issues
- Broadcast errors - tensors with incompatible shapes throw a torch error immediately. Verify with Pt Show Size before wiring.
- Strict vs non-strict - if your threshold is meant to be inclusive, Gt will quietly drop the ties and you'll be off by the count of exactly-equal elements. Pick deliberately: Gt for strict, Ge for inclusive.
- Boolean dtype - the result is bool. Feeding it into a node that expects floats will error; route it through Pt To Float32 if needed.
- Expect little community help - this pack is a single-author educational project with nearly zero discussion on r/comfyui or r/StableDiffusion. The author's node reference and example workflows are your best documentation; there isn't a Reddit thread waiting to save you.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| tens_a | TENSOR | — | |
| tens_b | TENSOR | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| TENSOR | TENSOR | — |