Nodes/ComfyUI_StringOps/随机整数🐠meeeyo.com
ComfyUI Node

随机整数🐠meeeyo.com

A random seed you can actually wire in — string and int, fresh every run

By MeeeyoAI·Created 2 years ago·Updated about a year ago· 209
随机整数🐠meeeyo.com
  • any
  • STRING
  • INT

Every workflow eventually needs a "different result each time" switch, and in ComfyUI that's a random seed. Core ComfyUI has a RandomNoise node for this, but it's buried in noise-injection plumbing that confuses beginners. SimpleRandomSeed is the dead-simple version: no inputs, two outputs - the same random integer as both a STRING and an INT - so you can wire it anywhere a seed or a number belongs.

It comes from ComfyUI_StringOps. Its Chinese display name is 随机整数 ("random integer"), and that's the whole contract.

How it works

It has no required inputs - just an optional wildcard input you can ignore - so you drop it on the canvas and it does its thing. On every evaluation it generates a random integer of 8–12 digits (first digit nonzero, so no leading zeros), and returns it twice:

  • STRING output - for places that want a seed as text, or for display/comparison.
  • INT output - for your KSampler seed slot, NumberExtractor-style consumers, or any integer input.

The pack never caches results (every node reports "changed" constantly), so this regenerates a new seed on every queue run. That's the feature - you don't touch anything, every run is a fresh seed.

Where you'd use it

Wire the INT output straight into a KSampler's seed input and you get a different image every run - the quickest way to explore a prompt's space. Wire the STRING output into a text/display path if you want to see what seed produced the current image (handy when you find a keeper and want to lock it in). Because both outputs carry the same number, you can even drive one thing from the string and another from the int without a mismatch.

If you want to keep a good seed: run once, read the value from a display node or the STRING output, and paste that number into a fixed KSampler seed. That's the standard "save the seed that worked" loop, and this node makes it easy because the seed is visible as text.

The honest take

Is it better than core ComfyUI's random seed handling? For a beginner, yes - it's one node with a clear output instead of a noise-object you don't fully trust. For power users, the 8–12 digit range is arbitrary and there's no seed-lock mode, so it's a convenience, not a replacement for a proper seed system. It's also overkill if you just want one known seed: type a number directly.

One small note: because the output is random each run, anything downstream that consumes it re-executes too. That's usually fine in a graph, but if you're building a multi-stage workflow you want reproducibility on, keep this node out of it unless you're deliberately randomizing.

Installing it

Pack standard: ComfyUI Manager → ComfyUI_StringOps, or

cd ComfyUI/custom_nodes
git clone https://github.com/MeeeyoAI/ComfyUI_StringOps.git

Restart. Pure Python, no dependencies beyond ComfyUI's own.

CategoryMeeeyo/Functional

Inputs (1)

NameTypeDefaultDescription
anyopt*

Outputs (2)

NameTypeDescription
STRINGSTRING
INTINT