Comfy-Org / Comfy-Org/ComfyUI

Randomize/Increment seed does not trigger re-execution (Cached results despite seed change)

Open
#11,905 7 comments 2 reactions 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)

### Expected Behavior

Every time the seed value changes (whether automatically by "Randomize" or manually), the execution engine should mark the node as "dirty" and trigger a fresh computation.

### Actual Behavior

The execution engine seems to ignore the automated seed change and treats the input as identical to the previous run, skipping the computation.

### Steps to Reproduce

1. Set the Seed control to "Randomize" or "Increment" on a KSampler or Seed node.
2. Click "Queue Prompt".
3. Observe that the seed value changes in the widget.
4. Observe the output: It is identical to the previous generation, and the console shows the node was "cached" (or simply finishes instantly without progress bars).
5. Manually change the seed value by typing.
6. Click "Queue Prompt" again -> The node finally re-executes and produces a new result.

### Debug Logs

```powershell
got prompt
Prompt executed in 0.08 seconds
Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle:
Traceback (most recent call last):
File "asyncio\events.py", line 88, in _run
File "asyncio\proactor_events.py", line 165, in _call_connection_lost
ConnectionResetError: [WinError 10054] 遠端主機已強制關閉一個現存的連線。
got prompt
Requested to load Flux2
loaded completely; 17862.39 MB usable, 3900.02 MB loaded, full load: True
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:23<00:00, 1.16s/it]
Requested to load AutoencoderKL
loaded completely; 15941.88 MB usable, 160.31 MB loaded, full load: True
Prompt executed in 26.58 seconds
got prompt
Requested to load Flux2
loaded completely; 17862.39 MB usable, 3900.02 MB loaded, full load: True
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:22<00:00, 1.15s/it]
Requested to load AutoencoderKL
loaded completely; 15941.88 MB usable, 160.31 MB loaded, full load: True
Requested to load Flux2
loaded completely; 16682.75 MB usable, 3900.02 MB loaded, full load: True
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:33<00:00, 1.69s/it]
Requested to load AutoencoderKL
loaded completely; 15941.88 MB usable, 160.31 MB loaded, full load: True
Prompt executed in 63.18 seconds
got prompt
got prompt
Prompt executed in 0.03 seconds
Prompt executed in 0.12 seconds
```

### Other

I am encountering an issue where ComfyUI fails to re-execute nodes when the seed is set to anything other than "Fixed" (e.g., Randomize, Increment).

Even though the seed value visibly changes in the UI after clicking "Queue Prompt," the workflow does not actually perform new computations. It immediately returns the cached output from the previous run, resulting in identical images. The only way to force a new generation is to manually type a different number into the seed field. This behavior makes batch processing and automated randomization impossible.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.