画布随机种子生成 🌱
A seed node that forgot control_after_generate (and when that's fine)
- seed
CanvasRandomSeed exists to put a seed on a wire. Most of the time in ComfyUI your seed lives as a widget on the KSampler, and that's fine. But this pack's Infinite Canvas frontend wants to read and set the seed itself, which is a lot easier when it's a plain INT socket coming out of a real node instead of a number buried in a sampler widget. That's the whole job: one input choice, one integer out.
How it works
Two inputs decide everything:
- seed_type -
RandomorFixed, defaultRandom. - fixed_seed - an INT from 0 to 4,294,967,295 (the full 32-bit range), used only in Fixed mode.
In Random mode the node calls Python's random.randint(0, 2**31 - 1) and hands you the result. In Fixed mode it just echoes fixed_seed back out. That's the entire mechanism - no RNG from the sampler, no seed control nets, nothing clever.
The gotchas, because there are two
There's no control_after_generate. On a native KSampler seed widget you get the little dropdown that decides what happens to the seed after a run - fixed, increment, decrement, randomize. This node has none of that. Random rolls a number and never locks it, so if you hit gold on a run you can't flip a switch to keep it. Your recovery is to read the seed from ComfyUI's queue log and paste it into fixed_seed. If you don't know that lore yet, this is a good place to learn it: the "which seed just made this image" confusion is one of the most reliable beginner injuries in ComfyUI.
The cache may eat your random. This node defines no IS_CHANGED method, and that matters. ComfyUI caches node outputs - when nothing upstream changed, a node can be skipped and its previous result reused. Random pickers normally opt out of that cache by returning NaN from IS_CHANGED; CanvasRandomSeed doesn't, so in practice "Random" can hand you the same number on repeat queues. If you need a genuinely fresh seed every run, treat Random with suspicion, or drive fixed_seed from a widget you bump yourself.
One more minor quirk: Random rolls up to 2³¹−1 even though the input field accepts 2³²−1. Harmless - samplers don't care about the range - but don't be confused when the number looks small.
Should you even use it?
If you're building a workflow for the Infinite Canvas frontend, yes - the seed needs to be a wire the frontend can see. If you're in a plain ComfyUI workflow, the KSampler's own seed widget with control_after_generate does the same job with more control and zero extra nodes. Reach for this one when the pack's ecosystem is your ecosystem.
Install
Clone into custom nodes (or ComfyUI Manager → search "ComfyUI-Infinite-Canvas"):
cd ComfyUI/custom_nodes
git clone https://github.com/zml-w/ComfyUI-Infinite-Canvas
Restart ComfyUI, let the requirements (opencv-python, imageio-ffmpeg) install. The pack also wants --enable-cors-header in your ComfyUI startup args - required for the frontend, optional if you only use the nodes. In the node list you'll find it under the 无限画布 category as 画布随机种子生成 🌱; that's this node in a Chinese label.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| seed_type | COMBO | Random | 2 options: Random, Fixed |
| fixed_seed | INT | 00–4294967295 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| seed | INT | — |