From 35245288da69cc184edbb84f18ec8361fe7ce645 Mon Sep 17 00:00:00 2001 From: ebolam Date: Fri, 19 Aug 2022 19:08:09 -0400 Subject: [PATCH 001/117] Abort fix for new UI --- koboldai_settings.py | 3 +++ static/koboldai.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/koboldai_settings.py b/koboldai_settings.py index 0d7cee23..c3af317f 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -707,6 +707,9 @@ class system_settings(settings): serverstarted = value if name not in self.local_only_variables and name[0] != "_" and not new_variable: process_variable_changes(self.socketio, self.__class__.__name__.replace("_settings", ""), name, value, old_value) + + if name == "aibusy" and value == False: + koboldai_vars.abort = False class KoboldStoryRegister(object): def __init__(self, socketio, story_settings, koboldai_vars, tokenizer=None, sequence=[]): diff --git a/static/koboldai.js b/static/koboldai.js index 4d9d907e..89e6878d 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -427,6 +427,9 @@ function do_ai_busy(data) { } favicon.stop_swap() document.getElementById('btnsend').textContent = "Submit"; + for (item of document.getElementsByClassName('statusbar_outer')) { + item.classList.add("hidden"); + } } } From 2fe79791721cc2feeb3ddf6d30b30ea940d04f5e Mon Sep 17 00:00:00 2001 From: ebolam Date: Fri, 19 Aug 2022 19:15:37 -0400 Subject: [PATCH 002/117] Option area partially open bug fix --- templates/index_new.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/templates/index_new.html b/templates/index_new.html index cb070376..21ee3730 100644 --- a/templates/index_new.html +++ b/templates/index_new.html @@ -39,6 +39,15 @@

Disconnected

