diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-16 07:04:07 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-16 07:04:07 +0000 |
commit | b8cf2ea8ea50da7084061895e5af7b22c37633c0 (patch) | |
tree | 22b9010fce8ce04a6a176c5c828dea031344213b | |
parent | 83bce1a604f40356583d31c8c0b2f8b590dda071 (diff) | |
download | stable-diffusion-webui-gfx803-b8cf2ea8ea50da7084061895e5af7b22c37633c0.tar.gz stable-diffusion-webui-gfx803-b8cf2ea8ea50da7084061895e5af7b22c37633c0.tar.bz2 stable-diffusion-webui-gfx803-b8cf2ea8ea50da7084061895e5af7b22c37633c0.zip |
add a bit of a comment about what's being done with tensor noise
-rw-r--r-- | modules/processing.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/processing.py b/modules/processing.py index 798313ee..81c83f06 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -122,6 +122,10 @@ 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):
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-genrated tensors instead of siimple 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:
sampler_noises = [[] for _ in range(p.sampler.number_of_needed_noises(p))]
else:
|