From 0f40c4b9b116a16b7e81e75a4e78b98a310e414d Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Thu, 20 Jun 2024 20:02:59 +0900 Subject: [PATCH] fix Sampler Scheduler autocorrection warning --- modules/sd_samplers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/sd_samplers.py b/modules/sd_samplers.py index b8abac4a9..963da5be0 100644 --- a/modules/sd_samplers.py +++ b/modules/sd_samplers.py @@ -98,7 +98,7 @@ def get_hr_scheduler_from_infotext(d: dict): @functools.cache -def get_sampler_and_scheduler(sampler_name, scheduler_name): +def get_sampler_and_scheduler(sampler_name, scheduler_name, *, convert_automatic=True): default_sampler = samplers[0] found_scheduler = sd_schedulers.schedulers_map.get(scheduler_name, sd_schedulers.schedulers[0]) @@ -116,7 +116,7 @@ def get_sampler_and_scheduler(sampler_name, scheduler_name): sampler = all_samplers_map.get(name, default_sampler) # revert back to Automatic if it's the default scheduler for the selected sampler - if sampler.options.get('scheduler', None) == found_scheduler.name: + if convert_automatic and sampler.options.get('scheduler', None) == found_scheduler.name: found_scheduler = sd_schedulers.schedulers[0] return sampler.name, found_scheduler.label @@ -124,7 +124,7 @@ def get_sampler_and_scheduler(sampler_name, scheduler_name): def fix_p_invalid_sampler_and_scheduler(p): i_sampler_name, i_scheduler = p.sampler_name, p.scheduler - p.sampler_name, p.scheduler = get_sampler_and_scheduler(p.sampler_name, p.scheduler) + p.sampler_name, p.scheduler = get_sampler_and_scheduler(p.sampler_name, p.scheduler, convert_automatic=False) if p.sampler_name != i_sampler_name or i_scheduler != p.scheduler: logging.warning(f'Sampler Scheduler autocorrection: "{i_sampler_name}" -> "{p.sampler_name}", "{i_scheduler}" -> "{p.scheduler}"')