Comfy-Org / Comfy-Org/ComfyUI

KSampler (Advanced)'s add_noise parameter is not handled correctly when it is disabled

Open
#11,441 4 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

When add_noise in KSampler (Advanced) node is disabled, there's no noise added and latent_image is used as is.

### Actual Behavior

When add_noise in KSampler (Advanced) node is disabled, a new empty image is created which is quite different from the expected behavior.
https://github.com/comfyanonymous/ComfyUI/blob/bbb11e26081977474eec72ce36d12ec778b5a9ea/nodes.py#L1493-L1494

### Steps to Reproduce

N/A

### Debug Logs

```powershell
N/A
```

### Other

This bug prevents from using the noise generated outside of KSampler and using it as a latent_image input.

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.