+ +                        +                        +                        +                        +                        +                        +                        +
From d1faa4b013d79b634fa72575b1fedd6c1dac2217 Mon Sep 17 00:00:00 2001 From: ebolam Date: Fri, 19 Aug 2022 19:15:37 -0400 Subject: [PATCH 003/117] Option area partially open bug fix --- static/koboldai.js | 7 +++++++ templates/index_new.html | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/static/koboldai.js b/static/koboldai.js index 89e6878d..dd45cbba 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -74,6 +74,13 @@ function reset_story() { while (story_area.lastChild.id != 'story_prompt') { story_area.removeChild(story_area.lastChild); } + dummy_span = document.createElement("span"); + text = ""; + for (i=0;i<154;i++) { + text += "\xa0"; + } + dummy_span.textContent = text; + story_area.append(dummy_span); var option_area = document.getElementById("Select Options"); while (option_area.firstChild) { option_area.removeChild(option_area.firstChild); diff --git a/templates/index_new.html b/templates/index_new.html index cb070376..21ee3730 100644 --- a/templates/index_new.html +++ b/templates/index_new.html @@ -39,6 +39,15 @@

Disconnected

+ +                        +                        +                        +                        +                        +                        +                        +
From 06f16b9e3ea2368ea91e331c353281332d4616e8 Mon Sep 17 00:00:00 2001 From: ebolam Date: Sat, 20 Aug 2022 17:05:06 -0400 Subject: [PATCH 004/117] Update for Monochrome Theme --- themes/Monochrome.css | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/themes/Monochrome.css b/themes/Monochrome.css index 5eede915..fbd2c3b8 100644 --- a/themes/Monochrome.css +++ b/themes/Monochrome.css @@ -34,30 +34,30 @@ /*----------------Advanced Theme--------------------*/ /*General*/ - --background: #222f39; + --background: #222f3a; --gamescreen_background: #12181c; - --input_background: #111b22; + --input_background: #121b21; --text: #e0e0e0; --text_to_ai_color: #cdd9e0; --text_edit: #759bc5; - --statusbar_color: #002d6ca1; + --statusbar_color: #1a2f4da1; --statusbar_text_color: white; --scrollbar-color: #3e536780; /*Buttons*/ --enabled_button_text: #e0e0e0; - --enabled_button_background_color: #446899; - --enabled_button_border_color: #91acd4; + --enabled_button_background_color: #2f4563; + --enabled_button_border_color: #263a54; --disabled_button_text: #303030; --disabled_button_background_color: #495762; --disabled_button_border_color: #686c68; /*Sequence, AKA Gens Per Action*/ - --sequence_area_background: #161e24; - --sequence_background: #222f39; - --sequence_text: #e0e0e0; + --sequence_area_background: #121b21; + --sequence_background: #131c22; + --sequence_text: #cfd7a2; /*Side Menus*/ --tab_color: #2b5471; @@ -72,14 +72,14 @@ --sample_order_select_color_text: #e0e0e0; --dropdown_text: #cfd7a2; - --dropdown_background: #151e26; + --dropdown_background: #131c22; --rangeslider_background_color: #1f2934; --rangeslider_color: #244c65; --rangeslider_circle_color: #1b354d; --help_icon: #cfd7a2; - --help_icon_text: #282c2c; + --help_icon_text: #121b21; --tooltip_text:var(--on_secondary_palette); --tooltip_background:var(--secondary_palette); @@ -98,21 +98,21 @@ --wi_folder_background: #232328; /*Popup*/ - --popup_background_color: #1f262e; + --popup_background_color: #18222a; --popup_title_bar_color: #2b5471; --popup_title_bar_color_text: #e0e0e0; - --popup_item_color: #272f38; + --popup_item_color: #252f3a; --popup_item_color_text: #e0e0e0; - --popup_hover_color: #244c65; + --popup_hover_color: #1f4358; --popup_hover_color_text: #e0e0e0; - --popup_selected_color: #2f677f; + --popup_selected_color: #295c72; --popup_selected_color_text:var(--on_secondary_container_palette_palette); - --popup_button_color: #446899; + --popup_button_color: #406494; --popup_button_color_text: #e0e0e0; - --popup_cancel_button_color: #446899; + --popup_cancel_button_color: #406494; --popup_cancel_button_color_text: #e0e0e0; /*Parameters*/ From 5239663c42dd652757d609ef8456ee89c611a11a Mon Sep 17 00:00:00 2001 From: ebolam Date: Sat, 20 Aug 2022 21:09:15 -0400 Subject: [PATCH 005/117] Added Darkness Theme --- templates/settings flyout.html | 1 + themes/Darkness.css | 137 +++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 themes/Darkness.css diff --git a/templates/settings flyout.html b/templates/settings flyout.html index 63ef30b9..919c8752 100644 --- a/templates/settings flyout.html +++ b/templates/settings flyout.html @@ -223,6 +223,7 @@
diff --git a/themes/Darkness.css b/themes/Darkness.css new file mode 100644 index 00000000..54fb7de2 --- /dev/null +++ b/themes/Darkness.css @@ -0,0 +1,137 @@ +:root { +/*----------------Palette Theme--------------------*/--primary_palette: #afc6ff; + --on_primary_palette: #002d6c; + --primary_containter_palette: #004397; + --on_primary_containter_palette: #d9e2ff; + + --secondary_palette: #f7c5ee; + --on_secondary_palette: #5c0059; + --secondary_container_palette: #d663bd; + --on_secondary_container_palette: #4e0039; + + --tertiary_palette: #a8d473; + --on_tertiary_palette: #1f3700; + --tertiary_container_palette: #2f4f00; + --on_tertiary_container_palette: #c3f18c; + + --error_palette: #ffb4ab; + --on_error_palette: #690005; + --error_container_palette: #93000a; + --on_error_container_palette: #ffdad6; + + --background_palette: #1b1b1f; + --on_background_palette:#e3e2e6; + --layer1_palette: #181818; + --layer2_palette: #28282D; + --layer3_palette: #2F2F35; + --layer4_palette: #35353D; + --outline_palette: #8e9099; + + --middle_palette: #232328; + --on_middle_palette: #86868e; + --surface_palette: #2f2f36; + --on_surface_palette: #e3e2e6; + +/*----------------Advanced Theme--------------------*/ + /*General*/ + --background: #1c1e1f; + --gamescreen_background: #1c1e1f; + --input_background: #151717; + + --text: #e0e0e0; + --text_to_ai_color: #34c5d0; + --text_edit: #187275; + + --statusbar_color: #1a625fa1; + --statusbar_text_color: #e0e0e0; + --scrollbar-color: #1a615e7a; + + /*Buttons*/ + --enabled_button_text: #e0e0e0; + --enabled_button_background_color: #424243; + --enabled_button_border_color: #2e2e2fe8; + --disabled_button_text: #303030; + --disabled_button_background_color: #495762; + --disabled_button_border_color: #686c68; + + /*Sequence, AKA Gens Per Action*/ + --sequence_area_background: #1c1e1f; + --sequence_background: #1c1e1f; + --sequence_text: #e0e0e0; + + /*Side Menus*/ + --tab_color: #1a625f; + + --flyout_background: #1c1c1c; + --flyout_background_pinned:var(--layer1_palette); + + --setting_background: #242424; + --setting_text: #e0e0e0; + + --sample_order_select_color: #1d434a; + --sample_order_select_color_text: #e0e0e0; + + --dropdown_text: #e0e0e0; + --dropdown_background: #181818; + + --rangeslider_background_color: #1b1b1b; + --rangeslider_color: #1d434a; + --rangeslider_circle_color: #385262; + + --help_icon: #c07ec5; + --help_icon_text: #1b1b1b; + --tooltip_text:var(--on_secondary_palette); + --tooltip_background:var(--secondary_palette); + + /*World Info*/ + --wi_card_border_color: #002d6c; + --wi_card_border_color_to_ai:var(--on_secondary_palette); + + --wi_card_bg_color: #afc6ff; + --wi_card_text_color:var(--on_primary_palette); + + --wi_card_tag_bg_color: #afc6ff; + --wi_card_tag_text_color:var(--on_primary_palette); + + --wi_tag_color: #004397; + --wi_tag_text_color:var(--on_primary_containter_palette); + --wi_folder_background: #232328; + + /*Popup*/ + --popup_background_color: #151717; + --popup_title_bar_color: #1a625f; + --popup_title_bar_color_text: #e0e0e0; + + --popup_item_color: #1c1c1c; + --popup_item_color_text: #e0e0e0; + + --popup_hover_color: #1a2e30; + --popup_hover_color_text: #e0e0e0; + --popup_selected_color: #2c5357; + --popup_selected_color_text:var(--on_secondary_container_palette_palette); + + --popup_button_color: #1a625f; + --popup_button_color_text: #e0e0e0; + --popup_cancel_button_color: #1a625f; + --popup_cancel_button_color_text: #e0e0e0; + + /*Parameters*/ + --scrollbar-size: 7px; + --light_shadow_value: 0; + --left_menu_strong_shadow: 0; + --right_menu_light_shadow: 0; + --right_menu_strong_shadow: 0; + --radius_inputbox: 10px; + --radius_unpinned_menu: 20px; + --radius_sequence: 10px; + --radius_settings_background: 10px; + --radius_buttons: 5px; + --radius_item_popup: 5px; + --radius_wi_card: 5px; + + + + + + +/*----------------VARIABLES--------------------*/ \ No newline at end of file From 38118236806296ff8f6dff3157d1e0267d4f11db Mon Sep 17 00:00:00 2001 From: ebolam Date: Sat, 20 Aug 2022 22:06:38 -0400 Subject: [PATCH 006/117] WI root missing add entry button --- templates/story flyout.html | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/story flyout.html b/templates/story flyout.html index 92203986..86dd7c0f 100644 --- a/templates/story flyout.html +++ b/templates/story flyout.html @@ -65,6 +65,7 @@

root

+ post_addAdd World Info Entry
\ No newline at end of file From 0775073702740b7f5114d2434339ee8e3a39422f Mon Sep 17 00:00:00 2001 From: ebolam Date: Sun, 21 Aug 2022 10:53:02 -0400 Subject: [PATCH 007/117] Potential WI bug fix --- koboldai_settings.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/koboldai_settings.py b/koboldai_settings.py index c3af317f..43a821a6 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -283,7 +283,7 @@ class koboldai_vars(object): else: return getattr(self._story_settings['default'], name) - + z class settings(object): def to_json(self): json_data = {'file_version': 2} @@ -1277,6 +1277,11 @@ class KoboldWorldInfo(object): def load_json(self, data): self.world_info = {int(x): data['entries'][x] for x in data['entries']} self.world_info_folder = data['folders'] + #Make sure we have all the appropriate variables: + for item in self.world_info: + for column in ["uid","title","key","keysecondary","folder","constant","content","comment","token_length","selective","used_in_game"]: + if column not in item: + item[column] = None try: self.sync_world_info_to_old_format() except: From 90142d981ff34f364a49004aad6de8c3d72d7cd6 Mon Sep 17 00:00:00 2001 From: ebolam Date: Sun, 21 Aug 2022 10:55:24 -0400 Subject: [PATCH 008/117] Update for Monochrome and Darkness --- themes/Darkness.css | 14 +++++++------- themes/Monochrome.css | 34 ++++++++++------------------------ 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/themes/Darkness.css b/themes/Darkness.css index 54fb7de2..777e7421 100644 --- a/themes/Darkness.css +++ b/themes/Darkness.css @@ -84,17 +84,17 @@ --tooltip_background:var(--secondary_palette); /*World Info*/ - --wi_card_border_color: #002d6c; - --wi_card_border_color_to_ai:var(--on_secondary_palette); + --wi_card_border_color: #002d6c00; + --wi_card_border_color_to_ai: #002d6c00; - --wi_card_bg_color: #afc6ff; - --wi_card_text_color:var(--on_primary_palette); + --wi_card_bg_color: #181818; + --wi_card_text_color: #e0e0e0; - --wi_card_tag_bg_color: #afc6ff; - --wi_card_tag_text_color:var(--on_primary_palette); + --wi_card_tag_bg_color: #242424; + --wi_card_tag_text_color: #e0e0e0; --wi_tag_color: #004397; - --wi_tag_text_color:var(--on_primary_containter_palette); + --wi_tag_text_color: #e0e0e0; --wi_folder_background: #232328; /*Popup*/ diff --git a/themes/Monochrome.css b/themes/Monochrome.css index fbd2c3b8..cf350dc0 100644 --- a/themes/Monochrome.css +++ b/themes/Monochrome.css @@ -42,8 +42,8 @@ --text_to_ai_color: #cdd9e0; --text_edit: #759bc5; - --statusbar_color: #1a2f4da1; - --statusbar_text_color: white; + --statusbar_color: #3e53679e; + --statusbar_text_color: #e0e0e0; --scrollbar-color: #3e536780; /*Buttons*/ @@ -84,17 +84,17 @@ --tooltip_background:var(--secondary_palette); /*World Info*/ - --wi_card_border_color: #002d6c; - --wi_card_border_color_to_ai:var(--on_secondary_palette); + --wi_card_border_color: #eeeeeead; + --wi_card_border_color_to_ai: #eeeeeead; - --wi_card_bg_color: #afc6ff; - --wi_card_text_color:var(--on_primary_palette); + --wi_card_bg_color: #273141; + --wi_card_text_color: #e0e0e0; - --wi_card_tag_bg_color: #afc6ff; - --wi_card_tag_text_color:var(--on_primary_palette); + --wi_card_tag_bg_color: #273141; + --wi_card_tag_text_color: #e0e0e0; --wi_tag_color: #004397; - --wi_tag_text_color:var(--on_primary_containter_palette); + --wi_tag_text_color: #e0e0e0; --wi_folder_background: #232328; /*Popup*/ @@ -134,18 +134,4 @@ -/*----------------VARIABLES--------------------*/ - --flyout_menu_closed_width: 0px; - --setting_menu_closed_width_no_pins_width: 0px; - --story_options_size: 30%; - --story_pinned_areas_left: "menuicon options gamescreen lefticon" - "menuicon theme theme lefticon" - "menuicon inputrow inputrow lefticon"; - --story_pinned_areas_right: "menuicon gamescreen options lefticon" - "menuicon theme theme lefticon" - "menuicon inputrow inputrow lefticon"; - --story_pinned_area_widths_left: 30px var(--story_options_size) auto 30px; - --story_pinned_area_widths_right: 30px auto var(--story_options_size) 30px; - --story_pinned_areas: var(--story_pinned_areas_left); - --story_pinned_area_widths: var(--story_pinned_area_widths_left); -} \ No newline at end of file +/*----------------VARIABLES--------------------*/ \ No newline at end of file From 0273b35bff9140cf43cbc1e293323597e886a984 Mon Sep 17 00:00:00 2001 From: ebolam Date: Sun, 21 Aug 2022 10:57:34 -0400 Subject: [PATCH 009/117] Bug --- koboldai_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koboldai_settings.py b/koboldai_settings.py index 43a821a6..b54f615d 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -283,7 +283,7 @@ class koboldai_vars(object): else: return getattr(self._story_settings['default'], name) - z + class settings(object): def to_json(self): json_data = {'file_version': 2} From 082690acec03d4453b252fd8800c425b2a9e29a5 Mon Sep 17 00:00:00 2001 From: ebolam Date: Sun, 21 Aug 2022 11:01:25 -0400 Subject: [PATCH 010/117] Theme Fix --- themes/Darkness.css | 16 +++++++++++++++- themes/Monochrome.css | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/themes/Darkness.css b/themes/Darkness.css index 777e7421..4edff814 100644 --- a/themes/Darkness.css +++ b/themes/Darkness.css @@ -134,4 +134,18 @@ -/*----------------VARIABLES--------------------*/ \ No newline at end of file +/*----------------VARIABLES--------------------*/ + --flyout_menu_closed_width: 0px; + --setting_menu_closed_width_no_pins_width: 0px; + --story_options_size: 30%; + --story_pinned_areas_left: "menuicon options gamescreen lefticon" + "menuicon theme theme lefticon" + "menuicon inputrow inputrow lefticon"; + --story_pinned_areas_right: "menuicon gamescreen options lefticon" + "menuicon theme theme lefticon" + "menuicon inputrow inputrow lefticon"; + --story_pinned_area_widths_left: 30px var(--story_options_size) auto 30px; + --story_pinned_area_widths_right: 30px auto var(--story_options_size) 30px; + --story_pinned_areas: var(--story_pinned_areas_left); + --story_pinned_area_widths: var(--story_pinned_area_widths_left); +} \ No newline at end of file diff --git a/themes/Monochrome.css b/themes/Monochrome.css index cf350dc0..76c491ab 100644 --- a/themes/Monochrome.css +++ b/themes/Monochrome.css @@ -134,4 +134,18 @@ -/*----------------VARIABLES--------------------*/ \ No newline at end of file +/*----------------VARIABLES--------------------*/ + --flyout_menu_closed_width: 0px; + --setting_menu_closed_width_no_pins_width: 0px; + --story_options_size: 30%; + --story_pinned_areas_left: "menuicon options gamescreen lefticon" + "menuicon theme theme lefticon" + "menuicon inputrow inputrow lefticon"; + --story_pinned_areas_right: "menuicon gamescreen options lefticon" + "menuicon theme theme lefticon" + "menuicon inputrow inputrow lefticon"; + --story_pinned_area_widths_left: 30px var(--story_options_size) auto 30px; + --story_pinned_area_widths_right: 30px auto var(--story_options_size) 30px; + --story_pinned_areas: var(--story_pinned_areas_left); + --story_pinned_area_widths: var(--story_pinned_area_widths_left); +} \ No newline at end of file From 68a1182166a78fa044f663f88e6d348b8d2dc5d9 Mon Sep 17 00:00:00 2001 From: ebolam Date: Sun, 21 Aug 2022 11:07:25 -0400 Subject: [PATCH 011/117] Fix for new world info --- templates/story flyout.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/story flyout.html b/templates/story flyout.html index 86dd7c0f..976ff620 100644 --- a/templates/story flyout.html +++ b/templates/story flyout.html @@ -65,7 +65,7 @@

root

- post_addAdd World Info Entry + post_addAdd World Info Entry
\ No newline at end of file From 0a2d0b9d2c45b015753e7a01fc7d38e6f77873bf Mon Sep 17 00:00:00 2001 From: ebolam Date: Sun, 21 Aug 2022 11:15:31 -0400 Subject: [PATCH 012/117] WI Fix --- templates/story flyout.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/templates/story flyout.html b/templates/story flyout.html index 976ff620..85ef8977 100644 --- a/templates/story flyout.html +++ b/templates/story flyout.html @@ -64,8 +64,18 @@ {% endwith %}
-

root

- post_addAdd World Info Entry + +

+ expand_more + + folder + root +

+ + post_add + Add World Info Entry + +
\ No newline at end of file From d69a0b307c2c77fed6da212deacf88a266bd8c92 Mon Sep 17 00:00:00 2001 From: ebolam Date: Sun, 21 Aug 2022 14:25:47 -0400 Subject: [PATCH 013/117] Tab fixes for CSS, darkness theme update --- static/koboldai.css | 47 ++++++++++++--------------------- static/koboldai.js | 63 ++++++++++++++++++++++++--------------------- themes/Darkness.css | 6 ++--- 3 files changed, 53 insertions(+), 63 deletions(-) diff --git a/static/koboldai.css b/static/koboldai.css index bd51399f..4801e28e 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -67,11 +67,11 @@ input[type="range"]::-ms-fill-upper { list-style: none; /*margin: 200px 0 20px;*/ padding: 0; - padding-left: 30px; /*Gui: this value should change to 10px when pinned*/ + padding-left: 40px; line-height: 24px; height: 26px; overflow: hidden; - font-size: 14px; + font-size: 12px; font-family: verdana; position: relative; } @@ -87,23 +87,22 @@ input[type="range"]::-ms-fill-upper { -ms-user-select: none; /* Internet Explorer/Edge */ user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */ - border: 1px solid var(--tab_color); + border: 1px solid #888; background: var(--tab_color); - /*background: -o-linear-gradient(top, #337ab7 50%, #285070 100%); - background: -ms-linear-gradient(top, #337ab7 50%, #285070 100%); - background: -moz-linear-gradient(top, #337ab7 50%, #285070 100%); - background: -webkit-linear-gradient(top, #337ab7 50%, #285070 100%); - background: linear-gradient(top, #337ab7 50%, #285070 100%);*/ + background: -o-linear-gradient(top, #337ab70 50%, #28507 100%); + background: -ms-linear-gradient(top, #337ab70 50%, #28507 100%); + background: -moz-linear-gradient(top, #337ab70 50%, #28507 100%); + background: -webkit-linear-gradient(top, #337ab70 50%, #28507 100%); + background: linear-gradient(top, #337ab70 50%, #28507 100%); display: inline-block; position: relative; z-index: 0; - border-radius: 6px 6px 6px 6px; border-top-left-radius: 6px; border-top-right-radius: 6px; - /*box-shadow: 0 3px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 var(--tab_color);*/ + box-shadow: 0 3px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 #AAA; text-shadow: 0 1px #AAA; - margin: 0 -2px; - padding: 0 12px; + margin: 0 -5px; + padding: 0 20px; } .tabrow span.selected { background: #FFF; @@ -111,8 +110,6 @@ input[type="range"]::-ms-fill-upper { z-index: 2; border-bottom-color: #FFF; } - - .tabrow:before { position: absolute; content: " "; @@ -124,7 +121,7 @@ input[type="range"]::-ms-fill-upper { } .tabrow span:before, .tabrow span:after { - border: 1px solid var(--tab_color); + border: 1px solid #AAA; position: absolute; bottom: -1px; width: 5px; @@ -135,31 +132,19 @@ input[type="range"]::-ms-fill-upper { left: -6px; border-bottom-right-radius: 6px; border-width: 0 1px 1px 0; - box-shadow: 2px 2px 0 var(--tab_color); + box-shadow: 2px 2px 0 #D1D1D1; } .tabrow span:after { right: -6px; border-bottom-left-radius: 6px; border-width: 0 0 1px 1px; - box-shadow: -2px 2px 0 var(--tab_color); + box-shadow: -2px 2px 0 #D1D1D1; } .tabrow span.selected:before { - box-shadow: 4px 2px 0 #FFF; + box-shadow: 2px 2px 0 #FFF; } .tabrow span.selected:after { - box-shadow: -4px 2px 0 #FFF; -} -.themerow .tabrow{ - margin-top: 5px; -} -.themerow .tabrow:before { - position: absolute; - content: " "; - width: 100%; - bottom: 0; - left: 0; - border-bottom: 0px solid rgb(195, 50, 50); - z-index: 1; + box-shadow: -2px 2px 0 #FFF; } diff --git a/static/koboldai.js b/static/koboldai.js index dd45cbba..755f4953 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -49,6 +49,7 @@ map2.set(2, 'Top-p Sampling') map2.set(3, 'Tail-free Sampling') map2.set(4, 'Typical Sampling') map2.set(5, 'Temperature') +var use_word_highlighting = true; //-----------------------------------Server to UI Functions----------------------------------------------- function connect() { console.log("connected"); @@ -218,24 +219,28 @@ function do_story_text_updates(data) { while (item.firstChild) { item.removeChild(item.firstChild); } - if (data.value.action['Selected Text'] == null) { - var text_array = []; - } else { - var text_array = data.value.action['Selected Text'].split(" "); - } - text_array.forEach(function (text, i) { - if (text != "") { - var word = document.createElement("span"); - word.classList.add("rawtext"); - if (i == text_array.length) { - word.textContent = text; - } else { - word.textContent = text+" "; - } - item.append(word); + if (use_word_highlighting) { + if (data.value.action['Selected Text'] == null) { + var text_array = []; + } else { + var text_array = data.value.action['Selected Text'].split(" "); } - - }); + text_array.forEach(function (text, i) { + if (text != "") { + var word = document.createElement("span"); + word.classList.add("rawtext"); + if (i == text_array.length) { + word.textContent = text; + } else { + word.textContent = text+" "; + } + item.append(word); + } + + }); + } else { + item.textContent = data.value.action['Selected Text']; + } item.original_text = data.value.action['Selected Text']; item.setAttribute("world_info_uids", ""); item.classList.remove("pulse") @@ -274,7 +279,7 @@ function do_story_text_updates(data) { story_area.append(span); - span.scrollIntoView(); + span.scrollIntoView(false); assign_world_info_to_action(span, null); } @@ -323,7 +328,7 @@ function do_story_text_length_updates(data) { } function do_probabilities(data) { - console.log(data); + //console.log(data); if (document.getElementById('probabilities_'+data.value.id)) { prob_area = document.getElementById('probabilities_'+data.value.id) } else { @@ -595,7 +600,7 @@ function load_popup(data) { } function popup_items(data) { - console.log(data); + //console.log(data); var popup_list = document.getElementById('popup_list'); //first, let's clear out our existing data while (popup_list.firstChild) { @@ -869,7 +874,7 @@ function show_model_menu(data) { breadcrumbs.removeChild(breadcrumbs.firstChild); } //add breadcrumbs - console.log(data.breadcrumbs); + //console.log(data.breadcrumbs); for (item of data.breadcrumbs) { var button = document.createElement("button"); button.classList.add("breadcrumbitem"); @@ -1429,7 +1434,7 @@ function show_error_message(data) { //--------------------------------------------UI to Server Functions---------------------------------- function move_sample(direction) { var previous = null; - console.log(direction); + //console.log(direction); for (const [index, temp] of Array.from(document.getElementsByClassName("sample_order")).entries()) { if (temp.classList.contains("selected")) { if ((direction == 'up') && (index > 0)) { @@ -1547,7 +1552,7 @@ function send_world_info(uid) { //--------------------------------------------General UI Functions------------------------------------ function Change_Theme(theme) { - console.log(theme); + //console.log(theme); var css = document.getElementById("CSSTheme"); css.setAttribute("href", "/themes/"+theme+".css"); create_theming_elements(); @@ -1562,10 +1567,10 @@ function palette_color(item) { function getAllCSSVariableNames(styleSheets = document.styleSheets){ var cssVars = []; // loop each stylesheet - console.log(styleSheets); + //console.log(styleSheets); for(var i = 0; i < styleSheets.length; i++){ - console.log(styleSheets[i]); - console.log(styleSheets[i].ownerNode.attributes.id); + //console.log(styleSheets[i]); + //console.log(styleSheets[i].ownerNode.attributes.id); // loop stylesheet's cssRules try{ // try/catch used because 'hasOwnProperty' doesn't work for( var j = 0; j < styleSheets[i].cssRules.length; j++){ @@ -1589,13 +1594,13 @@ function getAllCSSVariableNames(styleSheets = document.styleSheets){ } function create_theming_elements() { - console.log("Running theme editor"); + //console.log("Running theme editor"); var cssVars = getAllCSSVariableNames(); palette_table = document.createElement("table"); advanced_table = document.createElement("table"); theme_area = document.getElementById("Palette"); theme_area.append(palette_table); - console.log(cssVars); + //console.log(cssVars); //theme_area.append(advanced_table); for (css_item of cssVars) { if (css_item[0].includes("_palette")) { @@ -1699,7 +1704,7 @@ function preserve_game_space(preserve) { function options_on_right(data) { var r = document.querySelector(':root'); - console.log("Setting cookie to: "+data); + //console.log("Setting cookie to: "+data); if (data) { setCookie("options_on_right", "true"); r.style.setProperty('--story_pinned_areas', 'var(--story_pinned_areas_right)'); diff --git a/themes/Darkness.css b/themes/Darkness.css index 4edff814..a4e2336b 100644 --- a/themes/Darkness.css +++ b/themes/Darkness.css @@ -62,7 +62,7 @@ /*Side Menus*/ --tab_color: #1a625f; - --flyout_background: #1c1c1c; + --flyout_background: #181818; --flyout_background_pinned:var(--layer1_palette); --setting_background: #242424; @@ -87,7 +87,7 @@ --wi_card_border_color: #002d6c00; --wi_card_border_color_to_ai: #002d6c00; - --wi_card_bg_color: #181818; + --wi_card_bg_color: #1c1c1c; --wi_card_text_color: #e0e0e0; --wi_card_tag_bg_color: #242424; @@ -127,7 +127,7 @@ --radius_settings_background: 10px; --radius_buttons: 5px; --radius_item_popup: 5px; - --radius_wi_card: 5px; + --radius_wi_card: 10px; From 60f10a2b782cf2b9c1352f2961af7191ed0a6feb Mon Sep 17 00:00:00 2001 From: ebolam Date: Sun, 21 Aug 2022 14:54:16 -0400 Subject: [PATCH 014/117] WI delete bug fix --- koboldai_settings.py | 5 ++++- static/koboldai.css | 12 +++++++++++- static/koboldai.js | 11 ++++++++--- templates/settings flyout.html | 6 ++++-- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/koboldai_settings.py b/koboldai_settings.py index b54f615d..47621523 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -111,7 +111,10 @@ class koboldai_vars(object): def calc_ai_text(self, submitted_text=""): token_budget = self.max_length used_world_info = [] - used_tokens = self.sp_length + if self.tokenizer is None: + used_tokens = 99999999999999999999999 + else: + used_tokens = self.sp_length text = "" self.worldinfo_v2.reset_used_in_game() diff --git a/static/koboldai.css b/static/koboldai.css index 4801e28e..cc6b33c2 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -182,7 +182,7 @@ input[type="range"]::-ms-fill-upper { grid-template-areas: "label value" "item item" "minlabel maxlabel"; - grid-template-rows: 20px 20px 20px; + grid-template-rows: 20px 23px 20px; grid-template-columns: 147px 30px; row-gap: 0.2em; background-color: var(--setting_background); @@ -366,6 +366,10 @@ input[type="range"]::-ms-fill-upper { margin: 25px 0 0 10px; } +.Model_Icon{ + text-align: center; +} + #model_title{ font-size: x-large; text-align: center; @@ -382,10 +386,12 @@ input[type="range"]::-ms-fill-upper { position: relative; } +/* .story_title_area .var_sync_story_story_name { border-bottom: 1px solid; padding-bottom: 3px; } +*/ .story_title_area .var_sync_story_story_name[contenteditable="true"]:active, .story_title_area .var_sync_story_story_name[contenteditable="true"]:focus{ @@ -399,6 +405,10 @@ input[type="range"]::-ms-fill-upper { .story_title { font-size: x-large; text-align: center; + border-bottom: 1px; + border-bottom-style: solid; + margin-left: 40px; + margin-right: 40px; } #text_storyname{ font-size: small; diff --git a/static/koboldai.js b/static/koboldai.js index 755f4953..b8a90272 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -1195,7 +1195,11 @@ function world_info_entry(data) { delete_icon.setAttribute("title", data.title); delete_icon.onclick = function () { if (confirm("This will delete world info "+this.getAttribute("title"))) { - socket.emit("delete_world_info", this.getAttribute("uid")); + if (this.getAttribute("uid") == "-1") { + this.parentElement.parentElement.remove(); + } else { + socket.emit("delete_world_info", this.getAttribute("uid")); + } } } tags = world_info_card.querySelector('#world_info_tags_'); @@ -1280,7 +1284,7 @@ function world_info_entry(data) { assign_world_info_to_action(null, data.uid); update_token_lengths(); - + return world_info_card; } function world_info_folder(data) { @@ -1943,7 +1947,8 @@ function create_new_wi_entry(folder) { "token_length": 0, "selective": false }; - world_info_entry(data); + card = world_info_entry(data); + card.scrollIntoView(false); } function hide_wi_folder(folder) { diff --git a/templates/settings flyout.html b/templates/settings flyout.html index 919c8752..1082b2bd 100644 --- a/templates/settings flyout.html +++ b/templates/settings flyout.html @@ -44,8 +44,10 @@
Running Model:
-
- +
+ folder_open +
+
From b6bf5416d5536ddbaaa943da145bf8450a588c02 Mon Sep 17 00:00:00 2001 From: somebody Date: Sun, 21 Aug 2022 14:44:05 -0500 Subject: [PATCH 015/117] Add help info --- static/koboldai.css | 22 ++++++++++++++++++++++ templates/settings flyout.html | 3 +++ templates/story flyout.html | 20 ++++++++++++++++++-- 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/static/koboldai.css b/static/koboldai.css index bd51399f..099a2e89 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -1547,3 +1547,25 @@ h2 .material-icons-outlined { .flyout_menu_contents { scrollbar-width: thin; } + +.section_header, .help_text { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.section_header { + margin-left: 2px; + margin-bottom: 4px; +} + +.help_text { + margin-left: 6px; + margin-bottom: 0.7em; + opacity: 0.7; + font-size: 0.9em; + display: block; +} \ No newline at end of file diff --git a/templates/settings flyout.html b/templates/settings flyout.html index 919c8752..c502243e 100644 --- a/templates/settings flyout.html +++ b/templates/settings flyout.html @@ -98,6 +98,7 @@

expand_more Sampling

+ Change how the AI decides what to say.
@@ -134,6 +135,7 @@

expand_more Repetition

+ Change how the AI combats repetition.
{% with sub_path='Repetition' %} {% include 'settings item.html' %} @@ -175,6 +177,7 @@

expand_more Biasing

+ Influence the likelyhood for the AI to output certain phrases.
Phrase
diff --git a/templates/story flyout.html b/templates/story flyout.html index 92203986..a13c609a 100644 --- a/templates/story flyout.html +++ b/templates/story flyout.html @@ -29,12 +29,20 @@
From f9041b9e0f93aa959b171a223f6fc4a75f397e7f Mon Sep 17 00:00:00 2001 From: ebolam Date: Tue, 23 Aug 2022 13:39:22 -0400 Subject: [PATCH 037/117] Fix for WI area padding and New WI entry button --- static/koboldai.css | 8 +++---- static/koboldai.js | 3 ++- templates/story flyout.html | 48 ++++++++++++++++++------------------- 3 files changed, 28 insertions(+), 31 deletions(-) diff --git a/static/koboldai.css b/static/koboldai.css index 0d34a1a2..6da017d1 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -177,6 +177,8 @@ input[type="range"]::-ms-fill-upper { width: 100%; } + + .setting_container { display: grid; grid-template-areas: "label value" @@ -676,11 +678,7 @@ td.server_vars { white-space: pre-wrap; } -.story_category_area{ - margin-top: 10px; -} - -.story_category_area{ +.story_category_area:not(#story_menu_wi){ margin: 10px 10px 0 10px; } diff --git a/static/koboldai.js b/static/koboldai.js index c1ebdfbc..c9f008f1 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -2175,7 +2175,8 @@ function create_new_wi_entry(folder) { "content": "", "comment": "", "token_length": 0, - "selective": false + "selective": false, + "wpp": {'name': "", 'type': "", 'attributes': {}} }; card = world_info_entry(data); card.scrollIntoView(false); diff --git a/templates/story flyout.html b/templates/story flyout.html index 7ddce4a4..c50e40ba 100644 --- a/templates/story flyout.html +++ b/templates/story flyout.html @@ -67,33 +67,31 @@
From fcbf3fef77c5347a21fb0d2efd7ae226c08df8f1 Mon Sep 17 00:00:00 2001 From: ebolam Date: Tue, 23 Aug 2022 15:29:29 -0400 Subject: [PATCH 038/117] Working W++/SBF for World Info --- aiserver.py | 13 +++---- koboldai_settings.py | 38 ++++++++++++++++++--- static/koboldai.js | 74 +++++++++++++++++++++++++--------------- templates/templates.html | 5 +++ 4 files changed, 90 insertions(+), 40 deletions(-) diff --git a/aiserver.py b/aiserver.py index b9334ff1..1ee492e4 100644 --- a/aiserver.py +++ b/aiserver.py @@ -7240,21 +7240,18 @@ def UI_2_Rename_World_Info_Folder(data): def UI_2_edit_world_info(data): print("edit_world_info") print(data) - if 'wpp' not in data: - wpp = {'name': "", 'type': "", 'attributes': {}} - else: - wpp = data['wpp'] + if data['uid'] == -1: koboldai_vars.worldinfo_v2.add_item(data['title'], data['key'], data['keysecondary'], data['folder'], - data['constant'], data['content'], - data['comment'], wpp=wpp) + data['constant'], data['manual_text'], + data['comment'], wpp=data['wpp'], use_wpp=data['use_wpp']) emit("delete_new_world_info_entry", {}) else: koboldai_vars.worldinfo_v2.edit_item(data['uid'], data['title'], data['key'], data['keysecondary'], data['folder'], - data['constant'], data['content'], - data['comment'], wpp=wpp) + data['constant'], data['manual_text'], + data['comment'], wpp=data['wpp'], use_wpp=data['use_wpp']) #==================================================================# diff --git a/koboldai_settings.py b/koboldai_settings.py index a94562f8..5ee9d3c4 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -1166,11 +1166,24 @@ class KoboldWorldInfo(object): self.sync_world_info_to_old_format() self.socketio.emit("world_info_folder", {x: self.world_info_folder[x] for x in self.world_info_folder}, broadcast=True, room="UI_2") - def add_item(self, title, key, keysecondary, folder, constant, content, comment, wpp={'name': "", 'type': "", 'attributes': {}}): + def add_item(self, title, key, keysecondary, folder, constant, manual_text, comment, use_wpp=False, wpp={'name': "", 'type': "", 'format': "W++", 'attributes': {}}): if len(self.world_info) == 0: uid = 0 else: uid = max(self.world_info)+1 + if use_wpp: + if wpp['format'] == "W++": + content = '[{}("{}")\n{{\n'.format(wpp['type'], wpp['name']) + for attribute in wpp['attributes']: + content = "{}{}({})\n".format(content, attribute, " + ".join(['"{}"'.format(x) for x in wpp['attributes'][attribute]])) + content = "{}}}]".format(content) + else: + content = '[ {}: "{}";'.format(wpp['type'], wpp['name']) + for attribute in wpp['attributes']: + content = "{} {}: {};".format(content, attribute, ", ".join(['"{}"'.format(x) for x in wpp['attributes'][attribute]])) + content = "{} ]".format(content[:-1]) + else: + content = manual_text if self.tokenizer is not None: token_length = len(self.tokenizer.encode(content)) else: @@ -1194,12 +1207,14 @@ class KoboldWorldInfo(object): "keysecondary": keysecondary, "folder": folder, "constant": constant, + 'manual_text': manual_text, "content": content, "comment": comment, "token_length": token_length, "selective": len(keysecondary) > 0, "used_in_game": constant, - 'wpp': wpp + 'wpp': wpp, + 'use_wpp': use_wpp } except: print("Error:") @@ -1216,11 +1231,24 @@ class KoboldWorldInfo(object): self.socketio.emit("world_info_entry", self.world_info[uid], broadcast=True, room="UI_2") ignore = self.koboldai_vars.calc_ai_text() - def edit_item(self, uid, title, key, keysecondary, folder, constant, content, comment, before=None, wpp={'name': "", 'type': "", 'attributes': {}}): + def edit_item(self, uid, title, key, keysecondary, folder, constant, manual_text, comment, use_wpp=False, before=None, wpp={'name': "", 'type': "", 'format': "W++", 'attributes': {}}): old_folder = self.world_info[uid]['folder'] #move the world info entry if the folder changed or if there is a new order requested if old_folder != folder or before is not None: self.add_item_to_folder(uid, folder, before=before) + if use_wpp: + if wpp['format'] == "W++": + content = '[{}("{}")\n{{\n'.format(wpp['type'], wpp['name']) + for attribute in wpp['attributes']: + content = "{}{}({})\n".format(content, attribute, " + ".join(['"{}"'.format(x) for x in wpp['attributes'][attribute]])) + content = "{}}}]".format(content) + else: + content = '[ {}: "{}";'.format(wpp['type'], wpp['name']) + for attribute in wpp['attributes']: + content = "{} {}: {};".format(content, attribute, ", ".join(['"{}"'.format(x) for x in wpp['attributes'][attribute]])) + content = "{} ]".format(content[:-1]) + else: + content = manual_text if self.tokenizer is not None: token_length = len(self.tokenizer.encode(content)) else: @@ -1234,12 +1262,14 @@ class KoboldWorldInfo(object): "keysecondary": keysecondary, "folder": folder, "constant": constant, + 'manual_text': manual_text, "content": content, "comment": comment, "token_length": token_length, "selective": len(keysecondary) > 0, "used_in_game": constant, - 'wpp': wpp + 'wpp': wpp, + 'use_wpp': use_wpp } self.story_settings.gamesaved = False diff --git a/static/koboldai.js b/static/koboldai.js index c9f008f1..3c75764c 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -1264,7 +1264,7 @@ function world_info_entry(data) { wpp_toggle.id = "world_info_wpp_toggle_"+data.uid; wpp_toggle.setAttribute("type", "checkbox"); wpp_toggle.setAttribute("uid", data.uid); - wpp_toggle.checked = ((data.wpp.type != "")); + wpp_toggle.checked = data.use_wpp; wpp_toggle.setAttribute("data-size", "mini"); wpp_toggle.setAttribute("data-onstyle", "success"); wpp_toggle.setAttribute("data-toggle", "toggle"); @@ -1276,7 +1276,9 @@ function world_info_entry(data) { document.getElementById("world_info_wpp_area_"+this.getAttribute('uid')).classList.add("hidden"); document.getElementById("world_info_basic_text_"+this.getAttribute('uid')).classList.remove("hidden"); } - //send_world_info(this.getAttribute('uid')); + + world_info_data[this.getAttribute('uid')]['use_wpp'] = this.checked; + send_world_info(this.getAttribute('uid')); this.classList.add("pulse"); } wpp_toggle_area.append(wpp_toggle); @@ -1284,13 +1286,25 @@ function world_info_entry(data) { world_info_wpp_area = world_info_card.querySelector('#world_info_wpp_area_'); world_info_wpp_area.id = "world_info_wpp_area_"+data.uid; world_info_wpp_area.setAttribute("uid", data.uid); + wpp_format = world_info_card.querySelector('#wpp_format_'); + wpp_format.id = "wpp_format_"+data.uid; + wpp_format.setAttribute("uid", data.uid); + wpp_format.setAttribute("data_type", "format"); + wpp_format.onchange = function () { + do_wpp(this.parentElement); + } + console.log(data.wpp['format']); + console.log(data.wpp); + if (data.wpp.format == "W++") { + wpp_format.selectedIndex = 0; + } else { + wpp_format.selectedIndex = 1; + } wpp_type = world_info_card.querySelector('#wpp_type_'); wpp_type.id = "wpp_type_"+data.uid; wpp_type.setAttribute("uid", data.uid); wpp_type.setAttribute("data_type", "type"); - if ("wpp" in data) { - wpp_type.value = data.wpp.type; - } + wpp_type.value = data.wpp.type; wpp_name = world_info_card.querySelector('#wpp_name_'); wpp_name.id = "wpp_name_"+data.uid; wpp_name.setAttribute("uid", data.uid); @@ -1299,11 +1313,11 @@ function world_info_entry(data) { wpp_name.value = data.wpp.name; } if ('attributes' in data.wpp) { - for (const [attribute, value] of Object.entries(data.wpp.attributes)) { + for (const [attribute, values] of Object.entries(data.wpp.attributes)) { if (attribute != '') { attribute_area = document.createElement("div"); label = document.createElement("span"); - label.textContent = "Attribute: "; + label.textContent = "\xa0\xa0\xa0\xa0Attribute: "; attribute_area.append(label); input = document.createElement("input"); input.value = attribute; @@ -1313,10 +1327,10 @@ function world_info_entry(data) { input.onchange = function() {do_wpp(this.parentElement.parentElement)}; attribute_area.append(input); world_info_wpp_area.append(attribute_area); - for (value of value) { + for (value of values) { value_area = document.createElement("div"); label = document.createElement("span"); - label.textContent = " Value: "; + label.textContent = "\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0Value: "; value_area.append(label); input = document.createElement("input"); input.type = "text"; @@ -1329,7 +1343,7 @@ function world_info_entry(data) { } value_area = document.createElement("div"); label = document.createElement("span"); - label.textContent = " Value: "; + label.textContent = "\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0Value: "; value_area.append(label); input = document.createElement("input"); input.type = "text"; @@ -1343,7 +1357,7 @@ function world_info_entry(data) { } attribute_area = document.createElement("div"); label = document.createElement("span"); - label.textContent = "Attribute: "; + label.textContent = "\xa0\xa0\xa0\xa0Attribute: "; attribute_area.append(label); input = document.createElement("input"); input.value = ""; @@ -1359,18 +1373,18 @@ function world_info_entry(data) { //regular data content_area = world_info_card.querySelector('#world_info_basic_text_'); content_area.id = "world_info_basic_text_"+data.uid; - content = world_info_card.querySelector('#world_info_entry_text_'); - content.id = "world_info_entry_text_"+data.uid; - content.setAttribute("uid", data.uid); - content.value = data.content; - content.onchange = function () { - world_info_data[this.getAttribute('uid')]['content'] = this.value; + manual_text = world_info_card.querySelector('#world_info_entry_text_'); + manual_text.id = "world_info_entry_text_"+data.uid; + manual_text.setAttribute("uid", data.uid); + manual_text.value = data.manual_text; + manual_text.onchange = function () { + world_info_data[this.getAttribute('uid')]['manual_text'] = this.value; send_world_info(this.getAttribute('uid')); this.classList.add("pulse"); } comment = world_info_card.querySelector('#world_info_comment_'); comment.id = "world_info_comment_"+data.uid; - content.setAttribute("uid", data.uid); + comment.setAttribute("uid", data.uid); comment.value = data.comment; comment.onchange = function () { world_info_data[this.getAttribute('uid')]['comment'] = this.textContent; @@ -1432,12 +1446,12 @@ function world_info_entry(data) { $('#world_info_wpp_toggle_'+data.uid).bootstrapToggle(); //hide/unhide w++ - if (data.wpp.type != "") { - world_info_wpp_area.classList.remove("hidden"); - content_area.classList.add("hidden"); + if (wpp_toggle.checked) { + document.getElementById("world_info_wpp_area_"+wpp_toggle.getAttribute('uid')).classList.remove("hidden"); + document.getElementById("world_info_basic_text_"+wpp_toggle.getAttribute('uid')).classList.add("hidden"); } else { - world_info_wpp_area.classList.add("hidden"); - content_area.classList.remove("hidden"); + document.getElementById("world_info_wpp_area_"+wpp_toggle.getAttribute('uid')).classList.add("hidden"); + document.getElementById("world_info_basic_text_"+wpp_toggle.getAttribute('uid')).classList.remove("hidden"); } assign_world_info_to_action(null, data.uid); @@ -1599,6 +1613,7 @@ function do_wpp(wpp_area) { wpp['attributes'] = {}; uid = wpp_area.getAttribute("uid"); attribute = ""; + wpp['format'] = document.getElementById("wpp_format_"+uid).value; for (input of wpp_area.querySelectorAll('input')) { if (input.getAttribute("data_type") == "name") { wpp['name'] = input.value; @@ -1606,13 +1621,14 @@ function do_wpp(wpp_area) { wpp['type'] = input.value; } else if (input.getAttribute("data_type") == "attribute") { attribute = input.value; - if (!(input.value in wpp['attributes'])) { - console.log("adding attribute"); + if (!(input.value in wpp['attributes']) && (input.value != "")) { wpp['attributes'][input.value] = []; } - } else if (input.getAttribute("data_type") == "value") { - wpp['attributes'][attribute].push(input.value); + } else if ((input.getAttribute("data_type") == "value") && (attribute != "")) { + if (input.value != "") { + wpp['attributes'][attribute].push(input.value); + } } } world_info_data[uid]['wpp'] = wpp; @@ -2173,10 +2189,12 @@ function create_new_wi_entry(folder) { "folder": folder, "constant": false, "content": "", + "manual_text": "", "comment": "", "token_length": 0, "selective": false, - "wpp": {'name': "", 'type': "", 'attributes': {}} + "wpp": {'name': "", 'type': "", 'format': 'W++', 'attributes': {}}, + 'use_wpp': false, }; card = world_info_entry(data); card.scrollIntoView(false); diff --git a/templates/templates.html b/templates/templates.html index dac6063b..1498fe8f 100644 --- a/templates/templates.html +++ b/templates/templates.html @@ -16,6 +16,11 @@ Use W++
From 29b91e238dcddd905c1e697389b43a446b3148ef Mon Sep 17 00:00:00 2001 From: somebody Date: Wed, 24 Aug 2022 17:18:07 -0500 Subject: [PATCH 058/117] Fix sampler underflow --- static/koboldai.css | 2 +- templates/settings flyout.html | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/static/koboldai.css b/static/koboldai.css index b6cdbb56..ba270ff6 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -202,7 +202,7 @@ input[type="range"]::-ms-fill-upper { display: grid; grid-template-areas: "label" "item"; - grid-template-rows: 20px 110px; + grid-template-rows: 20px auto; grid-template-columns: 167px; row-gap: 0.2em; background-color: var(--setting_background); diff --git a/templates/settings flyout.html b/templates/settings flyout.html index 5b8b62ee..c58e0211 100644 --- a/templates/settings flyout.html +++ b/templates/settings flyout.html @@ -128,9 +128,6 @@
- - -
{% with sub_path='Sampling' %} {% include 'settings item.html' %} From 137ed9c6667738e6dc1067452932010b0919d2e8 Mon Sep 17 00:00:00 2001 From: somebody Date: Wed, 24 Aug 2022 17:18:37 -0500 Subject: [PATCH 059/117] Fix token bar thingey not showing when worldinfo had overflow --- static/koboldai.css | 1 + 1 file changed, 1 insertion(+) diff --git a/static/koboldai.css b/static/koboldai.css index ba270ff6..763735ca 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -715,6 +715,7 @@ td.server_vars { padding-left: 20px; padding-right: 35px; margin-bottom: 10px; + flex-shrink: 0; } .token_breakdown div { From 64a915ac3e8be5f005ccfed4e882e73a4f0b86c2 Mon Sep 17 00:00:00 2001 From: ebolam Date: Wed, 24 Aug 2022 18:33:05 -0400 Subject: [PATCH 060/117] Author's note length fix --- koboldai_settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koboldai_settings.py b/koboldai_settings.py index e74ee503..e0792f54 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -571,10 +571,10 @@ class story_settings(settings): if name == 'tokenizer' and not new_variable: self.memory_length = len(self.tokenizer.encode(self.memory)) self.prompt_length = len(self.tokenizer.encode(self.prompt)) - self.authornote_length = len(self.tokenizer.encode(self.authornotetemplate.replace("<|>", self.authornote))) + self.authornote_length = 0 if self.authornote="" else len(self.tokenizer.encode(self.authornotetemplate.replace("<|>", self.authornote))) ignore = self.koboldai_vars.calc_ai_text() elif name == 'authornote' or name == 'authornotetemplate': - self.authornote_length = len(self.tokenizer.encode(self.authornotetemplate.replace("<|>", self.authornote))) + self.authornote_length = 0 if self.authornote="" else len(self.tokenizer.encode(self.authornotetemplate.replace("<|>", self.authornote))) ignore = self.koboldai_vars.calc_ai_text() elif name == 'memory': self.memory_length = len(self.tokenizer.encode(self.memory)) From 8f0933d4d7238563ebceb97e24614a355876df0c Mon Sep 17 00:00:00 2001 From: ebolam Date: Wed, 24 Aug 2022 18:44:15 -0400 Subject: [PATCH 061/117] Fix --- koboldai_settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koboldai_settings.py b/koboldai_settings.py index e0792f54..51c6a0f8 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -571,10 +571,10 @@ class story_settings(settings): if name == 'tokenizer' and not new_variable: self.memory_length = len(self.tokenizer.encode(self.memory)) self.prompt_length = len(self.tokenizer.encode(self.prompt)) - self.authornote_length = 0 if self.authornote="" else len(self.tokenizer.encode(self.authornotetemplate.replace("<|>", self.authornote))) + self.authornote_length = 0 if self.authornote=="" else len(self.tokenizer.encode(self.authornotetemplate.replace("<|>", self.authornote))) ignore = self.koboldai_vars.calc_ai_text() elif name == 'authornote' or name == 'authornotetemplate': - self.authornote_length = 0 if self.authornote="" else len(self.tokenizer.encode(self.authornotetemplate.replace("<|>", self.authornote))) + self.authornote_length = 0 if self.authornote=="" else len(self.tokenizer.encode(self.authornotetemplate.replace("<|>", self.authornote))) ignore = self.koboldai_vars.calc_ai_text() elif name == 'memory': self.memory_length = len(self.tokenizer.encode(self.memory)) From c28401c9e95ee4ea38a54997c77e857c14956325 Mon Sep 17 00:00:00 2001 From: GuiAworld Date: Wed, 24 Aug 2022 23:44:06 -0300 Subject: [PATCH 062/117] A bunch of tweaks --- static/koboldai.css | 76 ++++++++++++++++++++++++++++++---- templates/settings flyout.html | 32 +++++++------- themes/Material You.css | 2 + 3 files changed, 86 insertions(+), 24 deletions(-) diff --git a/static/koboldai.css b/static/koboldai.css index fb456ab8..cd295f01 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -76,7 +76,7 @@ input[type="range"]::-ms-fill-upper { position: relative; } .tabrow.nomenu_icon { - padding-left: 10px; + padding-left: 25px; } .tabrow span { cursor: pointer; @@ -89,11 +89,11 @@ input[type="range"]::-ms-fill-upper { supported by Chrome, Edge, Opera and Firefox */ border: 1px solid #888; background: var(--tab_color); - background: -o-linear-gradient(top, #337ab70 50%, #28507 100%); + /*background: -o-linear-gradient(top, #337ab70 50%, #28507 100%); background: -ms-linear-gradient(top, #337ab70 50%, #28507 100%); background: -moz-linear-gradient(top, #337ab70 50%, #28507 100%); background: -webkit-linear-gradient(top, #337ab70 50%, #28507 100%); - background: linear-gradient(top, #337ab70 50%, #28507 100%); + background: linear-gradient(top, #337ab70 50%, #28507 100%);*/ display: inline-block; position: relative; z-index: 0; @@ -102,7 +102,7 @@ input[type="range"]::-ms-fill-upper { box-shadow: 0 3px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 #AAA; text-shadow: 0 1px #AAA; margin: 0 -5px; - padding: 0 20px; + padding: 0 17px; } .tabrow span.selected { background: #FFF; @@ -203,7 +203,7 @@ input[type="range"]::-ms-fill-upper { grid-template-areas: "label" "item"; grid-template-rows: 20px auto; - grid-template-columns: 167px; + grid-template-columns: 177px; row-gap: 0.2em; background-color: var(--setting_background); color: var(--text); @@ -269,6 +269,8 @@ input[type="range"]::-ms-fill-upper { .setting_item_input { width:95%; } + + /*-----------------------------------------------*/ .helpicon { color: var(--help_icon); @@ -349,7 +351,7 @@ input[type="range"]::-ms-fill-upper { top: 0; left: 0; background-color: var(--flyout_background_pinned); - box-shadow: var(--light_shadow_value); + box-shadow: var(--left_menu_light_shadow); overflow-x: hidden; transition: 0.5s; border-radius: 0px; @@ -585,6 +587,58 @@ input[type="range"]::-ms-fill-upper { font-size: small; } +/* Theme */ + +.collapsable_header .material-icons-outlined { + padding-top: 5px; +} + +.var_sync_system_theme_list{ + padding: 6px 0 9px 0; + margin-left: 5px; + border-radius: 5px; + color: var(--dropdown_text); + background: var(--dropdown_background); +} + +#palette_area { + width: 100%; + text-align: center; +} + +#save_theme_area { + width: 100%; +} + +#save_theme_name { + width: 88%; + margin: 0 0 5px -25px; +} + +#palette_area .material-icons-outlined { + position: absolute; +} + +#Palette { + width: 100%; +} +#Palette_Table{ + width: 100%; +} + +.Theme_Input { + width: 100%; +} + +.advanced_theme { + margin: 10px 10px 0 auto; + padding: 2px 4px 2px 4px; + border-radius: var(--radius_wi_card); + background-color: var(--wi_tag_color); +} +.advanced_theme:hover { + filter: brightness(85%); +} /*----------------RIGHT FLYOUT MENU------------------*/ .right_menu_icon { @@ -617,7 +671,7 @@ input[type="range"]::-ms-fill-upper { overflow-x: hidden; overflow-y: hidden; transition: 0.5s; - padding-top: 35px; + padding-top: 8px; border-radius: var(--radius_unpinned_menu) 0px 0px var(--radius_unpinned_menu); } @@ -699,6 +753,10 @@ td.server_vars { scrollbar-color: var(--scrollbar-color); } +#story_menu_wi{ + margin-top: 10px; +} + .story_category_area { padding-bottom: 10px; overflow-y: scroll; @@ -1203,7 +1261,7 @@ body { width: 80%; height: 80vh; border-radius: 15px; - box-shadow: 0 0 35px 20px#1b1b1f; + box-shadow: var(--popup_shadow); background-color: var(--popup_background_color); display: flex; flex-direction: column; @@ -1220,7 +1278,7 @@ body { width: 50%; height: 80vh; border-radius: 15px; - box-shadow: 0 0 35px 20px#1b1b1f; + box-shadow: var(--popup_shadow); background-color: var(--popup_background_color); display: flex; flex-direction: column; diff --git a/templates/settings flyout.html b/templates/settings flyout.html index c58e0211..5c99cf96 100644 --- a/templates/settings flyout.html +++ b/templates/settings flyout.html @@ -238,27 +238,29 @@

expand_more Theme

- autorenew

navigate_next Palette

-