4tyzap commited on
Commit
5f5a356
·
verified ·
1 Parent(s): 10c34d9

Upload !archived!settings.py

Browse files
RuinedFooocus/modules/!archived!settings.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ from os.path import exists
3
+
4
+ from shared import path_manager
5
+
6
+ DEFAULT_SETTINGS = {
7
+ "advanced_mode": False,
8
+ "image_number": 1,
9
+ "seed_random": True,
10
+ "seed": 0,
11
+ "style": ["Style: sai-cinematic"],
12
+ "prompt": "",
13
+ "negative_prompt": "",
14
+ "performance": "Speed",
15
+ "resolution": "1152x896 (4:3)",
16
+ "base_model": path_manager.default_model_names["default_base_model_name"],
17
+ "lora_1_model": "None",
18
+ "lora_1_weight": path_manager.default_model_names["default_lora_weight"],
19
+ "lora_2_model": "None",
20
+ "lora_2_weight": path_manager.default_model_names["default_lora_weight"],
21
+ "lora_3_model": "None",
22
+ "lora_3_weight": path_manager.default_model_names["default_lora_weight"],
23
+ "lora_4_model": "None",
24
+ "lora_4_weight": path_manager.default_model_names["default_lora_weight"],
25
+ "lora_5_model": "None",
26
+ "lora_5_weight": path_manager.default_model_names["default_lora_weight"],
27
+ "theme": "None",
28
+ "auto_negative_prompt": False,
29
+ "OBP_preset": "Standard",
30
+ "hint_chance": 25,
31
+ "clip_g": "clip_g.safetensors",
32
+ "clip_l": "clip_l.safetensors",
33
+ "clip_t5": "t5-v1_1-xxl-encoder-Q3_K_S.gguf",
34
+ }
35
+
36
+
37
+ def load_settings():
38
+ if exists("settings/settings.json"):
39
+ with open("settings/settings.json") as f:
40
+ settings = json.load(f)
41
+ else:
42
+ settings = {}
43
+
44
+ # Add any missing default settings
45
+ changed = False
46
+ for key, value in DEFAULT_SETTINGS.items():
47
+ if key not in settings:
48
+ settings[key] = value
49
+ changed = True
50
+
51
+ # Some sanity checks
52
+ if not isinstance(settings["style"], list):
53
+ settings["style"] = []
54
+
55
+ if changed:
56
+ with open("settings/settings.json", "w") as f:
57
+ json.dump(settings, f, indent=2)
58
+
59
+ return settings
60
+
61
+
62
+ default_settings = load_settings()