stable-diffusion-webui/scripts/webui_flet_utils.py
ZeroCool940711 ad0a56829c
Merged changes from @aedhcarrick to the config file.
- Improved the layout for the new UI by changing some menus to dropdowns.
- Reduced the padding on text fields as well as dropdowns.
2022-11-22 18:29:14 -07:00

35 lines
938 B
Python

# webui_utils.py
# imports
import os, yaml
from pprint import pprint
# Settings
path_to_default_config = 'configs/webui/webui_flet.yaml'
path_to_user_config = 'configs/webui/userconfig_flet.yaml'
def get_default_settings_from_config():
with open(path_to_default_config) as f:
default_settings = yaml.safe_load(f)
return default_settings
def get_user_settings_from_config():
settings = get_default_settings_from_config()
if os.path.exists(path_to_user_config):
with open(path_to_user_config) as f:
user_settings = yaml.safe_load(f)
settings.update(user_settings)
return settings
def save_user_settings_to_config(settings):
with open(path_to_user_config, 'w+') as f:
yaml.dump(settings, f, default_flow_style=False)
# Textual Inversion
textual_inversion_grid_row_list = [
'model', 'medium', 'artist', 'trending', 'movement', 'flavors', 'techniques', 'tags',
]