add read access to settings for jsavascript

add an option to disable lightbox modal
This commit is contained in:
AUTOMATIC
2022-09-18 22:25:18 +03:00
parent 21086e60a9
commit f3d83fd68a
5 changed files with 62 additions and 5 deletions

View File

@@ -159,6 +159,7 @@ class Options:
"interrogate_clip_max_length": OptionInfo(48, "Interrogate: maximum description length", gr.Slider, {"minimum": 1, "maximum": 256, "step": 1}),
"interrogate_clip_dict_limit": OptionInfo(1500, "Interrogate: maximum number of lines in text file (0 = No limit)"),
"sd_model_checkpoint": OptionInfo(None, "Stable Diffusion checkpoint", gr.Radio, lambda: {"choices": [x.title for x in modules.sd_models.checkpoints_list.values()]}),
"js_modal_lightbox": OptionInfo(True, "Enable full page image viewer"),
}
def __init__(self):
@@ -193,6 +194,10 @@ class Options:
item = self.data_labels.get(key)
item.onchange = func
def dumpjson(self):
d = {k: self.data.get(k, self.data_labels.get(k).default) for k in self.data_labels.keys()}
return json.dumps(d)
opts = Options()
if os.path.exists(config_filename):