Comfy-Org / Comfy-Org/ComfyUI

EasyCache/LazyCache steps incorrect for samplers like Heun

Open
#9,594 0 comments 0 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

EasyCache logging works

### Actual Behavior

EasyCache counts Heun twice for` total_steps_skipped` but this is not reflected in `total_steps`.
So logging will be incorrect and if e.g. every Heun's step is skipped, this results in division by zero.

### Steps to Reproduce

Use EasyCache with Heun

### Debug Logs

```powershell
File "/home/runner/ComfyUI/comfy_extras/nodes_easycache.py", line 165, in easycache_sample_wrapper
logging.info(f"{easycache.name} - skipped {easycache.total_steps_skipped}/{total_steps} steps ({total_steps/(total_steps-easycache.total_steps_skipped):.2f}x speedup).")
~~~~~~~~~~~^^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero

Prompt executed in 45.30 seconds
```

### Other

_No response_

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.