You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prepare_noise is what sets the global RNG that various thing such as ancestral samplers use, so when add_noise is disabled this means no seed gets set before sampling and the RNG is an undefined state. in other words, if you turn off add_noise and use a sampler like euler_a it's impossible to reproduce generations.
it's easy to reproduce: just use an advanced or custom sampler, set a fixed seed, turn off add_noise and use euler_a. start generating and look at the preview. abort it at 50% or so and restart, you will get a completely new generation each time.
is there any reason not to just do torch.manual_seed(seed) in the disable_noise code path to ensure the RNG is in a defined state based on the seed the user set?
see below for a visual demonstration of the issue. ignore the "Noisy Latent Image" node, it's not connected to anything. the seed comes from a Seed Everywhere node near the top right (set to 0)
the common sampler code has:
prepare_noise
is what sets the global RNG that various thing such as ancestral samplers use, so whenadd_noise
is disabled this means no seed gets set before sampling and the RNG is an undefined state. in other words, if you turn offadd_noise
and use a sampler likeeuler_a
it's impossible to reproduce generations.it's easy to reproduce: just use an advanced or custom sampler, set a fixed seed, turn off
add_noise
and useeuler_a
. start generating and look at the preview. abort it at 50% or so and restart, you will get a completely new generation each time.is there any reason not to just do
torch.manual_seed(seed)
in thedisable_noise
code path to ensure the RNG is in a defined state based on the seed the user set?i made a simple work around ( https://github.com/blepping/ComfyUI-bleh#blehforceseedsampler ) but it would be nice if that wasn't necessary.edit: my workaround doesn't seem to work reliablysee below for a visual demonstration of the issue. ignore the "Noisy Latent Image" node, it's not connected to anything. the seed comes from a
Seed Everywhere
node near the top right (set to 0)current behavior
with #2841
The text was updated successfully, but these errors were encountered: