diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-30 15:22:50 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-30 15:24:21 +0000 |
commit | 87cca029d7133b4060650b8ec33fc6772cc2f7dd (patch) | |
tree | b98333882015bef22507cd840ca3723a1058aede /modules/sd_samplers_common.py | |
parent | 1ac11b3dae49568fc0b3ae6afe6627196a0a001e (diff) | |
download | stable-diffusion-webui-gfx803-87cca029d7133b4060650b8ec33fc6772cc2f7dd.tar.gz stable-diffusion-webui-gfx803-87cca029d7133b4060650b8ec33fc6772cc2f7dd.tar.bz2 stable-diffusion-webui-gfx803-87cca029d7133b4060650b8ec33fc6772cc2f7dd.zip |
add an option to choose how to combine hires fix and refiner
Diffstat (limited to 'modules/sd_samplers_common.py')
-rw-r--r-- | modules/sd_samplers_common.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/sd_samplers_common.py b/modules/sd_samplers_common.py index 60fa161c..6c935a38 100644 --- a/modules/sd_samplers_common.py +++ b/modules/sd_samplers_common.py @@ -164,8 +164,17 @@ def apply_refiner(cfg_denoiser): if refiner_checkpoint_info is None or shared.sd_model.sd_checkpoint_info == refiner_checkpoint_info:
return False
- if getattr(cfg_denoiser.p, "enable_hr", False) and not cfg_denoiser.p.is_hr_pass:
- return False
+ if getattr(cfg_denoiser.p, "enable_hr", False):
+ is_second_pass = cfg_denoiser.p.is_hr_pass
+
+ if opts.hires_fix_refiner_pass == "first pass" and is_second_pass:
+ return False
+
+ if opts.hires_fix_refiner_pass == "second pass" and not is_second_pass:
+ return False
+
+ if opts.hires_fix_refiner_pass != "second pass":
+ cfg_denoiser.p.extra_generation_params['Hires refiner'] = opts.hires_fix_refiner_pass
cfg_denoiser.p.extra_generation_params['Refiner'] = refiner_checkpoint_info.short_title
cfg_denoiser.p.extra_generation_params['Refiner switch at'] = refiner_switch_at
|