mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
25e8273d2f
--styles-file change to append str --styles-file is [] then defaults to [styles.csv] --styles-file accepts paths or paths with wildcard "*" the first `--styles-file` entry is use as the default styles file path if filename a wildcard then the first matching file is used if no match is found, create a new "styles.csv" in the same dir as the first path when saving a new style it will be save in the default styles file when saving a existing style, it will be saved to file it belongs to order of the styles files in the styles dropdown can be controlled to a certain degree by the order of --styles-file
89 lines
2.5 KiB
Python
89 lines
2.5 KiB
Python
import os
|
|
import sys
|
|
|
|
import gradio as gr
|
|
|
|
from modules import shared_cmd_options, shared_gradio_themes, options, shared_items, sd_models_types
|
|
from modules.paths_internal import models_path, script_path, data_path, sd_configs_path, sd_default_config, sd_model_file, default_sd_model_file, extensions_dir, extensions_builtin_dir # noqa: F401
|
|
from modules import util
|
|
|
|
cmd_opts = shared_cmd_options.cmd_opts
|
|
parser = shared_cmd_options.parser
|
|
|
|
batch_cond_uncond = True # old field, unused now in favor of shared.opts.batch_cond_uncond
|
|
parallel_processing_allowed = True
|
|
styles_filename = cmd_opts.styles_file = cmd_opts.styles_file if len(cmd_opts.styles_file) > 0 else [os.path.join(data_path, 'styles.csv')]
|
|
config_filename = cmd_opts.ui_settings_file
|
|
hide_dirs = {"visible": not cmd_opts.hide_ui_dir_config}
|
|
|
|
demo = None
|
|
|
|
device = None
|
|
|
|
weight_load_location = None
|
|
|
|
xformers_available = False
|
|
|
|
hypernetworks = {}
|
|
|
|
loaded_hypernetworks = []
|
|
|
|
state = None
|
|
|
|
prompt_styles = None
|
|
|
|
interrogator = None
|
|
|
|
face_restorers = []
|
|
|
|
options_templates = None
|
|
opts = None
|
|
restricted_opts = None
|
|
|
|
sd_model: sd_models_types.WebuiSdModel = None
|
|
|
|
settings_components = None
|
|
"""assinged from ui.py, a mapping on setting names to gradio components repsponsible for those settings"""
|
|
|
|
tab_names = []
|
|
|
|
latent_upscale_default_mode = "Latent"
|
|
latent_upscale_modes = {
|
|
"Latent": {"mode": "bilinear", "antialias": False},
|
|
"Latent (antialiased)": {"mode": "bilinear", "antialias": True},
|
|
"Latent (bicubic)": {"mode": "bicubic", "antialias": False},
|
|
"Latent (bicubic antialiased)": {"mode": "bicubic", "antialias": True},
|
|
"Latent (nearest)": {"mode": "nearest", "antialias": False},
|
|
"Latent (nearest-exact)": {"mode": "nearest-exact", "antialias": False},
|
|
}
|
|
|
|
sd_upscalers = []
|
|
|
|
clip_model = None
|
|
|
|
progress_print_out = sys.stdout
|
|
|
|
gradio_theme = gr.themes.Base()
|
|
|
|
total_tqdm = None
|
|
|
|
mem_mon = None
|
|
|
|
options_section = options.options_section
|
|
OptionInfo = options.OptionInfo
|
|
OptionHTML = options.OptionHTML
|
|
|
|
natural_sort_key = util.natural_sort_key
|
|
listfiles = util.listfiles
|
|
html_path = util.html_path
|
|
html = util.html
|
|
walk_files = util.walk_files
|
|
ldm_print = util.ldm_print
|
|
|
|
reload_gradio_theme = shared_gradio_themes.reload_gradio_theme
|
|
|
|
list_checkpoint_tiles = shared_items.list_checkpoint_tiles
|
|
refresh_checkpoints = shared_items.refresh_checkpoints
|
|
list_samplers = shared_items.list_samplers
|
|
reload_hypernetworks = shared_items.reload_hypernetworks
|