Nodes/ComfyUI-MakkiTools/random_any(mki-随机数输出)
ComfyUI Node

random_any(mki-随机数输出)

A seed-less random int and float whenever you need one

By MakkiShizu·Created about a year ago·Updated 7 months ago· 9
random_any(mki-随机数输出)
  • anything
  • any
  • int
  • float

Every workflow needs a random number eventually - a random seed, a random strength, a random anything - and ComfyUI's built-in random node is buried under a specific name. random_any_makki (display name "random_any(mki-随机数输出)") is the blunt version: it hands you a random integer and a random float every time it runs. That's the entire job.

How it works

Nothing clever. The node calls Python's random module fresh on each execution:

  • int output - an integer from 0 up to 2⁶⁴ (that's a 64-bit unsigned range, so bigger than any seed you'll ever need).
  • float output - a float between 0.0 and 1.0.
  • any output - whatever you feed into the optional anything input, passed through unchanged.

The anything passthrough is the quietly useful bit: you can dangle this node off an existing wire without breaking the graph, grab a random number on the side, and still have your original data flow through untouched.

When to reach for it (and when not to)

Reach for it when you genuinely want variety every run - randomizing a cfg, a denoise, an upscale factor, or picking a random prompt variant from a list by feeding the int into an index.

Don't use it when you need reproducibility. There's no seed input, so every run re-rolls. If you're generating a batch and want the same randomness next time - or you want to bisect "this looked great but I can't get it back" - use a proper seed node (or the Seed tools in packs like rgthree, which remember what they last ran). This node is for "roll the dice" moments, not "track this seed" workflows.

One more thing: it's deterministic per run, not per batch. In ComfyUI terms that means each node execution rerolls, which is what you'd expect from a random node. Just don't assume two of these nodes in a graph give the same value - they won't, unless you tell them to.

Installing

It's part of ComfyUI-MakkiTools:

cd ComfyUI/custom_nodes
git clone https://github.com/MakkiShizu/ComfyUI-MakkiTools
cd ComfyUI-MakkiTools
pip install -r requirements.txt

Then restart ComfyUI. No dependencies beyond what the pack already installs.

Thin, but it's one of those "fine, I'll build it myself" nodes that the pack author clearly added when the built-in option wasn't where they expected it. For a quick random int or float mid-graph, it does the job with zero friction.

CategoryMakkiTools

Inputs (1)

NameTypeDefaultDescription
anythingopt*Any input (passed through unchanged) 任意输入(原样传递)

Outputs (3)

NameTypeDescription
any*
intINT
floatFLOAT