Comfy-Org / Comfy-Org/ComfyUI

Undeterministic Output using Ancestral Types and Potential Fix

Open
#1,329 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 6h
Merged PRs (30d)
155

Description

I noticed when using ancestral samplers with KSampler (Advanced) and w/ noise disabled that the output was nondetermistic.

Would using the Ksampler node seed, passed in extra_args, be a “legit” way to solve this for ancestral samplers?
The default_noise_sampler method could have it has an optional arg to not mess with other methods that use it and do not receive the seed.

But I don't know if there is some intended/planned way to go about the problem, possibly to output the same as other tools, or, since there is an argument for an alternative noise sampler, maybe this would be something to be solved in the future.

The potential solution:
```
def default_noise_sampler(x, seed=None):
if seed is not None:
torch.manual_seed(seed)
return lambda sigma, sigma_next: torch.randn_like(x)
```
```
noise_sampler = default_noise_sampler(x, extra_args["seed"]) if noise_sampler is None else noise_sampler
```

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.