diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-06 22:44:44 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-06 22:44:44 +0000 |
commit | a1743e4518e5770296f097d7d1d29094c2b6bae4 (patch) | |
tree | d697c2065def31cb3ed7fb30287504658278ccf4 /modules/processing.py | |
parent | a8504157a02e61d787a2b924f4f8de6f578f0aac (diff) | |
download | stable-diffusion-webui-gfx803-a1743e4518e5770296f097d7d1d29094c2b6bae4.tar.gz stable-diffusion-webui-gfx803-a1743e4518e5770296f097d7d1d29094c2b6bae4.tar.bz2 stable-diffusion-webui-gfx803-a1743e4518e5770296f097d7d1d29094c2b6bae4.zip |
remove double basicr requirement
add seed change for anon
Diffstat (limited to 'modules/processing.py')
-rw-r--r-- | modules/processing.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/processing.py b/modules/processing.py index 23fe54d1..78bc73b9 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -99,6 +99,10 @@ def create_random_tensors(shape, seeds): return x
+def set_seed(seed):
+ return int(random.randrange(4294967294)) if seed is None or seed == -1 else seed
+
+
def process_images(p: StableDiffusionProcessing) -> Processed:
"""this is the main loop that both txt2img and img2img use; it calls func_init once inside all the scopes and func_sample once per batch"""
@@ -107,7 +111,7 @@ def process_images(p: StableDiffusionProcessing) -> Processed: assert p.prompt is not None
torch_gc()
- seed = int(random.randrange(4294967294)) if p.seed == -1 else p.seed
+ seed = set_seed(p.seed)
os.makedirs(p.outpath_samples, exist_ok=True)
os.makedirs(p.outpath_grids, exist_ok=True)
|