From 861c8d38df3fb70d6338806b8ccf1ad01ddb263f Mon Sep 17 00:00:00 2001 From: lllyasviel Date: Wed, 15 Nov 2023 01:22:37 -0800 Subject: [PATCH] 810 --- fooocus_version.py | 2 +- language/en.json | 35 +++++++++-------------------------- modules/config.py | 3 ++- modules/style_sorter.py | 2 +- update_log.md | 7 +++++++ webui.py | 10 +++++++--- 6 files changed, 27 insertions(+), 32 deletions(-) diff --git a/fooocus_version.py b/fooocus_version.py index 96bf211..d1f7ccb 100644 --- a/fooocus_version.py +++ b/fooocus_version.py @@ -1 +1 @@ -version = '2.1.809' +version = '2.1.810' diff --git a/language/en.json b/language/en.json index 9ae3986..fd40ca2 100644 --- a/language/en.json +++ b/language/en.json @@ -42,32 +42,7 @@ "Speed": "Speed", "Quality": "Quality", "Aspect Ratios": "Aspect Ratios", - "896\u00d71152": "896\u00d71152", "width \u00d7 height": "width \u00d7 height", - "704\u00d71408": "704\u00d71408", - "704\u00d71344": "704\u00d71344", - "768\u00d71344": "768\u00d71344", - "768\u00d71280": "768\u00d71280", - "832\u00d71216": "832\u00d71216", - "832\u00d71152": "832\u00d71152", - "896\u00d71088": "896\u00d71088", - "960\u00d71088": "960\u00d71088", - "960\u00d71024": "960\u00d71024", - "1024\u00d71024": "1024\u00d71024", - "1024\u00d7960": "1024\u00d7960", - "1088\u00d7960": "1088\u00d7960", - "1088\u00d7896": "1088\u00d7896", - "1152\u00d7832": "1152\u00d7832", - "1216\u00d7832": "1216\u00d7832", - "1280\u00d7768": "1280\u00d7768", - "1344\u00d7768": "1344\u00d7768", - "1344\u00d7704": "1344\u00d7704", - "1408\u00d7704": "1408\u00d7704", - "1472\u00d7704": "1472\u00d7704", - "1536\u00d7640": "1536\u00d7640", - "1600\u00d7640": "1600\u00d7640", - "1664\u00d7576": "1664\u00d7576", - "1728\u00d7576": "1728\u00d7576", "Image Number": "Image Number", "Negative Prompt": "Negative Prompt", "Describing what you do not want to see.": "Describing what you do not want to see.", @@ -385,5 +360,13 @@ "B1": "B1", "B2": "B2", "S1": "S1", - "S2": "S2" + "S2": "S2", + "Extreme Speed": "Extreme Speed", + "\uD83D\uDD0E Type here to search styles ...": "\uD83D\uDD0E Type here to search styles ...", + "Type prompt here.": "Type prompt here.", + "Outpaint Expansion Direction:": "Outpaint Expansion Direction:", + "* Powered by Fooocus Inpaint Engine (beta)": "* Powered by Fooocus Inpaint Engine (beta)", + "Fooocus Enhance": "Fooocus Enhance", + "Fooocus Cinematic": "Fooocus Cinematic", + "Fooocus Sharp": "Fooocus Sharp" } \ No newline at end of file diff --git a/modules/config.py b/modules/config.py index 8cf77d2..d64c5a4 100644 --- a/modules/config.py +++ b/modules/config.py @@ -267,7 +267,8 @@ with open(config_example_path, "w", encoding="utf-8") as json_file: json_file.write(f'You can modify your "{cpa}" using the below keys, formats, and examples.\n' f'Do not modify this file. Modifications in this file will not take effect.\n' f'This file is a tutorial and example. Please edit "{cpa}" to really change any settings.\n' - f'Remember to split the paths with "\\\\" rather than "\\".\n\n\n') + + 'Remember to split the paths with "\\\\" rather than "\\", ' + 'and there is no "," before the last "}". \n\n\n') json.dump({k: config_dict[k] for k in visited_keys}, json_file, indent=4) diff --git a/modules/style_sorter.py b/modules/style_sorter.py index 96796bb..393e441 100644 --- a/modules/style_sorter.py +++ b/modules/style_sorter.py @@ -27,7 +27,7 @@ def try_load_sorted_styles(style_names, default_selected): unselected = [y for y in all_styles if y not in default_selected] all_styles = default_selected + unselected - return all_styles + return def sort_styles(selected): diff --git a/update_log.md b/update_log.md index d2b64f9..2fdd6d0 100644 --- a/update_log.md +++ b/update_log.md @@ -1,3 +1,10 @@ +# 2.1.810 + +* Added hints to config_modification_tutorial.txt +* Removed user hacked aspect ratios in I18N english templates, but it will still be read like before. +* fix some style sorting problem again (perhaps should try Gradio 4.0 later). +* Refreshed I18N english templates with more keys. + # 2.1.809 * fix some sorting problem. diff --git a/webui.py b/webui.py index 845c8ad..6c6405c 100644 --- a/webui.py +++ b/webui.py @@ -225,20 +225,24 @@ with shared.gradio_root: gr.HTML(f'\U0001F4DA History Log') with gr.Tab(label='Style'): - initial_style_sorting = style_sorter.try_load_sorted_styles( - style_names=legal_style_names, default_selected=modules.config.default_styles) + style_sorter.try_load_sorted_styles( + style_names=legal_style_names, + default_selected=modules.config.default_styles) style_search_bar = gr.Textbox(show_label=False, container=False, placeholder="\U0001F50E Type here to search styles ...", value="", label='Search Styles') style_selections = gr.CheckboxGroup(show_label=False, container=False, - choices=initial_style_sorting, + choices=copy.deepcopy(style_sorter.all_styles), value=copy.deepcopy(modules.config.default_styles), label='Selected Styles', elem_classes=['style_selections']) gradio_receiver_style_selections = gr.Textbox(elem_id='gradio_receiver_style_selections', visible=False) + shared.gradio_root.load(lambda: gr.update(choices=copy.deepcopy(style_sorter.all_styles)), + outputs=style_selections) + style_search_bar.change(style_sorter.search_styles, inputs=[style_selections, style_search_bar], outputs=style_selections,