ComfyUI Node

随机种子

A fresh seed even when the workflow is sealed

By RiceRound·Created 2 years ago·Updated about a year ago· 99
随机种子
    • INT

    RandomSeedNode is a one-trick node: zero inputs, one INT output, and every time the queue runs it hands you a fresh random number between 0 and 999999. It lives in the CryptoCat pack (RiceRound/ComfyUI_CryptoCat) under Advanced → CryptoCat, and its entire reason to exist is a genuinely annoying problem with wrapped workflows.

    Why you'd reach for it

    When CryptoCat encrypts or compresses a workflow, the visible shell and the hidden graph are separate. The person running the packaged version gets a DecodeCryptoNode and a handful of exposed controls - but the KSampler's "randomize" button, which normally rolls a new seed every run, often stops being able to touch the buried sampler. Result: you get the same image over and over, or you can't vary anything, which defeats the point of playing with a generator. The README puts it plainly: RandomSeedNode "generates random numbers on the server side to fix the randomization problem after the workflow is encapsulated." In the pack's demo workflow, that's exactly what it does - its INT output feeds the KSampler's seed input, so every run starts from a genuinely new seed no matter what the shell allows.

    It's a small fix, but it's the difference between a sealed workflow that feels dead and one that still behaves like a generator. That's the use case. If you're not running encrypted workflows, this node has nothing for you - ComfyUI's built-in seed control already does the job, and you don't need a helper.

    How it works

    The implementation is two lines: random.randint(0, 999999) inside the node's random() method, plus IS_CHANGED returning NaN. That second part is the actual trick - it tells ComfyUI the node's output can never be cached, so it re-executes on every run and always produces a new value. No inputs, no state, nothing to configure. The range (0–999999) matches the seed range you're used to on stock KSampler nodes, and it's fine for seeding samplers. It's not cryptographic-grade randomness - it's Python's Mersenne Twister - but that's irrelevant for image generation.

    The one thing you wire

    There's a single INT output. Run it into any node that takes a seed integer - KSampler is the obvious one, but it'll feed anything with an INT input. Because it re-rolls every execution, wire it once and leave it; you don't touch it per run.

    Installing it

    You get this node with the whole pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/RiceRound/ComfyUI_CryptoCat
    

    then restart ComfyUI. Or search "CryptoCat" in ComfyUI Manager (pack title ComfyUI Compression and Encryption Node). Dependencies are light - aiohttp, pyzipper, websockets - no models to fetch. Unlike the pack's hidden legacy nodes, RandomSeedNode shows up normally in the Advanced menu.

    Gotchas

    Worth being clear about where this pack fits: CryptoCat's current-generation encryption requires an account and login against the author's server (riceround.online), and serial numbers are bound to hardware IDs on first use. RandomSeedNode itself doesn't need any of that - it's just a number generator - but if the workflow you're running is gated by the encryption path, the login and license flow applies to the whole thing. And a community reality check: this is a niche pack that launched in 2024 with a "world's first" claim and got one skeptical Reddit thread in response. If you bought or received an encrypted workflow, RandomSeedNode is the part that keeps it usable. If you're just browsing custom nodes, this particular one won't change your life.

    Categoryadvanced/CryptoCat

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    INTINT