comfy_randomize_seeds
Replace -1 seed sentinels in ComfyUI workflows with fresh random values, or force randomization of all seed widgets. Returns a patched workflow and new seed assignments.
Instructions
Replace seed sentinels (-1) with fresh random uint32 values.
By default, only widgets currently set to -1 are randomised; this lets
a caller "opt in" by writing -1 for the seeds they want fresh while
pinning the others to specific values. Set force=True to randomise
every seed widget in the workflow regardless of its current value.
Uses secrets.randbelow(2**32) for cryptographic-grade randomness -
avoids the seeded global random module so concurrent randomisation
calls don't share a stream.
Args: workflow: API-format workflow dict (deep-copied; caller's dict stays unchanged). force: Randomise every seed widget regardless of current value.
Returns:
JSON with workflow (patched copy) and assignments mapping
node_id.field -> new_seed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | ||
| workflow | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |