stable-diffusion-webui
88 строк · 2.5 Кб
1import os2import sys3
4import gradio as gr5
6from modules import shared_cmd_options, shared_gradio_themes, options, shared_items, sd_models_types7from 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: F4018from modules import util9
10cmd_opts = shared_cmd_options.cmd_opts11parser = shared_cmd_options.parser12
13batch_cond_uncond = True # old field, unused now in favor of shared.opts.batch_cond_uncond14parallel_processing_allowed = True15styles_filename = cmd_opts.styles_file = cmd_opts.styles_file if len(cmd_opts.styles_file) > 0 else [os.path.join(data_path, 'styles.csv')]16config_filename = cmd_opts.ui_settings_file17hide_dirs = {"visible": not cmd_opts.hide_ui_dir_config}18
19demo = None20
21device = None22
23weight_load_location = None24
25xformers_available = False26
27hypernetworks = {}28
29loaded_hypernetworks = []30
31state = None32
33prompt_styles = None34
35interrogator = None36
37face_restorers = []38
39options_templates = None40opts = None41restricted_opts = None42
43sd_model: sd_models_types.WebuiSdModel = None44
45settings_components = None46"""assinged from ui.py, a mapping on setting names to gradio components repsponsible for those settings"""
47
48tab_names = []49
50latent_upscale_default_mode = "Latent"51latent_upscale_modes = {52"Latent": {"mode": "bilinear", "antialias": False},53"Latent (antialiased)": {"mode": "bilinear", "antialias": True},54"Latent (bicubic)": {"mode": "bicubic", "antialias": False},55"Latent (bicubic antialiased)": {"mode": "bicubic", "antialias": True},56"Latent (nearest)": {"mode": "nearest", "antialias": False},57"Latent (nearest-exact)": {"mode": "nearest-exact", "antialias": False},58}
59
60sd_upscalers = []61
62clip_model = None63
64progress_print_out = sys.stdout65
66gradio_theme = gr.themes.Base()67
68total_tqdm = None69
70mem_mon = None71
72options_section = options.options_section73OptionInfo = options.OptionInfo74OptionHTML = options.OptionHTML75
76natural_sort_key = util.natural_sort_key77listfiles = util.listfiles78html_path = util.html_path79html = util.html80walk_files = util.walk_files81ldm_print = util.ldm_print82
83reload_gradio_theme = shared_gradio_themes.reload_gradio_theme84
85list_checkpoint_tiles = shared_items.list_checkpoint_tiles86refresh_checkpoints = shared_items.refresh_checkpoints87list_samplers = shared_items.list_samplers88reload_hypernetworks = shared_items.reload_hypernetworks89