diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-12-26 07:11:28 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-12-26 07:11:28 +0000 |
commit | 4af3ca5393151d61363c30eef4965e694eeac15e (patch) | |
tree | 66cc90ef929aa9f50b0100c61440e09688702df7 | |
parent | c6f347b81f584b6c0d44af7a209983284dbb52d2 (diff) | |
download | stable-diffusion-webui-gfx803-4af3ca5393151d61363c30eef4965e694eeac15e.tar.gz stable-diffusion-webui-gfx803-4af3ca5393151d61363c30eef4965e694eeac15e.tar.bz2 stable-diffusion-webui-gfx803-4af3ca5393151d61363c30eef4965e694eeac15e.zip |
make it so that blank ENSD does not break image generation
-rw-r--r-- | modules/processing.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/processing.py b/modules/processing.py index 4a406084..0a9a8f95 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -338,13 +338,14 @@ def slerp(val, low, high): def create_random_tensors(shape, seeds, subseeds=None, subseed_strength=0.0, seed_resize_from_h=0, seed_resize_from_w=0, p=None):
+ eta_noise_seed_delta = opts.eta_noise_seed_delta or 0
xs = []
# if we have multiple seeds, this means we are working with batch size>1; this then
# enables the generation of additional tensors with noise that the sampler will use during its processing.
# Using those pre-generated tensors instead of simple torch.randn allows a batch with seeds [100, 101] to
# produce the same images as with two batches [100], [101].
- if p is not None and p.sampler is not None and (len(seeds) > 1 and opts.enable_batch_seeds or opts.eta_noise_seed_delta > 0):
+ if p is not None and p.sampler is not None and (len(seeds) > 1 and opts.enable_batch_seeds or eta_noise_seed_delta > 0):
sampler_noises = [[] for _ in range(p.sampler.number_of_needed_noises(p))]
else:
sampler_noises = None
@@ -384,8 +385,8 @@ def create_random_tensors(shape, seeds, subseeds=None, subseed_strength=0.0, see if sampler_noises is not None:
cnt = p.sampler.number_of_needed_noises(p)
- if opts.eta_noise_seed_delta > 0:
- torch.manual_seed(seed + opts.eta_noise_seed_delta)
+ if eta_noise_seed_delta > 0:
+ torch.manual_seed(seed + eta_noise_seed_delta)
for j in range(cnt):
sampler_noises[j].append(devices.randn_without_seed(tuple(noise_shape)))
|