Moved experimental features to a backend variable

This commit is contained in:
ebolam
2022-10-13 14:16:02 -04:00
parent 4d712c1e21
commit 9bef5c1f90
6 changed files with 22 additions and 27 deletions

View File

@@ -552,6 +552,22 @@ gensettingstf = [
"classname": "system", "classname": "system",
"name": "keep_img_gen_in_memory" "name": "keep_img_gen_in_memory"
}, },
{
"UI_V2_Only": True,
"uitype": "toggle",
"unit": "bool",
"label": "Experimental Items",
"id": "experimental_features",
"min": 0,
"max": 1,
"step": 1,
"default": 0,
"tooltip": "When enabled experemental features will be shown in the UI.",
"menu_path": "Interface",
"sub_path": "UI",
"classname": "system",
"name": "experimental_features"
},
] ]
gensettingsik =[{ gensettingsik =[{

View File

@@ -1047,6 +1047,7 @@ class system_settings(settings):
self.summary_tokenizer = None self.summary_tokenizer = None
self.keep_img_gen_in_memory = False self.keep_img_gen_in_memory = False
self.cookies = {} #cookies for colab since colab's URL changes, cookies are lost self.cookies = {} #cookies for colab since colab's URL changes, cookies are lost
self.experimental_features = False
@dataclass @dataclass
class _inference_config: class _inference_config:

View File

@@ -2721,3 +2721,7 @@ input[type='range'] {
select { select {
outline: none; outline: none;
} }
[system_experimental_features="false"] {
display: none;
}

View File

@@ -2479,20 +2479,6 @@ function save_preset() {
} }
//--------------------------------------------General UI Functions------------------------------------ //--------------------------------------------General UI Functions------------------------------------
function enable_experemental_features(checked) {
if (checked) {
setCookie("enable_experemental_features", "true");
for (item of document.getElementsByClassName("experemental")) {
item.classList.remove("hidden");
}
} else {
setCookie("enable_experemental_features", "false");
for (item of document.getElementsByClassName("experemental")) {
item.classList.add("hidden");
}
}
}
function set_font_size(element) { function set_font_size(element) {
new_font_size = element.value; new_font_size = element.value;
var r = document.querySelector(':root'); var r = document.querySelector(':root');
@@ -4441,7 +4427,6 @@ function process_cookies() {
} else if (getCookie("options_on_right") == "true") { } else if (getCookie("options_on_right") == "true") {
options_on_right(true); options_on_right(true);
} }
enable_experemental_features((getCookie("enable_experemental_features", "false") == "true"));
Change_Theme(getCookie("theme", "Monochrome")); Change_Theme(getCookie("theme", "Monochrome"));

View File

@@ -295,17 +295,6 @@
<span class="setting_minlabel"><span style="position: relative;">0.1</span></span> <span class="setting_minlabel"><span style="position: relative;">0.1</span></span>
<span class="setting_maxlabel"><span style="position: relative;">2</span></span> <span class="setting_maxlabel"><span style="position: relative;">2</span></span>
</div> </div>
<div class="setting_container">
<span class="setting_label">
<span>Experimental Features: &nbsp;</span><span class="helpicon material-icons-outlined" tooltip="When enabled experemental features will be shown in the UI.">help_icon</span>
</span>
<span class="setting_item">
<input type=checkbox id="enable_experemental_features" data-size=mini data-onstyle=success data-toggle=toggle onchange="enable_experemental_features(this.checked)"/>
</span>
<!---Slider Labels--->
<span class="setting_minlabel"><span style="top: -4px; position: relative;"></span></span>
<span class="setting_maxlabel"><span style="top: -4px; position: relative;"></span></span>
</div>
</div> </div>
<div class="collapsable_header" onclick="toggle_setting_category(this);"> <div class="collapsable_header" onclick="toggle_setting_category(this);">
<h4 style="width:var(--flyout_menu_width);"><span class="material-icons-outlined cursor">expand_more</span> Formatting</h4> <h4 style="width:var(--flyout_menu_width);"><span class="material-icons-outlined cursor">expand_more</span> Formatting</h4>

View File

@@ -13,7 +13,7 @@
</div> </div>
<textarea rows=20 id="memory" class="var_sync_story_memory var_sync_alt_story_memory_length fullwidth" onchange='sync_to_server(this);' oninput="autoResize(this)" autocomplete="off"></textarea> <textarea rows=20 id="memory" class="var_sync_story_memory var_sync_alt_story_memory_length fullwidth" onchange='sync_to_server(this);' oninput="autoResize(this)" autocomplete="off"></textarea>
</div> </div>
<div id="Auto-Memory" class="hidden experemental"> <div id="Auto-Memory" class="var_sync_alt_system_experimental_features">
<h4 class="section_header"><label for="auto_memory">Auto-Memory (non-functional)</label></h4> <h4 class="section_header"><label for="auto_memory">Auto-Memory (non-functional)</label></h4>
<div class="help_text"> <div class="help_text">
What the system would use for automatic memory summarized from the game What the system would use for automatic memory summarized from the game