diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-01-29 22:03:31 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-01-29 22:03:31 +0000 |
commit | 399720dac2543fb4cdbe1022ec1a01f2411b81e2 (patch) | |
tree | 9e5b1268765094626dc707f5d82fc516cbdc5045 /modules/generation_parameters_copypaste.py | |
parent | f91068f426a359942d13bf7ec15b56562141b8d7 (diff) | |
download | stable-diffusion-webui-gfx803-399720dac2543fb4cdbe1022ec1a01f2411b81e2.tar.gz stable-diffusion-webui-gfx803-399720dac2543fb4cdbe1022ec1a01f2411b81e2.tar.bz2 stable-diffusion-webui-gfx803-399720dac2543fb4cdbe1022ec1a01f2411b81e2.zip |
update prompt token counts after using the paste params button
Diffstat (limited to 'modules/generation_parameters_copypaste.py')
-rw-r--r-- | modules/generation_parameters_copypaste.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/generation_parameters_copypaste.py b/modules/generation_parameters_copypaste.py index 1292fead..2a10524f 100644 --- a/modules/generation_parameters_copypaste.py +++ b/modules/generation_parameters_copypaste.py @@ -130,7 +130,7 @@ def connect_paste_params_buttons(): )
if binding.source_text_component is not None and fields is not None:
- connect_paste(binding.paste_button, fields, binding.source_text_component, binding.override_settings_component)
+ connect_paste(binding.paste_button, fields, binding.source_text_component, binding.override_settings_component, binding.tabname)
if binding.source_tabname is not None and fields is not None:
paste_field_names = ['Prompt', 'Negative prompt', 'Steps', 'Face restoration'] + (["Seed"] if shared.opts.send_seed else [])
@@ -325,7 +325,7 @@ def create_override_settings_dict(text_pairs): return res
-def connect_paste(button, paste_fields, input_comp, override_settings_component, jsfunc=None):
+def connect_paste(button, paste_fields, input_comp, override_settings_component, tabname):
def paste_func(prompt):
if not prompt and not shared.cmd_opts.hide_ui_dir_config:
filename = os.path.join(data_path, "params.txt")
@@ -390,7 +390,7 @@ def connect_paste(button, paste_fields, input_comp, override_settings_component, button.click(
fn=paste_func,
- _js=jsfunc,
+ _js=f"recalculate_prompts_{tabname}",
inputs=[input_comp],
outputs=[x[0] for x in paste_fields],
)
|