diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2024-01-23 19:22:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-23 19:22:37 +0000 |
commit | c17f7ee694a42ad09b570755a1562e9ab5ba2b73 (patch) | |
tree | 09dcd3979e9532e4ea0687991149c78a66b176bc /modules/ui_prompt_styles.py | |
parent | de5a8c5cb4000408522e80c9917b71ce3228b616 (diff) | |
parent | 25e8273d2f6481deca221b29d35093f6d0c9da6a (diff) | |
download | stable-diffusion-webui-gfx803-c17f7ee694a42ad09b570755a1562e9ab5ba2b73.tar.gz stable-diffusion-webui-gfx803-c17f7ee694a42ad09b570755a1562e9ab5ba2b73.tar.bz2 stable-diffusion-webui-gfx803-c17f7ee694a42ad09b570755a1562e9ab5ba2b73.zip |
Merge pull request #14707 from AUTOMATIC1111/multi-styles-base-styles-file
re-work multi --styles-file
Diffstat (limited to 'modules/ui_prompt_styles.py')
-rw-r--r-- | modules/ui_prompt_styles.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/ui_prompt_styles.py b/modules/ui_prompt_styles.py index 0d74c23f..d67e3f17 100644 --- a/modules/ui_prompt_styles.py +++ b/modules/ui_prompt_styles.py @@ -22,9 +22,12 @@ def save_style(name, prompt, negative_prompt): if not name:
return gr.update(visible=False)
- style = styles.PromptStyle(name, prompt, negative_prompt)
+ existing_style = shared.prompt_styles.styles.get(name)
+ path = existing_style.path if existing_style is not None else None
+
+ style = styles.PromptStyle(name, prompt, negative_prompt, path)
shared.prompt_styles.styles[style.name] = style
- shared.prompt_styles.save_styles(shared.styles_filename)
+ shared.prompt_styles.save_styles()
return gr.update(visible=True)
@@ -34,7 +37,7 @@ def delete_style(name): return
shared.prompt_styles.styles.pop(name, None)
- shared.prompt_styles.save_styles(shared.styles_filename)
+ shared.prompt_styles.save_styles()
return '', '', ''
|