mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
fix config
This commit is contained in:
+8
-8
@@ -16,10 +16,17 @@ config_dict = {}
|
|||||||
always_save_keys = []
|
always_save_keys = []
|
||||||
visited_keys = []
|
visited_keys = []
|
||||||
|
|
||||||
|
try:
|
||||||
|
with open(os.path.abspath(f'./presets/default.json'), "r", encoding="utf-8") as json_file:
|
||||||
|
config_dict.update(json.load(json_file))
|
||||||
|
except Exception as e:
|
||||||
|
print(f'Load default preset failed.')
|
||||||
|
print(e)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if os.path.exists(config_path):
|
if os.path.exists(config_path):
|
||||||
with open(config_path, "r", encoding="utf-8") as json_file:
|
with open(config_path, "r", encoding="utf-8") as json_file:
|
||||||
config_dict = json.load(json_file)
|
config_dict.update(json.load(json_file))
|
||||||
always_save_keys = list(config_dict.keys())
|
always_save_keys = list(config_dict.keys())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f'Failed to load config file "{config_path}" . The reason is: {str(e)}')
|
print(f'Failed to load config file "{config_path}" . The reason is: {str(e)}')
|
||||||
@@ -79,13 +86,6 @@ def try_load_deprecated_user_path_config():
|
|||||||
|
|
||||||
try_load_deprecated_user_path_config()
|
try_load_deprecated_user_path_config()
|
||||||
|
|
||||||
try:
|
|
||||||
with open(os.path.abspath(f'./presets/default.json'), "r", encoding="utf-8") as json_file:
|
|
||||||
config_dict.update(json.load(json_file))
|
|
||||||
except Exception as e:
|
|
||||||
print(f'Load default preset failed.')
|
|
||||||
print(e)
|
|
||||||
|
|
||||||
preset = args_manager.args.preset
|
preset = args_manager.args.preset
|
||||||
|
|
||||||
if isinstance(preset, str):
|
if isinstance(preset, str):
|
||||||
|
|||||||
Reference in New Issue
Block a user