diff options
author | Ferdinand Weynschenk <flweynschenk@gmail.com> | 2023-06-20 11:50:02 +0000 |
---|---|---|
committer | Ferdinand Weynschenk <flweynschenk@gmail.com> | 2023-06-20 11:50:02 +0000 |
commit | 7ad48120d45e678b6343f7d95a1f97607858009a (patch) | |
tree | 248caa14f83e613d728f43c782b4ae38cdbb27d4 | |
parent | 928bd42da46683315c9f4498f6fbd5c59279da18 (diff) | |
download | stable-diffusion-webui-gfx803-7ad48120d45e678b6343f7d95a1f97607858009a.tar.gz stable-diffusion-webui-gfx803-7ad48120d45e678b6343f7d95a1f97607858009a.tar.bz2 stable-diffusion-webui-gfx803-7ad48120d45e678b6343f7d95a1f97607858009a.zip |
use ui params when retreiving png info fails
Don't want to interrupt the process since batches can be huge. This makes more sense to me than using the previous images parameters
-rw-r--r-- | modules/img2img.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/img2img.py b/modules/img2img.py index 88e172ff..e46a6fde 100644 --- a/modules/img2img.py +++ b/modules/img2img.py @@ -34,8 +34,13 @@ def process_batch(p, use_png_info, png_info_props, png_info_dir, input_dir, outp state.job_count = len(images) * p.n_iter
+ # extract "default" params to use in case getting png info fails
prompt = p.prompt
negative_prompt = p.negative_prompt
+ seed = p.seed
+ cfg_scale = p.cfg_scale
+ sampler_name = p.sampler_name
+ steps = p.steps
for i, image in enumerate(images):
state.job = f"{i+1} out of {len(images)}"
@@ -86,6 +91,10 @@ def process_batch(p, use_png_info, png_info_props, png_info_dir, input_dir, outp except:
p.prompt = prompt
p.negative_prompt = negative_prompt
+ p.seed = seed
+ p.cfg_scale = cfg_scale
+ p.sampler_name = sampler_name
+ p.steps = steps
print(f"batch png info: using ui set prompts; failed to get png info for {image}")
proc = modules.scripts.scripts_img2img.run(p, *args)
|