Update rng.py

This commit is contained in:
lllyasviel
2024-02-05 14:12:31 -08:00
parent b174caa275
commit d45066bef5

View File

@@ -11,6 +11,7 @@ def randn(seed, shape, generator=None):
if generator is not None:
# If generator is not none, we must use another seed to
# avoid global torch.rand to get same noise again.
# Note: removing this will make DDPM sampler broken.
manual_seed((seed + 262144) % 65536)
else:
manual_seed(seed)