Pt Randn
Gaussian noise on demand, straight into your graph
- TENSOR
Pt Randn makes a tensor full of values drawn from the standard normal distribution - mean 0, standard deviation 1 - and it does it right inside ComfyUI. If you've ever wished you could generate Gaussian noise as easily as you generate an empty latent, this is the node. It's the float-flavored sibling of Pt Rand Int, and in the context of the ComfyUI-Pt-Wrapper pack it's the "make some data" step for ML experiments: a random weight initializer, a noise source to test how a model handles it, or just a tensor to poke at with the reduction and math nodes.
What it actually does
It's a one-liner wrapper around torch.randn(size). You type a shape as a Python list, the node parses it, and hands you a TENSOR of the same shape with each element independently sampled from a standard normal. No scaling, no shifting - mean 0, std 1, out of the box. Because it's a random tensor, the same node instance produces different values every time you run the graph.
The inputs that matter:
- size - the multiline text field where you type the shape, e.g.
[2,3,96,32]for a 4D tensor of batch 2, channels 3, height 96, width 32. - data_type - your choices are
float32,float16,bfloat16, andfloat64. The default mental model for "normal" in PyTorch is float32, but if you're pre-generating noise for a bf16 model, the option is right there in the dropdown.
It outputs a single TENSOR, which plugs into any other TENSOR input in the pack - a model node, a math node, a display node, whatever.
How to install it
Pt Randn ships in the ComfyUI-Pt-Wrapper pack, so it comes along with the ~200 other nodes in one install. In ComfyUI Manager, search ComfyUI-Pt-Wrapper and install, then restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Pt-Wrapper
Restart after cloning. Fair warning: this pack's requirements.txt is heavy - transformers, datasets, accelerate, peft, gensim, sentencepiece, plus the pandas/scikit-learn/scipy data stack. If you only want random tensors, this is a lot of machinery. If you're here for the training workflows anyway, it's already paid for.
Gotchas
Same parsing trap as its integer sibling: the size field must be valid Python list syntax. [2,3,96,32] works, 2,3,96,32 doesn't, and you'll stare at a ValueError for a while if you forget the brackets.
And again: no seed control. There's no seed widget and the node forces re-execution each run, so you can't reproduce a specific noise pattern. Great for generating fresh noise, useless for reproducible experiments. If you're using this as a weight initializer inside a training workflow, be aware you can't lock the initialization down from this node alone.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| size | STRING | — | |
| data_type | COMBO | 4 options: float32, float16, bfloat16, float64 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| TENSOR | TENSOR | — |