diff options
author | Johan Aires Rastén <johan@oljud.se> | 2022-09-16 19:20:56 +0000 |
---|---|---|
committer | Johan Aires Rastén <johan@oljud.se> | 2022-09-18 13:13:28 +0000 |
commit | a96076f49ce7755ebdf3cad588b5c0d2f1f93035 (patch) | |
tree | 8401da6faae1ba3218f8d812ca6a196884909ca2 /modules/processing.py | |
parent | 7476593014404314f06928ee500bc281a51de5cd (diff) | |
download | stable-diffusion-webui-gfx803-a96076f49ce7755ebdf3cad588b5c0d2f1f93035.tar.gz stable-diffusion-webui-gfx803-a96076f49ce7755ebdf3cad588b5c0d2f1f93035.tar.bz2 stable-diffusion-webui-gfx803-a96076f49ce7755ebdf3cad588b5c0d2f1f93035.zip |
Add buttons for random and reuse seed.
Random button sets seed to -1, reuse copies the seed from the last
generated image.
Diffstat (limited to 'modules/processing.py')
-rw-r--r-- | modules/processing.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/processing.py b/modules/processing.py index 1afbe39c..244ed639 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -83,11 +83,13 @@ class StableDiffusionProcessing: class Processed:
- def __init__(self, p: StableDiffusionProcessing, images_list, seed, info):
+ def __init__(self, p: StableDiffusionProcessing, images_list, seed, subseed, info):
self.images = images_list
self.prompt = p.prompt
self.negative_prompt = p.negative_prompt
self.seed = seed
+ self.subseed = subseed
+ self.subseed_strength = p.subseed_strength
self.info = info
self.width = p.width
self.height = p.height
@@ -100,6 +102,8 @@ class Processed: "prompt": self.prompt if type(self.prompt) != list else self.prompt[0],
"negative_prompt": self.negative_prompt if type(self.negative_prompt) != list else self.negative_prompt[0],
"seed": int(self.seed if type(self.seed) != list else self.seed[0]),
+ "subseed": int(self.subseed if type(self.subseed) != list else self.subseed[0]),
+ "subseed_strength": self.subseed_strength,
"width": self.width,
"height": self.height,
"sampler": self.sampler,
@@ -352,7 +356,7 @@ def process_images(p: StableDiffusionProcessing) -> Processed: images.save_image(grid, p.outpath_grids, "grid", all_seeds[0], all_prompts[0], opts.grid_format, info=infotext(), short_filename=not opts.grid_extended_filename, p=p)
devices.torch_gc()
- return Processed(p, output_images, all_seeds[0], infotext())
+ return Processed(p, output_images, all_seeds[0], all_subseeds[0], infotext())
class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
|