mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-06 07:05:06 +08:00
emergency fix for the settings screen breaking the program
This commit is contained in:
parent
6d1c01c955
commit
75b90a5e40
@ -99,12 +99,7 @@ def realesrgan_models_names():
|
||||
import modules.realesrgan_model
|
||||
return [x.name for x in modules.realesrgan_model.get_realesrgan_models()]
|
||||
|
||||
def optionsSection(sectionIdentifer,optionsDict):
|
||||
for k,v in optionsDict.items():
|
||||
v.section = sectionIdentifer
|
||||
return optionsDict
|
||||
|
||||
class Options:
|
||||
class OptionInfo:
|
||||
def __init__(self, default=None, label="", component=None, component_args=None, onchange=None):
|
||||
self.default = default
|
||||
@ -113,10 +108,19 @@ class Options:
|
||||
self.component_args = component_args
|
||||
self.onchange = onchange
|
||||
|
||||
data = None
|
||||
|
||||
def options_section(section_identifer, options_dict):
|
||||
for k, v in options_dict.items():
|
||||
v.section = section_identifer
|
||||
|
||||
return options_dict
|
||||
|
||||
|
||||
hide_dirs = {"visible": False} if cmd_opts.hide_ui_dir_config else None
|
||||
|
||||
data_labels.update(optionsSection((0,"General"),{
|
||||
options_templates = {}
|
||||
|
||||
options_templates.update(options_section((0, "General"), {
|
||||
"filter_nsfw": OptionInfo(False, "Filter NSFW content"),
|
||||
"enable_pnginfo": OptionInfo(True, "Save text information about generation parameters as chunks to png files"),
|
||||
"add_model_hash_to_info": OptionInfo(False, "Add model hash to generation information"),
|
||||
@ -145,7 +149,7 @@ class Options:
|
||||
"use_original_name_batch": OptionInfo(False, "Use original name for output filename during batch process"),
|
||||
}))
|
||||
|
||||
data_labels.update(optionsSection((1,"File and Folder Locations"),{
|
||||
options_templates.update(options_section((1, "File and Folder Locations"), {
|
||||
"samples_filename_pattern": OptionInfo("", "Images filename pattern"),
|
||||
"save_to_dirs": OptionInfo(False, "Save images to a subdirectory"),
|
||||
"grid_save_to_dirs": OptionInfo(False, "Save grids to subdirectory"),
|
||||
@ -163,14 +167,14 @@ class Options:
|
||||
"export_for_4chan": OptionInfo(True, "If PNG image is larger than 4MB or any dimension is larger than 4000, downscale and save copy as JPG"),
|
||||
}))
|
||||
|
||||
data_labels.update(optionsSection((2,"Sampling Options"),{
|
||||
options_templates.update(options_section((2, "Sampling Options"), {
|
||||
"samples_save": OptionInfo(True, "Always save all generated images"),
|
||||
"samples_log_stdout": OptionInfo(False, "Always print all generation info to standard output"),
|
||||
"save_selected_only": OptionInfo(False, "When using 'Save' button, only save a single selected image"),
|
||||
"samples_format": OptionInfo('png', 'File format for individual samples'),
|
||||
}))
|
||||
|
||||
data_labels.update(optionsSection((3,"Grid Options"),{
|
||||
options_templates.update(options_section((3, "Grid Options"), {
|
||||
"grid_save": OptionInfo(True, "Always save all generated image grids"),
|
||||
"return_grid": OptionInfo(True, "Show grid in results for web"),
|
||||
"grid_format": OptionInfo('png', 'File format for grids'),
|
||||
@ -179,7 +183,7 @@ class Options:
|
||||
"n_rows": OptionInfo(-1, "Grid row count; use -1 for autodetect and 0 for it to be same as batch size", gr.Slider, {"minimum": -1, "maximum": 16, "step": 1}),
|
||||
}))
|
||||
|
||||
data_labels.update(optionsSection((4,"Model Options"),{
|
||||
options_templates.update(options_section((4, "Model Options"), {
|
||||
"img2img_color_correction": OptionInfo(False, "Apply color correction to img2img results to match original colors."),
|
||||
"img2img_fix_steps": OptionInfo(False, "With img2img, do exactly the amount of steps the slider specifies (normally you'd do less with less denoising)."),
|
||||
"enable_quantization": OptionInfo(False, "Enable quantization in K samplers for sharper and cleaner results. This may change existing seeds. Requires restart to apply."),
|
||||
@ -188,7 +192,7 @@ class Options:
|
||||
"enable_batch_seeds": OptionInfo(True, "Make K-diffusion samplers produce same images in a batch as when making a single image"),
|
||||
}))
|
||||
|
||||
data_labels.update(optionsSection((5,"Interrogate Options"),{
|
||||
options_templates.update(options_section((5, "Interrogate Options"), {
|
||||
"interrogate_keep_models_in_memory": OptionInfo(False, "Interrogate: keep models in VRAM"),
|
||||
"interrogate_use_builtin_artists": OptionInfo(True, "Interrogate: use artists from artists.csv"),
|
||||
"interrogate_clip_num_beams": OptionInfo(1, "Interrogate: num_beams for BLIP", gr.Slider, {"minimum": 1, "maximum": 16, "step": 1}),
|
||||
@ -197,6 +201,11 @@ class Options:
|
||||
"interrogate_clip_dict_limit": OptionInfo(1500, "Interrogate: maximum number of lines in text file (0 = No limit)"),
|
||||
}))
|
||||
|
||||
|
||||
class Options:
|
||||
data = None
|
||||
data_labels = options_templates
|
||||
|
||||
def __init__(self):
|
||||
self.data = {k: v.default for k, v in self.data_labels.items()}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user