stable-diffusion-webui

Форк
0
88 строк · 2.5 Кб
1
import os
2
import sys
3

4
import gradio as gr
5

6
from modules import shared_cmd_options, shared_gradio_themes, options, shared_items, sd_models_types
7
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
8
from modules import util
9

10
cmd_opts = shared_cmd_options.cmd_opts
11
parser = shared_cmd_options.parser
12

13
batch_cond_uncond = True  # old field, unused now in favor of shared.opts.batch_cond_uncond
14
parallel_processing_allowed = True
15
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')]
16
config_filename = cmd_opts.ui_settings_file
17
hide_dirs = {"visible": not cmd_opts.hide_ui_dir_config}
18

19
demo = None
20

21
device = None
22

23
weight_load_location = None
24

25
xformers_available = False
26

27
hypernetworks = {}
28

29
loaded_hypernetworks = []
30

31
state = None
32

33
prompt_styles = None
34

35
interrogator = None
36

37
face_restorers = []
38

39
options_templates = None
40
opts = None
41
restricted_opts = None
42

43
sd_model: sd_models_types.WebuiSdModel = None
44

45
settings_components = None
46
"""assinged from ui.py, a mapping on setting names to gradio components repsponsible for those settings"""
47

48
tab_names = []
49

50
latent_upscale_default_mode = "Latent"
51
latent_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

60
sd_upscalers = []
61

62
clip_model = None
63

64
progress_print_out = sys.stdout
65

66
gradio_theme = gr.themes.Base()
67

68
total_tqdm = None
69

70
mem_mon = None
71

72
options_section = options.options_section
73
OptionInfo = options.OptionInfo
74
OptionHTML = options.OptionHTML
75

76
natural_sort_key = util.natural_sort_key
77
listfiles = util.listfiles
78
html_path = util.html_path
79
html = util.html
80
walk_files = util.walk_files
81
ldm_print = util.ldm_print
82

83
reload_gradio_theme = shared_gradio_themes.reload_gradio_theme
84

85
list_checkpoint_tiles = shared_items.list_checkpoint_tiles
86
refresh_checkpoints = shared_items.refresh_checkpoints
87
list_samplers = shared_items.list_samplers
88
reload_hypernetworks = shared_items.reload_hypernetworks
89

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.