WebcamCapture ignores capture_on_queue flag in IS_CHANGED
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 158
Description
## Bug
The `WebcamCapture` node has a `capture_on_queue` option (default: `True`) that's supposed to trigger a new capture every time a prompt is queued. But the `IS_CHANGED` method completely ignores this flag:
```python
@classmethod
def IS_CHANGED(cls, image, width, height, capture_on_queue):
return super().IS_CHANGED(image) # capture_on_queue is never used!
```
`super().IS_CHANGED(image)` returns a SHA-256 hash of the image file. When `capture_on_queue=True`, if the webcam frame written to disk happens to match the previous one (or the file hasn't been updated yet), ComfyUI's caching layer sees the same hash and skips re-execution entirely. The node appears to "freeze" and doesn't process new frames.
## Expected behavior
When `capture_on_queue=True`, `IS_CHANGED` should return `float('NaN')` so the node is always considered changed and re-executed on every queue. When `capture_on_queue=False`, the file hash check is correct — only re-run if the image actually changed.
## Fix
```python
@classmethod
def IS_CHANGED(cls, image, width, height, capture_on_queue):
if capture_on_queue:
return float("NaN")
return super().IS_CHANGED(image)
```
This matches the pattern used elsewhere in the codebase (e.g. `tests/execution/testing_nodes/testing-pack/specific_tests.py`) where `float('NaN')` is returned to force unconditional re-execution.
Contributor guide
Assessment
This issue has not been assessed yet.