Nodes/opencv-comfyui/OpenCV randu_1
ComfyUI Node

OpenCV randu_1

The uniform-noise node's doppelgänger

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV randu_1
  • dst
  • low
  • high
  • nparray

randu_1 is a clone of randu_0. Same cv2.randu call, same three inputs, same flat uniform-noise output. This pack generates one node per OpenCV overload stub, and for randu the stubs were indistinguishable, so the menu holds two nodes that do literally the same thing. Use either; the wiring doesn't know the difference.

What it does, in one line: fills an array with uniform random values between a low and a high bound, every value equally likely. That gives you flat full-range noise - useful for randomized masks, augmentation, or any "give me a canvas of noise with these bounds" job. For Gaussian-shaped noise instead, randn is the sibling; for plain generation noise, ComfyUI's built-in noise nodes are the lower-friction option.

Inputs

  • dst - NPARRAY. The canvas: its shape and dtype set the output, and its contents get destroyed.
  • low - NPARRAY, one scalar. Lower bound (inclusive).
  • high - NPARRAY, one scalar. Upper bound.

Output is the noise-filled nparray, BGR, through Nparrays2Image to view it.

The catch is the same one

Like randn and the rest of the random family, low and high have to arrive as one-element numpy arrays, not widget values. There's no scalar input in this pack, so you'll be wiring tiny NPARRAYs around the graph just to specify "0" and "255". It works; it's just ceremony. And there's no seed, so results aren't reproducible run-to-run.

randu_1 vs randu_0 - genuinely no difference. If you're seeing both in your search results and wondering whether you're missing something, you're not. The author's "expect dragons" warning mostly means this: half the pack is numbered twins, some identical (this one), some different overloads (recoverPose is the case where the numbers actually mean something).

Install

Standard pack story - no models, OpenCV is the dependency:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-contrib-python

Or search "OpenCV" in ComfyUI Manager, restart, browse image/OpenCV. batch_size==1 only; guidedFilter import error at load = conflicting OpenCV packages, fix linked in the README.

Short version: pick randu_0 or randu_1, it doesn't matter. Both fill your canvas with uniform noise and both demand the same scalar-array gymnastics.

Categoryimage/OpenCV

Inputs (3)

NameTypeDefaultDescription
dstNPARRAY
lowNPARRAY
highNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY