From e62978876436155110e97352931fabb2768937f3 Mon Sep 17 00:00:00 2001 From: ljleb Date: Wed, 6 Sep 2023 18:38:40 -0400 Subject: [PATCH] rename functions for backwards compat --- modules/ui.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/ui.py b/modules/ui.py index 9d9949a604b..ff6742e3d55 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -151,7 +151,7 @@ def connect_clear_prompt(button): ) -def update_positive_token_counter(text, steps): +def update_token_counter(text, steps): try: text, _ = extra_networks.parse_prompt(text) _, prompt_flat_list, _ = prompt_parser.get_multicond_prompt_list([text]) @@ -161,7 +161,7 @@ def update_positive_token_counter(text, steps): # messages related to it in console prompt_flat_list = [text] - return update_token_counter(prompt_flat_list, steps) + return get_token_counter_html(prompt_flat_list, steps) def update_negative_token_counter(text, steps): @@ -173,10 +173,10 @@ def update_negative_token_counter(text, steps): # messages related to it in console pass - return update_token_counter([text], steps) + return get_token_counter_html([text], steps) -def update_token_counter(prompt_flat_list, steps): +def get_token_counter_html(prompt_flat_list, steps): try: prompt_schedules = prompt_parser.get_learned_conditioning_prompt_schedules(prompt_flat_list, steps) @@ -554,7 +554,7 @@ def create_ui(): height, ] - toprow.token_button.click(fn=wrap_queued_call(update_positive_token_counter), inputs=[toprow.prompt, steps], outputs=[toprow.token_counter]) + toprow.token_button.click(fn=wrap_queued_call(update_token_counter), inputs=[toprow.prompt, steps], outputs=[toprow.token_counter]) toprow.negative_token_button.click(fn=wrap_queued_call(update_negative_token_counter), inputs=[toprow.negative_prompt, steps], outputs=[toprow.negative_token_counter]) extra_networks_ui = ui_extra_networks.create_ui(txt2img_interface, [txt2img_generation_tab], 'txt2img') @@ -885,7 +885,7 @@ def select_img2img_tab(tab): **interrogate_args, ) - toprow.token_button.click(fn=update_positive_token_counter, inputs=[toprow.prompt, steps], outputs=[toprow.token_counter]) + toprow.token_button.click(fn=update_token_counter, inputs=[toprow.prompt, steps], outputs=[toprow.token_counter]) toprow.negative_token_button.click(fn=wrap_queued_call(update_negative_token_counter), inputs=[toprow.negative_prompt, steps], outputs=[toprow.negative_token_counter]) img2img_paste_fields = [