Commit d02c4da4 authored by AUTOMATIC1111's avatar AUTOMATIC1111

also prevent changing API options via override_settings

parent df595ae3
...@@ -116,7 +116,7 @@ class Options: ...@@ -116,7 +116,7 @@ class Options:
return super(Options, self).__getattribute__(item) return super(Options, self).__getattribute__(item)
def set(self, key, value, is_api=False): def set(self, key, value, is_api=False, run_callbacks=True):
"""sets an option and calls its onchange callback, returning True if the option changed and False otherwise""" """sets an option and calls its onchange callback, returning True if the option changed and False otherwise"""
oldval = self.data.get(key, None) oldval = self.data.get(key, None)
...@@ -135,7 +135,7 @@ class Options: ...@@ -135,7 +135,7 @@ class Options:
except RuntimeError: except RuntimeError:
return False return False
if option.onchange is not None: if run_callbacks and option.onchange is not None:
try: try:
option.onchange() option.onchange()
except Exception as e: except Exception as e:
......
...@@ -709,7 +709,7 @@ def process_images(p: StableDiffusionProcessing) -> Processed: ...@@ -709,7 +709,7 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
sd_models.reload_model_weights() sd_models.reload_model_weights()
for k, v in p.override_settings.items(): for k, v in p.override_settings.items():
setattr(opts, k, v) opts.set(k, v, is_api=True, run_callbacks=False)
if k == 'sd_model_checkpoint': if k == 'sd_model_checkpoint':
sd_models.reload_model_weights() sd_models.reload_model_weights()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment