Skip to content

Commit

Permalink
rename functions for backwards compat
Browse files Browse the repository at this point in the history
  • Loading branch information
ljleb committed Sep 6, 2023
1 parent 77960a9 commit e629788
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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):
Expand All @@ -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)

Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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 = [
Expand Down

0 comments on commit e629788

Please sign in to comment.