diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-06-04 07:56:48 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-06-04 07:56:48 +0000 |
commit | f98f4f73aa4898c754681f411608df5f248619f6 (patch) | |
tree | 6b8a1f63a622f373258a1c64ea5feb8751ceb071 /modules/shared.py | |
parent | 30bbb8bce377e627be6c582315691358d9b611d8 (diff) | |
download | stable-diffusion-webui-gfx803-f98f4f73aa4898c754681f411608df5f248619f6.tar.gz stable-diffusion-webui-gfx803-f98f4f73aa4898c754681f411608df5f248619f6.tar.bz2 stable-diffusion-webui-gfx803-f98f4f73aa4898c754681f411608df5f248619f6.zip |
infer styles from prompts, and an option to control the behavior
Diffstat (limited to 'modules/shared.py')
-rw-r--r-- | modules/shared.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/shared.py b/modules/shared.py index 7025a754..53e3d5da 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -260,6 +260,10 @@ class OptionInfo: self.comment_after += f"<span class='info'>({info})</span>"
return self
+ def html(self, html):
+ self.comment_after += html
+ return self
+
def needs_restart(self):
self.comment_after += " <span class='info'>(requires restart)</span>"
return self
@@ -488,7 +492,14 @@ options_templates.update(options_section(('infotext', "Infotext"), { "add_model_hash_to_info": OptionInfo(True, "Add model hash to generation information"),
"add_model_name_to_info": OptionInfo(True, "Add model name to generation information"),
"add_version_to_infotext": OptionInfo(True, "Add program version to generation information"),
- "disable_weights_auto_swap": OptionInfo(True, "When reading generation parameters from text into UI (from PNG info or pasted text), do not change the selected model/checkpoint."),
+ "disable_weights_auto_swap": OptionInfo(True, "Disregard checkpoint information from pasted infotext").info("when reading generation parameters from text into UI"),
+ "infotext_styles": OptionInfo("Apply if any", "Infer styles from prompts of pasted infotext", gr.Radio, {"choices": ["Ignore", "Apply", "Discard", "Apply if any"]}).info("when reading generation parameters from text into UI)").html("""<ul style='margin-left: 1.5em'>
+<li>Ignore: keep prompt and styles dropdown as it is.</li>
+<li>Apply: remove style text from prompt, always replace styles dropdown value with found styles (even if none are found).</li>
+<li>Discard: remove style text from prompt, keep styles dropdown as it is.</li>
+<li>Apply if any: remove style text from prompt; if any styles are found in prompt, put them into styles dropdown, otherwise keep it as it is.</li>
+</ul>"""),
+
}))
options_templates.update(options_section(('ui', "Live previews"), {
|